bootstrap.inc line 727
/**
* Since $_SERVER['REQUEST_URI'] is only available on Apache, we
* generate an equivalent using other environment variables.
*/
function request_uri() {
if (isset($_SERVER['REQUEST_URI'])) {
$uri = $_SERVER['REQUEST_URI'];
}
else {
if (isset($_SERVER['argv'])) {
$uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];
}
elseif (isset($_SERVER['QUERY_STRING'])) {
$uri = $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];
}
else {
$uri = $_SERVER['SCRIPT_NAME'];
}
}
return $uri;
}
In the function request_uri() $uri not it is necessary, and return will work faster.
ifelse block whil increasing is simplest to read.
This is my improvement variant:
/**
* Since $_SERVER['REQUEST_URI'] is only available on Apache, we
* generate an equivalent using other environment variables.
*/
function request_uri() {
if (isset($_SERVER['REQUEST_URI'])) {
return $_SERVER['REQUEST_URI'];
} elseif (isset($_SERVER['argv'])) {
return $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];
} elseif (isset($_SERVER['QUERY_STRING'])) {
return $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];
} else {
return $_SERVER['SCRIPT_NAME'];
}
}
Read patch in attachment.
| Comment | File | Size | Author |
|---|---|---|---|
| bootstrap.patch | 999 bytes | stokito |
Comments
Comment #1
stokito commentedSorry I am stupid. I am understand. Please delete this issue.
Comment #2
dpearcefl commentedYour wish is granted.