From: Brion Vibber Date: Wed, 18 Feb 2009 02:24:55 +0000 (+0000) Subject: Revert r46628, r46639 for now "Don't allow padding parser functions to be used to... X-Git-Tag: 1.31.0-rc.0~42821 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=ae0b528972fa3eb7fa3c07ef715c1917965a6a06;p=lhc%2Fweb%2Fwiklou.git Revert r46628, r46639 for now "Don't allow padding parser functions to be used to truncate strings." Doesn't seem to be a compelling reason to add this special-case restriction at this time, and there appear to be ways to work around it anyway, so let's not play the arms race. :) --- diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index eaf0db0fba..b2080760d2 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -473,11 +473,6 @@ class CoreParserFunctions { static function pad( $string, $length, $padding = '0', $direction = STR_PAD_RIGHT ) { $lengthOfPadding = mb_strlen( $padding ); if ( $lengthOfPadding == 0 ) return $string; - - // Thwart attempts to use this function to truncate strings. - // We don't want people implementing ParserFunctions in template, - // for performance and usability reasons. - if ($lengthOfPadding > $length && $string == '') return $string; # The remaining length to add counts down to 0 as padding is added $length = min( $length, 500 ) - mb_strlen( $string );