r87386 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87385‎ | r87386 | r87387 >
Date:04:22, 4 May 2011
Author:bawolff
Status:ok
Tags:
Comment:
(bug 28800) <charinsert>+</charinsert> tries to insert the empty string instead of a literal +.

The code assumed explode( "+", "+" ) gave an empty array, where really it gave an array with
2 elements both of which are the empty string.
Modified paths:
  • /trunk/extensions/CharInsert/CharInsert.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CharInsert/CharInsert.php
@@ -77,7 +77,7 @@
7878
7979 function charInsertItem( $data ) {
8080 $chars = explode( '+', $data );
81 - if( count( $chars ) > 1 ) {
 81+ if( count( $chars ) > 1 && $chars[0] !== '' ) {
8282 return charInsertChar( $chars[0], $chars[1], 'Click the character while selecting a text' );
8383 } elseif( count( $chars ) == 1 ) {
8484 return charInsertChar( $chars[0] );

Status & tagging log