r17662 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17661‎ | r17662 | r17663 >
Date:07:21, 14 November 2006
Author:nickj
Status:old
Tags:
Comment:
Prevent PHP Notice: "Uninitialized string offset: 0 in includes/Linker.php on line 954" in error_reporting(E_ALL) mode, when doing a "Show Preview" with the edit summary as just "[[]]".
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -951,7 +951,7 @@
952952 $trail = "";
953953 }
954954 $linkRegexp = '/\[\[(.*?)\]\]' . preg_quote( $trail, '/' ) . '/';
955 - if ($match[1][0] == ':')
 955+ if (isset($match[1][0]) && $match[1][0] == ':')
956956 $match[1] = substr($match[1], 1);
957957 $thelink = $this->makeLink( $match[1], $text, "", $trail );
958958 }