Remove copious amounts of commented out preg_replace calls
authorSam Reed <reedy@wikimedia.org>
Tue, 27 Jan 2015 05:34:40 +0000 (05:34 +0000)
committerSam Reed <reedy@wikimedia.org>
Tue, 27 Jan 2015 05:34:40 +0000 (05:34 +0000)
Change-Id: I9b9afea3dc6729598b240845c3d34357548cdd4a

includes/search/SearchHighlighter.php

index ec7b710..223a2fe 100644 (file)
@@ -442,12 +442,6 @@ class SearchHighlighter {
         * @return mixed
         */
        function removeWiki( $text ) {
-               // $text = preg_replace( "/'{2,5}/", "", $text );
-               // $text = preg_replace( "/\[[a-z]+:\/\/[^ ]+ ([^]]+)\]/", "\\2", $text );
-               // $text = preg_replace( "/\[\[([^]|]+)\]\]/", "\\1", $text );
-               // $text = preg_replace( "/\[\[([^]]+\|)?([^|]]+)\]\]/", "\\2", $text );
-               // $text = preg_replace( "/\\{\\|(.*?)\\|\\}/", "", $text );
-               // $text = preg_replace( "/\\[\\[[A-Za-z_-]+:([^|]+?)\\]\\]/", "", $text );
                $text = preg_replace( "/\\{\\{([^|]+?)\\}\\}/", "", $text );
                $text = preg_replace( "/\\{\\{([^|]+\\|)(.*?)\\}\\}/", "\\2", $text );
                $text = preg_replace( "/\\[\\[([^|]+?)\\]\\]/", "\\1", $text );
@@ -456,7 +450,6 @@ class SearchHighlighter {
                        array( $this, 'linkReplace' ),
                        $text
                );
-               // $text = preg_replace("/\\[\\[([^|]+\\|)(.*?)\\]\\]/", "\\2", $text);
                $text = preg_replace( "/<\/?[^>]+>/", "", $text );
                $text = preg_replace( "/'''''/", "", $text );
                $text = preg_replace( "/('''|<\/?[iIuUbB]>)/", "", $text );