mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26: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() {
|
||||
/// 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
|
||||
/// 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") {
|
||||
/// Searches the current environment variables for some slash arguments
|
||||
|
||||
if (isset($_SERVER['PATH_INFO'])) {
|
||||
return $_SERVER['PATH_INFO'];
|
||||
}
|
||||
|
||||
if (isset($_SERVER['PHP_SELF'])) {
|
||||
$string = $_SERVER['PHP_SELF'];
|
||||
} else if (isset($_SERVER['REQUEST_URI'])) {
|
||||
$string = $_SERVER['REQUEST_URI'];
|
||||
} else {
|
||||
if (!$string = me()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$pathinfo = explode($file, $string);
|
||||
|
||||
if (!empty($path_info[1])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue