Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 919e842

Browse files
cleaned
1 parent 5c9d863 commit 919e842

File tree

1 file changed

+4
-39
lines changed

1 file changed

+4
-39
lines changed

‎src/router.class.php‎

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,6 @@ private function init()
8787
$this->request_uri = \filter_input(\INPUT_SERVER, 'REQUEST_URI', \FILTER_SANITIZE_ENCODED);
8888
$this->request_uri = $this->format_unix(urldecode($this->request_uri));
8989

90-
//$_SERVER['PHP_SELF'] = $this->format_path_dir($this->URI_no_query());
91-
92-
/*echo '<pre>';
93-
print_r($_SERVER);
94-
die();*/
9590
$this->physical_file = $this->format_unix($_SERVER['SCRIPT_FILENAME']);
9691
$this->extension = strrev(strstr(strrev($this->physical_file), '.', TRUE));
9792

@@ -405,12 +400,8 @@ function console_output()
405400

406401
$this->favicon();
407402

408-
//echo $this->script_filename.'<br />'.$_SERVER['SCRIPT_FILENAME'];
409-
//die();
410-
411403
if (in_array($this->getExt($this->script_filename), array("", "php"))) {
412404

413-
//return include($_SERVER['SCRIPT_FILENAME']);
414405
return include($_SERVER['DOCUMENT_ROOT'] . '/' . $this->indexPath);
415406

416407
} else {
@@ -419,13 +410,6 @@ function console_output()
419410

420411
}
421412

422-
//$_SERVER['PHP_SELF'] = rtrim($this->format_unix($_SERVER['PHP_SELF']),'/') ;
423-
//$_SERVER['PATH_INFO'] = $this->format_unix($uri_path);
424-
425-
//echo '<pre>';
426-
//print_r($_SERVER);
427-
428-
429413
}
430414

431415
}
@@ -494,6 +478,9 @@ private function URIhasPHP()
494478

495479
}
496480

481+
/**
482+
* Adjust some $_SERVER variables
483+
*/
497484
function fix_path_info()
498485
{
499486

@@ -502,38 +489,25 @@ function fix_path_info()
502489
if (($url_no_q = strstr($url, '?', true)) !== FALSE) {
503490
$url = $url_no_q;
504491
}
505-
506-
492+
507493
$path_info = isset($_SERVER['PHP_INFO']) ? $_SERVER['PHP_INFO'] : '/';
508-
$script_name = $_SERVER['SCRIPT_NAME'];
509-
$php_self = $_SERVER['PHP_SELF'];
510494

511495
if (($dot = strstr($url, '.')) !== FALSE) {
512496

513497
if (($ext = strstr($dot, '/', TRUE)) !== FALSE) {
514498

515499
$explode = explode('/', $dot);
516500
$path_info = '/' . $explode[1];
517-
$script_name = strstr($url, '.', TRUE) . rtrim($ext, '/');
518-
$php_self = substr($php_self, strlen($script_name)) . $script_name;
519-
$script_name = $php_self;
520501

521502
}
522503

523504
}
524505

525-
/* echo 'url:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $url . '<br />';
526-
echo 'path info:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $path_info . '<br />';
527-
echo 'php self:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $php_self . '<br />';
528-
echo 'script name&nbsp;&nbsp;&nbsp;' . $script_name;*/
529-
530506
if (isset($_SERVER['HTTP_L'])) {
531507
$_SERVER['HTTP_CACHE_CONTROL'] = $_SERVER['HTTP_L'];
532508
unset($_SERVER['HTTP_L']);
533509
}
534510

535-
//$_SERVER['PHP_SELF'] = $php_self;
536-
537511
if (!isset($_SERVER['PHP_INFO']) && substr($_SERVER['REQUEST_URI'], -1, 1) !== '/' && $this->getExt($_SERVER['REQUEST_URI']) == "") {
538512

539513
$_SERVER['REQUEST_URI'] = $_SERVER['REQUEST_URI'] . '/';
@@ -544,12 +518,7 @@ function fix_path_info()
544518
$_SERVER['ORIG_PHP_SELF'] = $_SERVER['PHP_SELF'];
545519
$_SERVER['ORIG_PATH_INFO'] = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : "";
546520

547-
//echo $_SERVER['SCRIPT_NAME'].'<br />';
548-
//echo '<pre>';
549-
//print_r($_SERVER);
550-
//$_SERVER['SCRIPT_NAME'] = $script_name; // drupal themes won't work with this on
551521
$_SERVER['PATH_INFO'] = $path_info;
552-
//echo $_SERVER['SCRIPT_NAME'].'<br />';
553522

554523
$_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
555524

@@ -604,9 +573,6 @@ function listen()
604573

605574
if (strlen(trim($falsy_ext))) {
606575

607-
/**
608-
* Check for PHP
609-
*/
610576
if (($e = strstr($falsy_ext, '/', TRUE)) !== FALSE) {
611577
$falsy_ext = $e;
612578
}
@@ -623,7 +589,6 @@ function listen()
623589

624590
return $this->bootstrap();
625591

626-
627592
}
628593

629594
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /