Commit 223334b1 authored by Mathieu Delestre's avatar Mathieu Delestre

fix (3)

Hé Gérard ! encore un pour la route ?
parent 7c5ad468
Pipeline #4630 passed with stage
in 1 minute and 31 seconds
......@@ -3,7 +3,7 @@ function route_url($code,$language=null)
{
$code = $code ? $code : ENV_ROUTE;
$language = $language ? $language : ENV_LNG;
return ENV_BASEPATH.$language.'/'.($code!='index' ? $code:'');
return ENV_BASEPATH.'/'.$language.'/'.($code!='index' ? $code:'');
}
// # # ##
......
......@@ -13,12 +13,8 @@ use Gettext\Translator;
define('BOOTSTRAP_LOADED', true);
define('ENV_ROOTPATH', realpath(__DIR__));
$temp = str_replace('/bootstrap.php', '', getField($_SERVER, 'SCRIPT_NAME', getField($_SERVER, 'PHP_SELF')));
if($temp)
define('ENV_BASEPATH', $temp.'/');
else
define('ENV_BASEPATH', '/');
define('ENV_REQUEST', str_replace(ENV_BASEPATH, '', getField($_SERVER, 'REQUEST_URI')));
define('ENV_BASEPATH', str_replace('/bootstrap.php', '', getField($_SERVER, 'SCRIPT_NAME', getField($_SERVER, 'PHP_SELF'))));
define('ENV_REQUEST', preg_replace('/\/$/','',preg_replace('/^\//','',str_replace(ENV_BASEPATH, '', getField(explode('?',getField($_SERVER, 'REQUEST_URI')), 0)))));
define('ENV_ROUTE', preg_replace('/^[a-z]{2}\/?/', '', ENV_REQUEST) ? preg_replace('/^[a-z]{2}\/?/', '', ENV_REQUEST) : 'index');
// extraction de la langue courante
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment