Edit report at http://bugs.php.net/bug.php?id=51685&edit=1
ID: 51685 Updated by: [email protected] Reported by: shepard dot dl at gmail dot com Summary: dirname() returns part of query string parsing a URL containing a slash -Status: Open +Status: Bogus Type: Bug Package: Directory function related Operating System: Linux PHP Version: 5.3.2 New Comment: Use parse_url if you like to parse URL. Previous Comments: ------------------------------------------------------------------------ [2010-04-28 19:42:33] shepard dot dl at gmail dot com I made a mistake in the description. It should read: "If a url with a query string that contains a slash (/) is passed to dirname(), dirname() returns everything up to the slash in the query string." ------------------------------------------------------------------------ [2010-04-28 19:37:28] shepard dot dl at gmail dot com Description: ------------ If a url that contains a slash (/) is passed to dirname(), dirname() returns everything up to the slash in the query string. Test script: --------------- $dirname = "web/index.php?url=pages/test.php"; print dirname($dirname); Expected result: ---------------- application/pages Actual result: -------------- application/pages/index.php?url=pages ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51685&edit=1
