Raise E_USER_WARNING if bad option passed to wfMsgExt()
authorAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 26 Sep 2008 17:25:17 +0000 (17:25 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Fri, 26 Sep 2008 17:25:17 +0000 (17:25 +0000)
includes/GlobalFunctions.php

index 34260c7..301e2a8 100644 (file)
@@ -689,6 +689,15 @@ function wfMsgExt( $key, $options ) {
                $options = array($options);
        }
 
+       foreach( $options as $option ) {
+               if( !in_array( $option, array( 'parse', 'parseinline', 'escape',
+               'escapenoentities', 'replaceafter', 'parsemag', 'content',
+               'language' ) ) ) {
+                       trigger_error( "wfMsgExt called with incorrect parameter $option",
+                               E_USER_WARNING );
+               }
+       }
+
        if( in_array('content', $options) ) {
                $forContent = true;
                $langCode = true;