From 8557af4f36cde6e80de416949dddfbe5188b00a5 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 19 Dec 2010 20:06:10 +0000 Subject: [PATCH] Add an alternative for test (disabled by default) --- htdocs/lib/functions.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 6d2b2dc5697..ee32b897c19 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -118,8 +118,10 @@ 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('/^([.*]+\.php)$/i',$path,$regs); + preg_match('/^([^.]+\.php)/i',$path,$regs); if (! empty($regs[1])) $path = $regs[1]; + // An alternative for proxy but extremely slow + //if (! @file_get_contents('http://'.$_SERVER["SERVER_NAME"].DOL_URL_ROOT.$path)) $res = DOL_URL_ROOT_ALT.$path; if (! file_exists(DOL_DOCUMENT_ROOT.$path)) $res = DOL_URL_ROOT_ALT.$path; } }