1
1
<?php
2
- error_reporting (E_ALL );
3
2
$ headers = array ('Accept ' , 'Accept-CH ' , 'Accept-Charset ' , 'Accept-Datetime ' , 'Accept-Encoding ' , 'Accept-Ext ' , 'Accept-Features ' , 'Accept-Language ' , 'Accept-Params ' , 'Accept-Ranges ' ,
4
3
'Access-Control-Allow-Credentials ' , 'Access-Control-Allow-Headers ' , 'Access-Control-Allow-Methods ' , 'Access-Control-Allow-Origin ' , 'Access-Control-Expose-Headers ' ,
5
4
'Access-Control-Max-Age ' , 'Access-Control-Request-Headers ' , 'Access-Control-Request-Method ' , 'Age ' , 'Allow ' , 'Alternates ' , 'Authentication-Info ' , 'Authorization ' , 'C-Ext ' ,
@@ -396,7 +395,7 @@ function console_output()
396
395
} else {
397
396
398
397
if (file_exists ($ uri_filepath ) && !is_dir ($ uri_filepath )) {
399
- //if (is_file($uri_filepath)) {
398
+ //if (is_file($uri_filepath)) {
400
399
401
400
$ this ->process_request ();
402
401
@@ -528,7 +527,7 @@ function fix_path_info()
528
527
echo 'php self: ' . $php_self . '<br />';
529
528
echo 'script name ' . $script_name;*/
530
529
531
- if ( isset ($ _SERVER ['HTTP_L ' ])){
530
+ if ( isset ($ _SERVER ['HTTP_L ' ])){
532
531
$ _SERVER ['HTTP_CACHE_CONTROL ' ] = $ _SERVER ['HTTP_L ' ];
533
532
unset($ _SERVER ['HTTP_L ' ]);
534
533
}
@@ -538,7 +537,7 @@ function fix_path_info()
538
537
if (!isset ($ _SERVER ['PHP_INFO ' ]) && substr ($ _SERVER ['REQUEST_URI ' ], -1 , 1 ) !== '/ ' && $ this ->getExt ($ _SERVER ['REQUEST_URI ' ]) == "" ) {
539
538
540
539
$ _SERVER ['REQUEST_URI ' ] = $ _SERVER ['REQUEST_URI ' ] . '/ ' ;
541
- $ _SERVER ['PHP_SELF ' ] = $ _SERVER ['PHP_SELF ' ] .'/ ' ;
540
+ $ _SERVER ['PHP_SELF ' ] = $ _SERVER ['PHP_SELF ' ] .'/ ' ;
542
541
543
542
}
544
543
@@ -552,10 +551,10 @@ function fix_path_info()
552
551
$ _SERVER ['PATH_INFO ' ] = $ path_info ;
553
552
//echo $_SERVER['SCRIPT_NAME'].'<br />';
554
553
555
- $ _SERVER ['PHP_SELF ' ] = $ _SERVER ['SCRIPT_NAME ' ];
554
+ $ _SERVER ['PHP_SELF ' ] = $ _SERVER ['SCRIPT_NAME ' ] . $ _SERVER [ ' PATH_INFO ' ] ;
556
555
557
- if ( substr ($ _SERVER ['PHP_SELF ' ], -1 , 1 ) == '/ ' ){
558
- $ _SERVER ['PHP_SELF ' ] = substr ($ _SERVER ['PHP_SELF ' ],0 , -1 );
556
+ if ( substr ($ _SERVER ['PHP_SELF ' ], -1 , 1 ) == '/ ' ){
557
+ $ _SERVER ['PHP_SELF ' ] = substr ($ _SERVER ['PHP_SELF ' ],0 , -1 );
559
558
}
560
559
561
560
}
@@ -570,8 +569,9 @@ function listen()
570
569
$ this ->fix_path_info ();
571
570
$ this ->init ();
572
571
572
+ $ falsy_ext = $ this ->getExt ($ this ->URI_no_query ());
573
573
574
- if (in_array ($ this -> getExt ( $ this -> URI_no_query ()) , array ("" , "php " ))) {
574
+ if (in_array ($ falsy_ext , array ("" , "php " ))) {
575
575
576
576
/**
577
577
* Drupal file uploads
@@ -581,13 +581,13 @@ function listen()
581
581
582
582
return FALSE ;
583
583
584
- }else {
584
+ }else {
585
585
586
586
/**
587
587
* Wordpress wp-admin
588
588
*/
589
589
590
- if ( $ this ->getExt ($ this ->URI_no_query ()) == "" ) {
590
+ if ( $ this ->getExt ($ this ->URI_no_query ()) == "" ) {
591
591
592
592
/**
593
593
* Output hack fix
@@ -600,6 +600,25 @@ function listen()
600
600
601
601
}
602
602
603
+ } else {
604
+
605
+ if (strlen (trim ($ falsy_ext ))) {
606
+
607
+ /**
608
+ * Check for PHP
609
+ */
610
+ if (($ e = strstr ($ falsy_ext , '/ ' , TRUE )) !== FALSE ) {
611
+ $ falsy_ext = $ e ;
612
+ }
613
+
614
+ if ($ falsy_ext == 'php ' ) {
615
+
616
+ return FALSE ;
617
+
618
+ }
619
+
620
+ }
621
+
603
622
}
604
623
605
624
return $ this ->bootstrap ();
0 commit comments