From: tonythomas01 <01tonythomas@gmail.com> Date: Sun, 12 Jan 2014 07:10:23 +0000 (+0530) Subject: Check for CoreParserFunction::urlFunction from array to boolean X-Git-Tag: 1.31.0-rc.0~17073^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=2f8772135b113414175fd9c63c697474ef64542b;p=lhc%2Fweb%2Fwiklou.git Check for CoreParserFunction::urlFunction from array to boolean and return values accordingly to htmlspecialchars() PHP Warning: htmlspecialchars() expects parameter 1 to be string, array given in CoreParserFunctions.php on line 212 Checked for the return value of urlFunction in localurle() and fullurle() function Bug: 59881 Change-Id: I7ae092f89b9cfbbe91d1883c2182ca5907825ba4 --- diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 3966b9e0e8..67b1c66205 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -209,7 +209,12 @@ class CoreParserFunctions { } static function localurle( $parser, $s = '', $arg = null ) { - return htmlspecialchars( self::urlFunction( 'getLocalURL', $s, $arg ) ); + $temp = self::urlFunction( 'getLocalURL', $s, $arg ); + if( !is_string( $temp ) ) { + return $temp; + } else { + return htmlspecialchars( $temp ); + } } static function fullurl( $parser, $s = '', $arg = null ) { @@ -217,7 +222,12 @@ class CoreParserFunctions { } static function fullurle( $parser, $s = '', $arg = null ) { - return htmlspecialchars( self::urlFunction( 'getFullURL', $s, $arg ) ); + $temp = self::urlFunction( 'getFullURL', $s, $arg ); + if( !is_string( $temp ) ) { + return $temp; + } else { + return htmlspecialchars( $temp ); + } } static function canonicalurl( $parser, $s = '', $arg = null ) {