goldyhmr237 / web-optimizator

Automatically exported from code.google.com/p/web-optimizator
0 stars 0 forks source link

class YuiCompressor: Logic Error @ File: libs/php/class.yuicompressor.php #493

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Latest SVN Wordpress = 3.1-beta2-17056
Latest Web-optimizator = 1.4.0b (SVN = 2857)
Latest Nginx: nginx version: nginx/0.9.2
Latest PHP-FPM: PHP 5.3.4 (fpm-fcgi) (built: Dec 18 2010 21:19:46)

class YuiCompressor: Logic Error
PHP File: libs/php/class.yuicompressor.php
Logic error on line # 62 (of class.yuicompressor.php)

Current Logic Reads as: # 62
----------------------------
if (strpos(@ini_get('disable_functions') . ' ' . 
@ini_get('suhosin.executor.func.blacklist'), 'shell_exec') === false && 
@!ini_get('safe_mode')) {
----------------------------
This basically 'reads' as allow shell_exec() ONLY if PHP 'Safe Mode' is 
ACTIVE.!!

For me, yuicompressor class WORKS with this simple change:
----------------------------
if (strpos(@ini_get('disable_functions') . ' ' . 
@ini_get('suhosin.executor.func.blacklist'), 'shell_exec') === false && 
@!ini_get('safe_mode')) {
-^------------------------- note the ! for 'NOT' condition

Why would PHP SAFE MODE be the given 'Webo' environment 'exec' choice to run 
the yuicompressor class?? (double-duh)....

Original issue reported on code.google.com by peterbowey on 24 Dec 2010 at 2:13

GoogleCodeExporter commented 9 years ago
Oops [Sorry]I forgot to show the 1st line #62 WITHOUT the added (!).
So the original line # 62 of libs/php/class.yuicompressor.php reads as:

if (strpos(@ini_get('disable_functions') . ' ' . 
@ini_get('suhosin.executor.func.blacklist'), 'shell_exec') === false && 
@ini_get('safe_mode')) {

My apologies for confusing, too busy debugging other issues!

Original comment by peterbowey on 24 Dec 2010 at 2:15

GoogleCodeExporter commented 9 years ago
PHP Safe more doesn't allow to run shell_exec, so there must be no SAFE MODE. 
Initial condition is right (except, maybe incorrect @! -> !@).

Original comment by sunny.dr...@gmail.com on 24 Dec 2010 at 2:38

GoogleCodeExporter commented 9 years ago
You are right. Fixed with rev.2891

Original comment by sunny.dr...@gmail.com on 24 Dec 2010 at 2:39