Skip to content

Instantly share code, notes, and snippets.

@ptarjan
Created January 29, 2014 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptarjan/8683717 to your computer and use it in GitHub Desktop.
Save ptarjan/8683717 to your computer and use it in GitHub Desktop.
diff --git i/hphp/runtime/server/http-protocol.cpp w/hphp/runtime/server/http-protocol.cpp
index 205ab06..cc0342d 100644
--- i/hphp/runtime/server/http-protocol.cpp
+++ w/hphp/runtime/server/http-protocol.cpp
@@ -558,7 +558,10 @@ void HttpProtocol::CopyPathInfo(Variant& server,
server.set(s_SCRIPT_NAME, r.resolvedURL());
}
- if (r.rewritten()) {
+ auto scriptFilename = transport->getPathTranslated();
+ if (!scriptFilename.empty()) {
+ server.set(s_PHP_SELF, scriptFilename);
+ } else if (r.rewritten()) {
server.set(s_PHP_SELF, r.originalURL());
} else {
server.set(s_PHP_SELF, r.resolvedURL() + r.origPathInfo());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment