Refactor LanguageConversion so that title conversion isn't so flimsy. Pull MagicWord...
[lhc/web/wiklou.git] / includes / MagicWord.php
index 8877bac..f5ac889 100644 (file)
@@ -161,6 +161,8 @@ class MagicWord {
                'index',
                'noindex',
                'staticredirect',
+               'notitleconvert',
+               'nocontentconvert',
        );
 
 
@@ -318,16 +320,16 @@ class MagicWord {
        }
 
        /**
-        * Returns true if the text contains the word
-        * @return bool
+        * Returns the number of times the text contains the word
+        * @return int
         */
        function match( $text ) {
                return preg_match( $this->getRegex(), $text );
        }
 
        /**
-        * Returns true if the text starts with the word
-        * @return bool
+        * Returns if the text starts with the word
+        * @return int
         */
        function matchStart( $text ) {
                return preg_match( $this->getRegexStart(), $text );
@@ -343,7 +345,7 @@ class MagicWord {
                $matches = array();
                $matchcount = preg_match( $this->getVariableStartToEndRegex(), $text, $matches );
                if ( $matchcount == 0 ) {
-                       return NULL;
+                       return null;
                } else {
                        # multiple matched parts (variable match); some will be empty because of
                        # synonyms. The variable will be the second non-empty one so remove any