Welcome! » Log In » Create A New Profile

Cache directory permissions setting

Posted by skodak 
Cache directory permissions setting
January 12, 2011 04:54PM

Hello,

at present the cache directory permissions are hardcoded to be 0755, sometimes it is useful to specify custom permissions (executing PHP from two different user accounts, phpunit, safe mode, etc.).

I have hacked the standard HTML Purifier to use custom permissions for the Moodle project - https://github.com/moodle/custom-htmlpurifier/compare/882ffed9babb9ddc20bfb0979b14bb52d64c96c4...MOODLE_20_STABLE

Is this interesting? Could I do anything to get something similar included in HTML Purifier?

Thanks for all your hard work on this library!

Petr

Re: Cache directory permissions setting
January 12, 2011 09:04PM

This patch seems fairly reasonable. Could convert it into a patch on top of HTML Purifier repository, with the configuration option implemented and some basic tests?

Re: Cache directory permissions setting
January 13, 2011 03:35AM

Yes, I will try it over the weekend, thanks!

Re: Cache directory permissions setting
January 13, 2011 06:13AM

Here is my first attempt: https://github.com/skodak/htmlpurifier/compare/master...Cache_SerializerPermissions I have sent you a PULL request on the github too.

Re: Cache directory permissions setting
January 13, 2011 09:01AM

Cool. You'll want to squash that patchset into one patch (git rebase -i origin/master), but that looks really good. I'll test and push later today.

Re: Cache directory permissions setting
January 13, 2011 09:09AM

Here it is squashed in a new branch https://github.com/skodak/htmlpurifier/tree/Cache_SerializerPermissions_onecommit Git is still relatively new to me, but I am learning to love it, thanks!

Re: Cache directory permissions setting
January 13, 2011 06:29PM

Pushed. Thanks!

Re: Cache directory permissions setting
January 13, 2011 06:37PM

oops, the "VERSION: 4.2.1" in library/HTMLPurifier/ConfigSchema/schema/Cache.SerializerPermissions.txt is probably incorrect, should be 4.3.0 now, right?

Re: Cache directory permissions setting
January 13, 2011 09:33PM

Yep. Fixed.

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with < and >.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: