mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Removed some redundant code when looking for slash arguments (use me() function instead)
This commit is contained in:
parent
ac68f7ffc8
commit
eaa50dbc83
1 changed files with 3 additions and 10 deletions
|
@ -126,7 +126,7 @@ function get_referer() {
|
||||||
|
|
||||||
function me() {
|
function me() {
|
||||||
/// returns the name of the current script, WITH the querystring portion.
|
/// returns the name of the current script, WITH the querystring portion.
|
||||||
/// this function is necessary because PHP_SELF and REQUEST_URI and PATH_INFO
|
/// this function is necessary because PHP_SELF and REQUEST_URI and SCRIPT_NAME
|
||||||
/// return different things depending on a lot of things like your OS, Web
|
/// return different things depending on a lot of things like your OS, Web
|
||||||
/// server, and the way PHP is compiled (ie. as a CGI, module, ISAPI, etc.)
|
/// server, and the way PHP is compiled (ie. as a CGI, module, ISAPI, etc.)
|
||||||
|
|
||||||
|
@ -419,17 +419,10 @@ function validate_email ($address) {
|
||||||
function get_slash_arguments($file="file.php") {
|
function get_slash_arguments($file="file.php") {
|
||||||
/// Searches the current environment variables for some slash arguments
|
/// Searches the current environment variables for some slash arguments
|
||||||
|
|
||||||
if (isset($_SERVER['PATH_INFO'])) {
|
if (!$string = me()) {
|
||||||
return $_SERVER['PATH_INFO'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($_SERVER['PHP_SELF'])) {
|
|
||||||
$string = $_SERVER['PHP_SELF'];
|
|
||||||
} else if (isset($_SERVER['REQUEST_URI'])) {
|
|
||||||
$string = $_SERVER['REQUEST_URI'];
|
|
||||||
} else {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pathinfo = explode($file, $string);
|
$pathinfo = explode($file, $string);
|
||||||
|
|
||||||
if (!empty($path_info[1])) {
|
if (!empty($path_info[1])) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue