Index: trunk/extensions/SemanticForms/includes/SF_FormUtils.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | static function setGlobalJSVariables( &$vars ) { |
14 | 14 | global $sfgAutocompleteValues, $sfgAutocompleteOnAllChars; |
15 | 15 | global $sfgInitJSFunctions, $sfgValidationJSFunctions; |
16 | | - global $sfgShowOnSelect, $wgParser; |
| 16 | + global $sfgShowOnSelect, $wgParser, $wgUser; |
17 | 17 | |
18 | 18 | $vars['sfgRemoveText'] = wfMsg( 'sf_formedit_remove' ); |
19 | 19 | $vars['sfgAutocompleteOnAllChars'] = $sfgAutocompleteOnAllChars; |
— | — | @@ -29,7 +29,17 @@ |
30 | 30 | $vars['sfgBadNumberErrorStr'] = wfMsg( 'sf_bad_number_error' ); |
31 | 31 | $vars['sfgBadIntegerErrorStr'] = wfMsg( 'sf_bad_integer_error' ); |
32 | 32 | $vars['sfgBadDateErrorStr'] = wfMsg( 'sf_bad_date_error' ); |
33 | | - $vars['sfgAnonEditWarning'] = StringUtils::delimiterReplace( '<', '>', '', $wgParser->recursiveTagParse( wfMsg( 'anoneditwarning' ) ) ); |
| 33 | + |
| 34 | + // $wgParser might not be initialized, e.g. on Special pages |
| 35 | + if ( $wgParser->mOptions == null ) { |
| 36 | + $parser = new Parser(); |
| 37 | + $msg = $parser -> parse (wfMsg( 'anoneditwarning' ), new Title(), ParserOptions::newFromUser( $wgUser ) ) -> getText(); |
| 38 | + } else { |
| 39 | + $msg = $wgParser->recursiveTagParse( wfMsg( 'anoneditwarning' ) ); |
| 40 | + } |
| 41 | + |
| 42 | + $vars['sfgAnonEditWarning'] = StringUtils::delimiterReplace( '<', '>', '', $msg ); |
| 43 | + |
34 | 44 | return true; |
35 | 45 | } |
36 | 46 | |