Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Karaoke Mugen
sites
portal
Commits
03b19454
Commit
03b19454
authored
Mar 15, 2019
by
Mathieu Delestre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix route handling
parent
996d7131
Pipeline
#6432
passed with stage
in 34 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
bootstrap.php
bootstrap.php
+8
-1
No files found.
bootstrap.php
View file @
03b19454
...
...
@@ -15,7 +15,14 @@ define('BOOTSTRAP_LOADED', true);
define
(
'ENV_ROOTPATH'
,
realpath
(
__DIR__
));
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'
);
$env_route
=
null
;
if
(
preg_match
(
'/^[a-z]{2}(\/.*)?$/'
,
ENV_REQUEST
))
$env_route
=
preg_replace
(
'/^[a-z]{2}\/?/'
,
''
,
ENV_REQUEST
);
else
if
(
ENV_REQUEST
)
$env_route
=
ENV_REQUEST
;
define
(
'ENV_ROUTE'
,
$env_route
?
$env_route
:
'index'
);
// extraction de la langue courante
if
(
preg_match
(
'/^([a-z]{2})(\/.*)?$/'
,
ENV_REQUEST
,
$reg
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment