Ticket #33691: force-url_scheme-content-for-own-domain.patch
File force-url_scheme-content-for-own-domain.patch, 851 bytes (added by , 9 years ago) |
---|
-
wp-includes/post-template.php
308 308 if ( $preview ) // Preview fix for JavaScript bug with foreign languages. 309 309 $output = preg_replace_callback( '/\%u([0-9A-F]{4})/', '_convert_urlencoded_to_entities', $output ); 310 310 311 //Only do this if using ssl 312 if ( is_ssl() ) { 313 //Pass each URL into callback 314 $output = preg_replace_callback( 315 '#(www\.|http://)?[a-z0-9]+\.[a-z0-9]{2,4}\S*#i', 316 function($match) { 317 $url = $match[0]; 318 //Only manipulate own urls 319 if (strpos($url, get_current_site()->domain) !== false) { 320 return set_url_scheme($url); 321 } else { 322 return $url; 323 } 324 }, 325 $output 326 ); 327 } 328 311 329 return $output; 312 330 } 313 331