Fixed "Invalid AJAX response" When using Built-in PHP Webserver in Windows (#1258)

This commit is contained in:
Matias Griese
2017-11-07 16:57:52 +02:00
parent 0fd22ad933
commit 9b445ac5b6
2 changed files with 3 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
* Reverted `case_insensitive_urls` option as it was causing issues with taxonomy [#1733](https://github.com/getgrav/grav/pull/1733)
* Removed an extra `/` in `CompileFile.php` [#1693](https://github.com/getgrav/grav/pull/1693)
* Uri: Encode user and password to prevent issues in browsers
* Fixed "Invalid AJAX response" When using Built-in PHP Webserver in Windows [#1258](https://github.com/getgrav/grav/issues/1258)
# v1.3.8
## 10/26/2017

View File

@@ -249,7 +249,8 @@ class Uri
*/
private function buildRootPath()
{
$scriptPath = $_SERVER['PHP_SELF'];
// In Windows script path uses backslash, convert it:
$scriptPath = str_replace('\\', '/', $_SERVER['PHP_SELF']);
$rootPath = str_replace(' ', '%20', rtrim(substr($scriptPath, 0, strpos($scriptPath, 'index.php')), '/'));
// check if userdir in the path and workaround PHP bug with PHP_SELF