Skip to content

Commit

Permalink
Fix serve router.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudLigny committed Mar 13, 2017
1 parent d135636 commit 116b276
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion res/router.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
$html = str_replace('</body>', $script."\n".'</body>', $html);
}
// replaces base url by localhost
$html = str_replace(trim(file_get_contents($_SERVER['DOCUMENT_ROOT'].'/../.phpoole/baseurl')), 'http://localhost:8000/', $html);
$baseurl = trim(file_get_contents($_SERVER['DOCUMENT_ROOT'].'/../.phpoole/baseurl'));
if (false !== strstr($baseurl, 'http') || $baseurl != '/') {
$html = str_replace($baseurl, 'http://localhost:8000/', $html);
}
echo $html;

return true;
Expand Down

0 comments on commit 116b276

Please sign in to comment.