PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 261001
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v261001
261001 260927 260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 All 191 releases
← All changes | src/includes/classes/sc-files-in.inc.php +13 -12 260814 → 261001 View file →
@@ -132,9 +132,10 @@
132 132 'player_width' => '480', 'player_height' => '270', 'player_aspectratio' => '',
133 133
134 134 // Playback
135 135 'player_autostart' => 'no', 'player_fallback' => 'yes', 'player_mute' => 'no',
136 - 'player_primary' => (($attr['player'] === 'jw-player-v7' || $attr['player'] === 'jw-player-v6') ? 'html5' : 'flash'),
136 + //260920.1835 Avoid reading the optional player attribute before shortcode defaults have been applied.
137 + 'player_primary' => ((isset($attr['player']) && ($attr['player'] === 'jw-player-v7' || $attr['player'] === 'jw-player-v6')) ? 'html5' : 'flash'),
137 138 'player_repeat' => 'no', 'player_startparam' => '', // `startparam` seems to be JW Player v6 only.
138 139
139 140 // Advanced Option Blocks
140 141 'player_option_blocks' => ''), $attr);
@@ -174,9 +175,9 @@
174 175 if(!preg_match('/^(?:[0-9]+|[0-9]+(?:\.[0-9]+)?%)$/D', (string)$attr['player_width']))
175 176 $attr['player_width'] = '480';
176 177 if(!preg_match('/^(?:[0-9]+|[0-9]+(?:\.[0-9]+)?%)$/D', (string)$attr['player_height']))
177 178 $attr['player_height'] = '270';
178 - if($attr['player_aspectratio'] && (!preg_match('/^([0-9]+):([0-9]+)$/D', (string)$attr['player_aspectratio'], $_player_aspectratio) || !(integer)$_player_aspectratio[1] || !(integer)$_player_aspectratio[2]))
179 + if($attr['player_aspectratio'] && (!preg_match('/^([0-9]+):([0-9]+)$/D', (string)$attr['player_aspectratio'], $_player_aspectratio) || !(int)$_player_aspectratio[1] || !(int)$_player_aspectratio[2]))
179 180 $attr['player_aspectratio'] = '';
180 181 unset($_player_aspectratio); //260805 Housekeeping.
181 182
182 183 //260805 Resolution tokens become filename suffixes and labels, so discard tokens outside the supported token format.
@@ -258,10 +259,10 @@
258 259 $player_resolution_aspect_ratio_w = 16; // Default aspect ratio width.
259 260 $player_resolution_aspect_ratio_h = 9; // Default aspect ratio in height.
260 261 if($attr['player_aspectratio'] && preg_match('/^[0-9]+\:[0-9]+$/', $attr['player_aspectratio']))
261 262 list($player_resolution_aspect_ratio_w, $player_resolution_aspect_ratio_h) = explode(':', $attr['player_aspectratio']);
262 - $player_resolution_aspect_ratio_w = (integer)$player_resolution_aspect_ratio_w; // Force integer value.
263 - $player_resolution_aspect_ratio_h = (integer)$player_resolution_aspect_ratio_h; // Force integer value.
263 + $player_resolution_aspect_ratio_w = (int)$player_resolution_aspect_ratio_w; // Force integer value.
264 + $player_resolution_aspect_ratio_h = (int)$player_resolution_aspect_ratio_h; // Force integer value.
264 265
265 266 // See: <http://wsharks.com/1yzjAl6> and <http://wsharks.com/1yzkhea> regarging the SMIL bitrate hints given here.
266 267 $player_resolution_bitrates = array(2160 => '35000000', 1440 => '10000000', 1080 => '8000000', 720 => '5000000', 640 => '2500001', 480 => '2500000', 360 => '1000000', 320 => '999999', 240 => '500000', 180 => '300000');
267 268 $player_resolution_bitrates = apply_filters('ws_plugin__s2member_sc_get_stream_resolution_bitrates', $player_resolution_bitrates, get_defined_vars());
@@ -303,9 +304,9 @@
303 304 $_player_source = array('file' => $player_resolution_sources_smil_file_url);
304 305 if($_is_first_file_download_url) $_player_source['default'] = 'true';
305 306 $player_sources[] = $_player_source;
306 307 }
307 - $_file_download_url['smil']['height'] = (integer)$_file_download_url_label; // e.g., `720p-HD` becomes `720`.
308 + $_file_download_url['smil']['height'] = (int)$_file_download_url_label; // e.g., `720p-HD` becomes `720`.
308 309 if(!$_file_download_url['smil']['height']) $_file_download_url['smil']['height'] = 720; // Use a default height if invalid.
309 310 $_file_download_url['smil']['width'] = ceil(($_file_download_url['smil']['height'] / $player_resolution_aspect_ratio_h) * $player_resolution_aspect_ratio_w);
310 311
311 312 $_file_download_url['smil']['system-bitrate'] = '1'; // Default value.
@@ -362,10 +363,10 @@
362 363
363 364 //260805 Parse flexible attributes as data and substitute only values encoded for their exact output contexts.
364 365 $_player_tracks = self::sc_get_stream_json_data($attr['player_tracks'], 'array');
365 366 $_player_option_blocks = self::sc_get_stream_json_data($attr['player_option_blocks'], 'object-properties');
366 - $_player_width = (strpos($attr['player_width'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_width']) : (string)(integer)$attr['player_width'];
367 - $_player_height = $attr['player_aspectratio'] ? '""' : ((strpos($attr['player_height'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_height']) : (string)(integer)$attr['player_height']);
367 + $_player_width = (strpos($attr['player_width'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_width']) : (string)(int)$attr['player_width'];
368 + $_player_height = $attr['player_aspectratio'] ? '""' : ((strpos($attr['player_height'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_height']) : (string)(int)$attr['player_height']);
368 369 if(!is_string($_player_width)) $_player_width = '480';
369 370 if(!is_string($_player_height)) $_player_height = '270';
370 371
371 372 //260805 strtr() replaces literal placeholders without reprocessing placeholder-like text inside generated values.
@@ -408,10 +409,10 @@
408 409 $player_resolution_aspect_ratio_w = 16; // Default aspect ratio width.
409 410 $player_resolution_aspect_ratio_h = 9; // Default aspect ratio in height.
410 411 if($attr['player_aspectratio'] && preg_match('/^[0-9]+\:[0-9]+$/', $attr['player_aspectratio']))
411 412 list($player_resolution_aspect_ratio_w, $player_resolution_aspect_ratio_h) = explode(':', $attr['player_aspectratio']);
412 - $player_resolution_aspect_ratio_w = (integer)$player_resolution_aspect_ratio_w; // Force integer value.
413 - $player_resolution_aspect_ratio_h = (integer)$player_resolution_aspect_ratio_h; // Force integer value.
413 + $player_resolution_aspect_ratio_w = (int)$player_resolution_aspect_ratio_w; // Force integer value.
414 + $player_resolution_aspect_ratio_h = (int)$player_resolution_aspect_ratio_h; // Force integer value.
414 415
415 416 // See: <http://wsharks.com/1yzjAl6> and <http://wsharks.com/1yzkhea> regarging the SMIL bitrate hints given here.
416 417 $player_resolution_bitrates = array(2160 => '35000000', 1440 => '10000000', 1080 => '8000000', 720 => '5000000', 640 => '2500001', 480 => '2500000', 360 => '1000000', 320 => '999999', 240 => '500000', 180 => '300000');
417 418 $player_resolution_bitrates = apply_filters('ws_plugin__s2member_sc_get_stream_resolution_bitrates', $player_resolution_bitrates, get_defined_vars());
@@ -453,9 +454,9 @@
453 454 $_player_source = array('file' => $player_resolution_sources_smil_file_url);
454 455 if($_is_first_file_download_url) $_player_source['default'] = 'true';
455 456 $player_sources[] = $_player_source;
456 457 }
457 - $_file_download_url['smil']['height'] = (integer)$_file_download_url_label; // e.g., `720p-HD` becomes `720`.
458 + $_file_download_url['smil']['height'] = (int)$_file_download_url_label; // e.g., `720p-HD` becomes `720`.
458 459 if(!$_file_download_url['smil']['height']) $_file_download_url['smil']['height'] = 720; // Use a default height if invalid.
459 460 $_file_download_url['smil']['width'] = ceil(($_file_download_url['smil']['height'] / $player_resolution_aspect_ratio_h) * $player_resolution_aspect_ratio_w);
460 461
461 462 $_file_download_url['smil']['system-bitrate'] = '1'; // Default value.
@@ -512,10 +513,10 @@
512 513
513 514 //260805 Parse flexible attributes as data and substitute only values encoded for their exact output contexts.
514 515 $_player_captions = self::sc_get_stream_json_data($attr['player_captions'], 'array');
515 516 $_player_option_blocks = self::sc_get_stream_json_data($attr['player_option_blocks'], 'object-properties');
516 - $_player_width = (strpos($attr['player_width'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_width']) : (string)(integer)$attr['player_width'];
517 - $_player_height = $attr['player_aspectratio'] ? '""' : ((strpos($attr['player_height'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_height']) : (string)(integer)$attr['player_height']);
517 + $_player_width = (strpos($attr['player_width'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_width']) : (string)(int)$attr['player_width'];
518 + $_player_height = $attr['player_aspectratio'] ? '""' : ((strpos($attr['player_height'], '%') !== FALSE) ? wp_json_encode((string)$attr['player_height']) : (string)(int)$attr['player_height']);
518 519 if(!is_string($_player_width)) $_player_width = '480';
519 520 if(!is_string($_player_height)) $_player_height = '270';
520 521
521 522 //260805 strtr() replaces literal placeholders without reprocessing placeholder-like text inside generated values.