Ticket #31645: 31645.8.patch
File 31645.8.patch, 1.0 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 333 // If the URL is root-relative, prepend the protocol and domain name 334 if ( $url && $this->domain && preg_match( '%^/[^/]+%', $url ) ) { 335 $url = $this->domain . $url; 336 } 337 338 // Not absolute or protocol-relative URL. 339 if ( ! preg_match( '%^(?:https?:)?//[^/]+%', $url ) ) { 340 return ''; 341 } 342 331 343 return esc_url_raw( $url, array( 'http', 'https' ) ); 332 344 } 333 345 … … 573 585 574 586 if ( 'u' === $key ) { 575 587 $value = $this->_limit_url( $value ); 588 589 if ( preg_match( '%^(?:https?:)?//[^/]+%i', $value, $domain_match ) ) { 590 $this->domain = $domain_match[0]; 591 } 576 592 } else { 577 593 $value = $this->_limit_string( $value ); 578 594 }