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 f4dd241

Browse files
author
iustin
committed
s
1 parent bd64022 commit f4dd241

File tree

2 files changed

+57
-2
lines changed

2 files changed

+57
-2
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"start-codeigniter": "php -d max_execution_time=280 -S 0.0.0.0:9001 -t ./codeigniter src/router.php",
99
"start-yii": "php -d max_execution_time=280 -S 0.0.0.0:9002 -t ./yii/web src/router.php",
1010
"start-wordpress": "php -d max_execution_time=280 -S 0.0.0.0:9003 -t ./wordpress src/router.php",
11-
"start-wordpress48": "php -d max_execution_time=280 -S 0.0.0.0:9004 -t ./wordpress48 src/router.php",
11+
"start-wordpress48": "php -d max_execution_time=280 -S 0.0.0.0:9012 -t ./wordpress48 src/router.php",
1212
"start-drupal7": "php -d max_execution_time=280 -S 0.0.0.0:9005 -t ./drupal7 src/router.php",
1313
"start-drupal8": "php -d max_execution_time=280 -S 0.0.0.0:9006 -t ./drupal8 src/router.php",
1414
"test-router-path": "node ./test/routerPath.js"

‎src/router.class.php‎

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,23 @@ function fix_path_info()
517517

518518
}
519519

520+
} else {
521+
522+
if (substr($path_info, -1, 1) != '/') {
523+
$path_info = $path_info . '/';
524+
}
525+
/*echo '<pre>';
526+
print_r($_SERVER);
527+
die();*/
528+
520529
}
521530

531+
/**
532+
* Encountered during development containing "max-age"
533+
* It seems to be a malformed version of HTTP_CACHE_CONTROL , HTTP_............L
534+
* It would appear and disappear on random requests switching with HTTP_CACHE_CONTROL,
535+
* yet both would contain the same "max-age" value
536+
*/
522537
if (isset($_SERVER['HTTP_L'])) {
523538
$_SERVER['HTTP_CACHE_CONTROL'] = $_SERVER['HTTP_L'];
524539
unset($_SERVER['HTTP_L']);
@@ -547,7 +562,47 @@ function fix_path_info()
547562
}
548563
$_SERVER['ORIG_PATH_INFO'] = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : "";
549564

550-
//$_SERVER['PATH_INFO'] = $path_info;
565+
/**
566+
* Drupal 8 - NPAS:
567+
* - upload files - ok
568+
* - update.php - ok
569+
* - install themes - ok
570+
* Codeigniter - NPAS - ok
571+
* Wordpress NPAS - install | custom links | upload | page not found - ok
572+
*/
573+
if (isset($_SERVER['PHP_INFO'])) {
574+
575+
$_SERVER['PATH_INFO'] = $path_info;
576+
577+
} else {
578+
579+
580+
/*if( $_SERVER['PATH_INFO'] == '/user'){
581+
$_SERVER['PATH_INFO'] = '/user/';
582+
$_SERVER['PHP_SELF'] = '/index.php/user/';
583+
}*/
584+
/* echo '<pre>';
585+
print_r($_SERVER);
586+
die();*/
587+
if ($path_info == '/' && $_SERVER['ORIG_PATH_INFO'] != $path_info && strlen($_SERVER['ORIG_PATH_INFO'])) {
588+
589+
/**
590+
* Drupal 7 - default - /user doesn't redirect to login, instead it redirects to homepage - FAIL
591+
* -- breaks wordpress
592+
*/
593+
//$_SERVER['PATH_INFO'] = $path_info; // for /user on drupal 7
594+
595+
/**
596+
* Wordpress - default - install | custom links | upload | page not found - ok
597+
* -- breaks above for Drupal 7
598+
*/
599+
//$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
600+
601+
}
602+
603+
604+
}
605+
551606

552607
$_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] . (isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : "");
553608

0 commit comments

Comments
(0)

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