From fbd609e2a43ef96f8a1972a2433c5cc9ebd8f4f0 Mon Sep 17 00:00:00 2001 From: Mathieu Maes Date: Sun, 17 Mar 2013 10:49:13 +0100 Subject: [PATCH] Fixes #386 --- lessc.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lessc.inc.php b/lessc.inc.php index 4fc3a75b..91203a46 100644 --- a/lessc.inc.php +++ b/lessc.inc.php @@ -861,7 +861,7 @@ protected function lib__sprintf($args) { $template = $this->compileValue($this->lib_e($string)); $i = 0; - if (preg_match_all('/%[dsa]/', $template, $m)) { + if (preg_match_all('/%[dsaDSA]/', $template, $m)) { foreach ($m[0] as $match) { $val = isset($values[$i]) ? $this->reduce($values[$i]) : array('keyword', ''); @@ -873,6 +873,9 @@ protected function lib__sprintf($args) { $i++; $rep = $this->compileValue($this->lib_e($val)); + if (ctype_upper(substr($match, 1))) { + $rep = urlencode($rep); + } $template = preg_replace('/'.self::preg_quote($match).'/', $rep, $template, 1); }