(bug 12753) Empty captions in MediaWiki:Sidebar result in PHP errors.
authorHuji <huji@users.mediawiki.org>
Thu, 24 Jan 2008 17:06:19 +0000 (17:06 +0000)
committerHuji <huji@users.mediawiki.org>
Thu, 24 Jan 2008 17:06:19 +0000 (17:06 +0000)
* The previous commit didn't cover the cases where the whole caption line was missing.

includes/Skin.php

index b6d15bd..2d2a4ae 100644 (file)
@@ -1626,7 +1626,6 @@ END;
                        if (strpos($line, '**') !== 0) {
                                $line = trim($line, '* ');
                                $heading = $line;
-                               if( strlen($heading) == 0) $heading='';
                        } else {
                                if (strpos($line, '|') !== false) { // sanity check
                                        $line = explode( '|' , trim($line, '* '), 2 );
@@ -1650,6 +1649,7 @@ END;
                                                }
                                        }
 
+                                       if( !isset($heading) ) $heading='';
                                        $bar[$heading][] = array(
                                                'text' => $text,
                                                'href' => $href,