Changeset 3323935
- Timestamp:
- 07/07/2025 11:13:51 PM (9 months ago)
- Location:
- open-video/trunk
- Files:
-
- 4 edited
-
OpenVideoNamespace/Channels.php (modified) (1 diff)
-
OpenVideoNamespace/RequestUtils.php (modified) (1 diff)
-
README.txt (modified) (2 diffs)
-
open-video.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
open-video/trunk/OpenVideoNamespace/Channels.php
r3321428 r3323935 290 290 // Check if the path matches our middleton rewrite rule regex 291 291 // Use the PHP-compatible regex for preg_match 292 if (preg_match( self::MIDDLETON_PREG_MATCH_REGEX, $path)) {292 if (preg_match('#' . self::openvideoplugin_get_middleton_preg_regex() . '#', $path)) { 293 293 // This is a middleton path and only difference is trailing slash, prevent redirect 294 294 return false; -
open-video/trunk/OpenVideoNamespace/RequestUtils.php
r3321444 r3323935 51 51 'Referer' => $site, 52 52 'X-OpenVideo-Wp-Referer' => $site, 53 // X-OpenVideo-Original-Path is the original path requested by user. 54 // since we may modify $path below for proxying openvideo channel paths 55 'X-OpenVideo-Original-Path' => $path, 53 56 'User-Agent' => !empty($_SERVER['HTTP_USER_AGENT']) ? sanitize_text_field($_SERVER['HTTP_USER_AGENT']) : '', 54 57 ); 55 58 59 // If the path starts with the custom channel path as a full segment, replace it with 'openvideo/' 60 $channel_path = OpenVideoPlugin_Channels::openvideoplugin_get_channel_path(); 61 $path_trimmed = ltrim($path, '/'); 62 $add_proxy_header = false; 63 if ( 64 (strpos($path_trimmed, $channel_path . '/') === 0 || $path_trimmed === $channel_path) && 65 strpos($path_trimmed, 'openvideo/') !== 0 && $path_trimmed !== 'openvideo' 66 ) { 67 $remaining = ''; 68 if ($path_trimmed === $channel_path) { 69 $remaining = ''; 70 } else { 71 $remaining = substr($path_trimmed, strlen($channel_path) + 1); // +1 for the slash 72 } 73 $path = 'openvideo/' . ltrim($remaining, '/'); 74 $add_proxy_header = true; 75 } 76 77 if ($add_proxy_header) { 78 // this header tells open.video that the custom channel path was used 79 $request_headers['X-OV-Proxy-Channel-Request'] = $channel_path; 80 } 81 56 82 $method = isset($_SERVER['REQUEST_METHOD']) ? sanitize_text_field($_SERVER['REQUEST_METHOD']) : 'GET'; 57 83 58 // If the path starts with the current channel path as a full segment, replace it with 'openvideo/'59 $channel_path = OpenVideoPlugin_Channels::openvideoplugin_get_channel_path();60 $path_trimmed = ltrim($path, '/');61 if (strpos($path_trimmed, $channel_path . '/') === 0 || $path_trimmed === $channel_path) {62 $remaining = '';63 if ($path_trimmed === $channel_path) {64 $remaining = '';65 } else {66 $remaining = substr($path_trimmed, strlen($channel_path) + 1); // +1 for the slash67 }68 $path = 'openvideo/' . ltrim($remaining, '/');69 }70 84 $url = self::OPENVIDEOPLUGIN_MIDDLETON_API_ENDPOINT . $path; 71 85 -
open-video/trunk/README.txt
r3321444 r3323935 6 6 Tested up to: 6.8 7 7 Requires PHP: 7.0 8 Stable tag: 1.0. 18 Stable tag: 1.0.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 27 27 28 28 == Changelog == 29 = 1.0.2 = 30 * Bug fixes 31 29 32 = 1.0.1 = 30 33 * Bug fixes -
open-video/trunk/open-video.php
r3321444 r3323935 16 16 * 17 17 * @link https://www.open.video/ 18 * @since 1.0. 118 * @since 1.0.2 19 19 * @package Open.Video 20 20 * … … 23 23 * Plugin URI: https://wordpress.org/plugins/open-video 24 24 * Description: Open.Video allows you to easily embed videos to your site from the Open.Video Network. 25 * Version: 1.0. 125 * Version: 1.0.2 26 26 * Requires at least: 6.1 27 27 * Requires PHP: 7.0 … … 41 41 * Rename this for your plugin and update it as you release new versions. 42 42 */ 43 define('OPENVIDEOPLUGIN_VERSION', '1.0. 1');43 define('OPENVIDEOPLUGIN_VERSION', '1.0.2'); 44 44 45 45 global $openvideoplugin_regex;
Note: See TracChangeset
for help on using the changeset viewer.