diff --git a/modules/photon-cdn.php b/modules/photon-cdn.php index 9c936cc773538..27b8db1ada1b1 100644 --- a/modules/photon-cdn.php +++ b/modules/photon-cdn.php @@ -118,8 +118,8 @@ public static function fix_script_relative_path( $relative, $src ) { return substr( $src, 1 + $strpos ); } - // Reverse cdnize_plugin_assets for loading the path - if ( preg_match( '#' . preg_quote( self::CDN, '#' ) . 'p/[^/]+/[^/]+/(.*)$#', $src, $m ) ) { + // Get the local path from a URL which was CDN'ed by cdnize_plugin_assets(). + if ( preg_match( '#^' . preg_quote( self::CDN, '#' ) . 'p/[^/]+/[^/]+/(.*)$#', $src, $m ) ) { return $m[1]; }