Merge "Revert "Do not encode "'" as %27 (redirect loop in Opera 12)""
[lhc/web/wiklou.git] / includes / parser / CoreParserFunctions.php
index cf8cd41..7639e2f 100644 (file)
@@ -88,9 +88,13 @@ class CoreParserFunctions {
                if ( strval( $part1 ) !== '' ) {
                        $args = array_slice( func_get_args(), 2 );
                        $message = wfMessage( $part1, $args )
-                               ->inLanguage( $parser->getOptions()->getUserLangObj() )->plain();
-
-                       return array( $message, 'noparse' => false );
+                               ->inLanguage( $parser->getOptions()->getUserLangObj() );
+                       if ( !$message->exists() ) {
+                               // When message does not exists, the message name is surrounded by angle
+                               // and can result in a tag, therefore escape the angles
+                               return $message->escaped();
+                       }
+                       return array( $message->plain(), 'noparse' => false );
                } else {
                        return array( 'found' => false );
                }
@@ -178,7 +182,9 @@ class CoreParserFunctions {
                        default:
                                $func = 'urlencode';
                }
-               return $parser->markerSkipCallback( $s, $func );
+               // See T105242, where the choice to kill markers and various
+               // other options were discussed.
+               return $func( $parser->killMarkers( $s ) );
        }
 
        public static function lcfirst( $parser, $s = '' ) {