Ticket #31645: 31645-make-fully-qualified.diff
File 31645-make-fully-qualified.diff, 819 bytes (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-press-this.php
928 928 $link = $data['_links']['shortlink']; 929 929 } 930 930 931 if ( ! preg_match( '/^https?:/', $link ) ) { 932 if ( preg_match( '/^[\/]{1}[^\/]+/', $link ) ) { 933 // From root: /blah 934 $link = preg_replace( '/^(https?:\/\/[^\/]+)(\/.*)?$/', '\1', $data['u'] ) . $link; 935 } else if ( preg_match( '/^[\/]{2}[^\/]+/', $link ) ) { 936 // Protocol relative: //blah.com/blah 937 $link = preg_replace( '/^(https?:)\/\/.+$/', '\1', $data['u'] ) . $link; 938 } else { 939 // Relative, or diff protocol 940 return ''; 941 } 942 } 943 931 944 return $link; 932 945 } 933 946