Changeset 31818
- Timestamp:
- 03/18/2015 08:42:38 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-press-this.php
r31810 r31818 18 18 19 19 private $embeds = array(); 20 21 private $domain = ''; 20 22 21 23 /** … … 326 328 // Does it look like an URL? 327 329 if ( ! preg_match( '/^([!#$&-;=?-\[\]_a-z~]|%[0-9a-fA-F]{2})+$/', $url ) ) { 330 return ''; 331 } 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 ) ) { 328 340 return ''; 329 341 } … … 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 );
Note: See TracChangeset
for help on using the changeset viewer.