Ticket #31645: 31645.6.patch
File 31645.6.patch, 1.1 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-press-this.php
18 18 19 19 private $embeds = array(); 20 20 21 private $domain = ''; 22 21 23 /** 22 24 * Constructor. 23 25 * … … 328 330 return ''; 329 331 } 330 332 331 return esc_url_raw( $url, array( 'http', 'https' ) ); 333 $url = esc_url_raw( $url, array( 'http', 'https' ) ); 334 335 // If the URL is root-relative, prepend the protocol and domain name 336 if ( $url && strlen( $url ) > 2 && $this->domain && $url{0} === '/' && $url{1} !== '/' ) { 337 $url = $this->domain . $url; 338 } 339 340 return $url; 332 341 } 333 342 334 343 private function _limit_img( $src ) { … … 573 582 574 583 if ( 'u' === $key ) { 575 584 $value = $this->_limit_url( $value ); 585 586 if ( preg_match( '%^(?:https?:)?//[^/]+%i', $value, $domain_match ) ) { 587 $this->domain = $domain_match[0]; 588 } 576 589 } else { 577 590 $value = $this->_limit_string( $value ); 578 591 }