Re: is there a way to stop HTMLPurifier/CSStidy from forcing input CSS into all lowercase?
| From: | Tommy Pham | Date: | Fri, 01 Jun 2012 05:57:17 +0000 |
| Subject: | Re: is there a way to stop HTMLPurifier/CSStidy from forcing input CSS into all lowercase? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-318068@lists.php.net to get a copy of this message | ||
On Thu, May 31, 2012 at 10:48 PM, Tommy Pham <tommyhp2@gmail.com> wrote:
> On Thu, May 31, 2012 at 10:33 PM, Govinda <govinda.webdnatalk@gmail.com> wrote:
>> Hi guys
>>
>> anyone here using HTMLpurifier and CSStidy together? (like e.g. to allow users to create
>> their own external style sheets via form input)
>>
>> ...for example, in the way this post's answer explains how to use HTMLpurifier and
>> CSStidy together:
>>
>> http://stackoverflow.com/questions/3241616/
>>
>> If so, do you know how to set CSStidy's config options in that context?
>>
>> I found how to set CSStidy's config options if I was running CSStidy from the command
>> line, or on its _own_ from PHP runtime, but I do not know how to set the config options from within
>> HTMLpurifier, or even how to hack/override either of those libraries to solve my particular issue.
>> I looked and hacked and thought for sure I would find the offending line of code... but somehow,
>> nothing I have tried is stopping one or both of those libraries from forcing all my input CSS into
>> lowercase, which I do not want. The issue is that I need the input CSS's case to be left as
>> the user input it (so that for example background image paths in that CSS do not break)..
You need to get better tools. I found this with Notepad++ for Windows
searching "case" within *.php files filter within the root directory
of the extracted zip/tarball:
H:\data\Downloads\dev\PHP\htmlpurifier-4.4.0\library\HTMLPurifier\AttrDef\CSS\Font.php
(6 hits)
Line 45: $lowercase_string = strtolower($string);
Line 46: if (isset($system_fonts[$lowercase_string])) {
Line 47: return $lowercase_string;
Line 61: case 0:
Line 77: case 1:
Line 131: case 2:
Haven't looked at the entire file or source code but that looks close
enough to me... ;)
>>
>> more details, attempted fixes, etc.:
>> http://stackoverflow.com/questions/10843600/
>>
>> Thanks for any thoughts/tips of any kind
>> -Govinda
>
> Have you tried http://htmlpurifier.org/phorum/ and did you
> noticed
> "Since the project has been suspended, please only contact me if you
> intend to continue maintaining it." for CSSTidy?
>
> Regards,
> Tommy