Plugin Directory

Changeset 3197684


Ignore:
Timestamp:
11/26/2024 08:31:27 PM (16 months ago)
Author:
r00tsector
Message:

Update to version 1.0.11 from GitHub

Location:
hls-player
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hls-player/tags/1.0.11/Readme.txt

    r3167577 r3197684  
    44Donate link: https://donate.stripe.com/5kA7w2bRl3KN7qU3cd
    55Requires at least: 6.4
    6 Tested up to: 6.6
     6Tested up to: 6.7
    77Requires PHP: 8.1
    8 Stable tag: 1.0.10
     8Stable tag: 1.0.11
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0
  • hls-player/tags/1.0.11/hls-player.php

    r3167577 r3197684  
    44 * Plugin URI: https://github.com/root-sector/wordpress-plugin-hls-player-free
    55 * Description: HLS Player is a simple, lightweight HTTP Live Streaming player for WordPress. Leveraging video.js, the leading open-source HTML5 player, it enables effortless embedding of both responsive and fixed-width .m3u8 or .mpd HLS videos into posts and pages.
    6  * Version: 1.0.10
     6 * Version: 1.0.11
    77 * Requires at least: 6.4
    88 * Requires PHP: 8.1
     
    1717}
    1818
    19 define('HLS_PLAYER_VERSION', '1.0.10');
     19define('HLS_PLAYER_VERSION', '1.0.11');
    2020
    2121class HLSPlayer
     
    5252            return;
    5353        }
    54         // Define shortcode attributes with defaults
    55         $default_atts = array(
     54
     55        // Define allowed shortcode attributes with defaults
     56        $allowed_atts = array(
    5657            'url' => '',
    57             'class' => '',
     58            'class' => 'video-js vjs-fluid',
    5859            'width' => '',
    5960            'height' => '',
     
    6566            'poster' => '',
    6667            'captions' => '',
     68            'protected' => 'false',
     69            'withcredentials' => 'false',
     70            'kinesis_video_stream' => 'false',
     71            'cloudfront_signed_cookies' => 'false',
    6772            'videojs_custom_options_json' => '{}',
    6873        );
    6974
    70         // Parse shortcode attributes
    71         $atts = shortcode_atts($default_atts, $atts, 'videojs_hls');
     75        // Only use attributes that are explicitly defined in allowed_atts
     76        $filtered_atts = is_array($atts) ? array_intersect_key($atts, $allowed_atts) : array();
     77       
     78        // Parse shortcode attributes with our filtered attributes
     79        $atts = shortcode_atts($allowed_atts, $filtered_atts, 'videojs_hls');
    7280
    7381        // Generate a unique id for the video element
     
    7583
    7684        // Generate video tag attributes
    77         $class = !empty($atts['class']) ? $atts['class'] : 'video-js vjs-fluid';
     85        $class = !empty($atts['class']) ? esc_attr($atts['class']) : 'video-js vjs-fluid';
    7886        $controls = $atts['controls'] == 'false' ? '' : ' controls';
    7987        $preload = $atts['preload'] == 'metadata' ? ' preload="metadata"' : ($atts['preload'] == 'none' ? ' preload="none"' : ' preload="auto"');
     
    8189        $loop = $atts['loop'] == 'true' ? ' loop' : '';
    8290        $muted = $atts['muted'] == 'true' ? ' muted' : '';
    83         $poster = !empty($atts['poster']) ? ' poster="' . $atts['poster'] . '"' : '';
     91        $poster = !empty($atts['poster']) ? ' poster="' . esc_url($atts['poster']) . '"' : '';
    8492
    8593        $type = ''; // Initialize with empty type
     
    125133        }
    126134
    127         $video_html = '
    128         <div style="position: relative;">
    129             <video id="' . $video_id . '" class="' . $class . '" ' . $controls . $preload . $autoplay . $loop . $muted . $poster . ' width="' . $atts['width'] . '" height="' . $atts['height'] . '">
    130             </video>
    131         </div>';
     135        $video_html = sprintf(
     136            '<div style="position: relative;"><video id="%s" class="%s"%s%s%s%s%s%s%s%s></video></div>',
     137            esc_attr($video_id),
     138            $class,
     139            $controls,
     140            $preload,
     141            $autoplay,
     142            $loop,
     143            $muted,
     144            $poster,
     145            !empty($atts['width']) ? ' width="' . esc_attr($atts['width']) . '"' : '',
     146            !empty($atts['height']) ? ' height="' . esc_attr($atts['height']) . '"' : ''
     147        );
    132148
    133149        $script_data = array(
     
    140156
    141157        $encoded_data = base64_encode(json_encode($script_data));
    142         $inline_script = "var hlsPlayerData_{$video_id} = '{$encoded_data}';";
     158        $inline_script = "var hlsPlayerData_{$video_id} = '" . esc_js($encoded_data) . "';";
    143159
    144160        // Enqueue the main script and add the inline script
  • hls-player/trunk/Readme.txt

    r3167577 r3197684  
    44Donate link: https://donate.stripe.com/5kA7w2bRl3KN7qU3cd
    55Requires at least: 6.4
    6 Tested up to: 6.6
     6Tested up to: 6.7
    77Requires PHP: 8.1
    8 Stable tag: 1.0.10
     8Stable tag: 1.0.11
    99License: GPLv3
    1010License URI: https://www.gnu.org/licenses/gpl-3.0
  • hls-player/trunk/hls-player.php

    r3167577 r3197684  
    44 * Plugin URI: https://github.com/root-sector/wordpress-plugin-hls-player-free
    55 * Description: HLS Player is a simple, lightweight HTTP Live Streaming player for WordPress. Leveraging video.js, the leading open-source HTML5 player, it enables effortless embedding of both responsive and fixed-width .m3u8 or .mpd HLS videos into posts and pages.
    6  * Version: 1.0.10
     6 * Version: 1.0.11
    77 * Requires at least: 6.4
    88 * Requires PHP: 8.1
     
    1717}
    1818
    19 define('HLS_PLAYER_VERSION', '1.0.10');
     19define('HLS_PLAYER_VERSION', '1.0.11');
    2020
    2121class HLSPlayer
     
    5252            return;
    5353        }
    54         // Define shortcode attributes with defaults
    55         $default_atts = array(
     54
     55        // Define allowed shortcode attributes with defaults
     56        $allowed_atts = array(
    5657            'url' => '',
    57             'class' => '',
     58            'class' => 'video-js vjs-fluid',
    5859            'width' => '',
    5960            'height' => '',
     
    6566            'poster' => '',
    6667            'captions' => '',
     68            'protected' => 'false',
     69            'withcredentials' => 'false',
     70            'kinesis_video_stream' => 'false',
     71            'cloudfront_signed_cookies' => 'false',
    6772            'videojs_custom_options_json' => '{}',
    6873        );
    6974
    70         // Parse shortcode attributes
    71         $atts = shortcode_atts($default_atts, $atts, 'videojs_hls');
     75        // Only use attributes that are explicitly defined in allowed_atts
     76        $filtered_atts = is_array($atts) ? array_intersect_key($atts, $allowed_atts) : array();
     77       
     78        // Parse shortcode attributes with our filtered attributes
     79        $atts = shortcode_atts($allowed_atts, $filtered_atts, 'videojs_hls');
    7280
    7381        // Generate a unique id for the video element
     
    7583
    7684        // Generate video tag attributes
    77         $class = !empty($atts['class']) ? $atts['class'] : 'video-js vjs-fluid';
     85        $class = !empty($atts['class']) ? esc_attr($atts['class']) : 'video-js vjs-fluid';
    7886        $controls = $atts['controls'] == 'false' ? '' : ' controls';
    7987        $preload = $atts['preload'] == 'metadata' ? ' preload="metadata"' : ($atts['preload'] == 'none' ? ' preload="none"' : ' preload="auto"');
     
    8189        $loop = $atts['loop'] == 'true' ? ' loop' : '';
    8290        $muted = $atts['muted'] == 'true' ? ' muted' : '';
    83         $poster = !empty($atts['poster']) ? ' poster="' . $atts['poster'] . '"' : '';
     91        $poster = !empty($atts['poster']) ? ' poster="' . esc_url($atts['poster']) . '"' : '';
    8492
    8593        $type = ''; // Initialize with empty type
     
    125133        }
    126134
    127         $video_html = '
    128         <div style="position: relative;">
    129             <video id="' . $video_id . '" class="' . $class . '" ' . $controls . $preload . $autoplay . $loop . $muted . $poster . ' width="' . $atts['width'] . '" height="' . $atts['height'] . '">
    130             </video>
    131         </div>';
     135        $video_html = sprintf(
     136            '<div style="position: relative;"><video id="%s" class="%s"%s%s%s%s%s%s%s%s></video></div>',
     137            esc_attr($video_id),
     138            $class,
     139            $controls,
     140            $preload,
     141            $autoplay,
     142            $loop,
     143            $muted,
     144            $poster,
     145            !empty($atts['width']) ? ' width="' . esc_attr($atts['width']) . '"' : '',
     146            !empty($atts['height']) ? ' height="' . esc_attr($atts['height']) . '"' : ''
     147        );
    132148
    133149        $script_data = array(
     
    140156
    141157        $encoded_data = base64_encode(json_encode($script_data));
    142         $inline_script = "var hlsPlayerData_{$video_id} = '{$encoded_data}';";
     158        $inline_script = "var hlsPlayerData_{$video_id} = '" . esc_js($encoded_data) . "';";
    143159
    144160        // Enqueue the main script and add the inline script
Note: See TracChangeset for help on using the changeset viewer.