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 5eb3820

Browse files
added content-length to correct output
1 parent 919e842 commit 5eb3820

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

‎src/router.class.php‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ function fix_path_info()
489489
if (($url_no_q = strstr($url, '?', true)) !== FALSE) {
490490
$url = $url_no_q;
491491
}
492-
492+
493493
$path_info = isset($_SERVER['PHP_INFO']) ? $_SERVER['PHP_INFO'] : '/';
494494

495495
if (($dot = strstr($url, '.')) !== FALSE) {
@@ -515,7 +515,12 @@ function fix_path_info()
515515

516516
}
517517

518-
$_SERVER['ORIG_PHP_SELF'] = $_SERVER['PHP_SELF'];
518+
if( !isset( $_SERVER['ORIG_PHP_SELF'])){
519+
$_SERVER['ORIG_PHP_SELF'] = $_SERVER['PHP_SELF'];
520+
}
521+
if( !isset( $_SERVER['ORIG_PHP_SELF'])){
522+
$_SERVER['ORIG_PATH_INFO'] = "";
523+
}
519524
$_SERVER['ORIG_PATH_INFO'] = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : "";
520525

521526
$_SERVER['PATH_INFO'] = $path_info;
@@ -557,11 +562,8 @@ function listen()
557562
*/
558563

559564
if ($this->getExt($this->URI_no_query()) == "") {
560-
561-
/**
562-
* Output hack fix
563-
*/
564-
header("Content-Length: -1");
565+
566+
header("Content-Length: ".$this->file_length);
565567

566568
return FALSE;
567569

0 commit comments

Comments
(0)

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