Refining EditPage::pseudoParseSectionAnchor function (partial fix for 2831 - now...
authorTim Laqua <tlaqua@users.mediawiki.org>
Thu, 6 Sep 2007 19:42:53 +0000 (19:42 +0000)
committerTim Laqua <tlaqua@users.mediawiki.org>
Thu, 6 Sep 2007 19:42:53 +0000 (19:42 +0000)
includes/EditPage.php

index ad3c2b6..7442d11 100644 (file)
@@ -1625,13 +1625,18 @@ END
                
                # Strip internal link markup
                $text = preg_replace('/\[\[:?([^[|]+)\|([^[]+)\]\]/','$2',$text);
-               $text = preg_replace('/\[\[:?([^[]+)\]\]/','$1',$text);
+               $text = preg_replace('/\[\[:?([^[]+)\|?\]\]/','$1',$text);
                
                # Strip external link markup (FIXME: Not Tolerant to blank link text
                # I.E. [http://www.mediawiki.org] will render as [1] or something depending
                # on how many empty links there are on the page - need to figure that out.
                $text = preg_replace('/\[(?:' . wfUrlProtocols() . ')([^ ]+?) ([^[]+)\]/','$2',$text);
                
+               # Parse wikitext quotes (italics & bold)
+               $text = Parser::doQuotes($text);
+               
+               # Strip HTML tags
+               $text = preg_replace( '/<.*?' . '>/', '', $text );
                return $text;
        }