Fix: Bad link for .css.php and .js.php files

This commit is contained in:
Laurent Destailleur 2011-03-13 22:57:56 +00:00
parent 1b926f6a7e
commit 981aa4e0df

View File

@ -116,7 +116,7 @@ function dol_buildpath($path,$mode=0)
// FIXME Trying to know if a file on disk exist by forging path on disk from url
// works only for some web server and some setup. This is bugged when
// using proxy, rewriting, virtual path, etc...
preg_match('/^([^.]+(\.css)?(\.php)?(\.js)?)/i',$path,$regs);
preg_match('/^([^.]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i',$path,$regs); // Take part before '?'
if (! empty($regs[1])) $filepath = $regs[1];
// An alternative for proxy but extremely slow
//$url = 'http://'.$_SERVER["SERVER_NAME"].DOL_URL_ROOT.$path;