splittingred / phpThumbOf

A secure phpthumb output filter for MODx Revolution
http://rtfm.modx.com/display/addon/phpthumbof/
23 stars 17 forks source link

Don't use $_SERVER['DOCUMENT_ROOT'] but MODx base_path! #10

Closed bertoost closed 13 years ago

bertoost commented 13 years ago

For our local installation we use apaches-userdir wich means that the server-document root not is /var/www/ or something, but like /home/username/public_html/. This /var/www/ path is used by phpthumb to check if your writing outside the root directory (wich not is allowed!)

Why this isn't using the MODx base-path??? This is the root path of your MODx installation. To fix this problem for us I need to add a single line below the initiation of the phpthumb class. This is done by adding this on line 58 of the phpthumbof snippet

$phpThumb->config_document_root = $modx->getOption('base_path');

I hope a next version has fixed this! It is realy annoing that this isn't working by default!