Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5138
patch-15053.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:19 PM
2014-11-21 22:19:56 (UTC+0)
Size
821 B
Referenced Files
None
Subscribers
None
patch-15053.patch
View Options
Index: includes/Title.php
===================================================================
--- includes/Title.php (revision 38715)
+++ includes/Title.php (working copy)
@@ -296,10 +296,12 @@
*/
public static function newFromRedirect( $text ) {
$redir = MagicWord::get( 'redirect' );
- if( $redir->matchStart( trim($text) ) ) {
+ $text = trim($text);
+ if( $redir->matchStartAndRemove( $text ) ) {
// Extract the first link and see if it's usable
+ // Ensure that it really does come directly after #REDIRECT
$m = array();
- if( preg_match( '!\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) {
+ if( preg_match( '!^\s*\[{2}(.*?)(?:\|.*?)?\]{2}!', $text, $m ) ) {
// Strip preceding colon used to "escape" categories, etc.
// and URL-decode links
if( strpos( $m[1], '%' ) !== false ) {
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4701
Default Alt Text
patch-15053.patch (821 B)
Attached To
Mode
T17053: Redirect parsing is over-permissive; syntactically broken redirects are parsed as redirects to the wrong place.
Attached
Detach File
Event Timeline
Log In to Comment