lessphp icon indicating copy to clipboard operation
lessphp copied to clipboard

Fix for #386: Format function (%) doesn't support uppercase placeholders

Open webberig opened this issue 12 years ago • 1 comments

I have coded a solution for #386. Less.js uses encodeURIComponent() if the matched tag is uppercase, so I followed that logic and basically made 2 changes to the lib__sprintf() function:

  • Changed the regex that looks for %d, %s or %a, so that it also will match uppercase tags
  • If the match is uppercase, call urlencode() on the given $value

webberig avatar Mar 17 '13 10:03 webberig

Thanks. A unit test to confirm the functionality would be nice. Without it it might still get reviewed/merged, but might take longer.

Krinkle avatar Oct 15 '18 23:10 Krinkle