php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68291 404 on urls with '+'
Submitted: 2014-10-23 14:19 UTC Modified: 2015-09-05 12:53 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: euperia at gmail dot com Assigned: cmb
Status: Closed Package: Built-in web server
PHP Version: 5.5.18 OS: OSX
Private report: No CVE-ID:
 [2014-10-23 14:19 UTC] euperia at gmail dot com
Description:
------------
Using bower to manage JS deps and using the following javascript file throws a 404.

bower_components/history.js/scripts/bundled/html4+html5/jquery.history.js

The file definately exists and renaming it without the '+' works.  As this is a managed file renaming it isn't an option.




Test script:
---------------
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Sample page</title>
</head>
<body>

<script src="bower_components/history.js/scripts/bundled/html4+html5/jquery.history.js"></script>
</body>
</html>

Expected result:
----------------
PHP 5.5.15 Development Server started at Thu Oct 23 15:13:52 2014
Listening on http://0.0.0.0:3000
Document root is xxxxxxxxxxxxxxxxxxxxx
Press Ctrl-C to quit.
[Thu Oct 23 15:13:55 2014] 127.0.0.1:55959 [200]: /
[Thu Oct 23 15:13:55 2014] 127.0.0.1:55960 [200]: /bower_components/history.js/scripts/bundled/html4+html5/jquery.history.js

Actual result:
--------------
PHP 5.5.15 Development Server started at Thu Oct 23 15:13:52 2014
Listening on http://0.0.0.0:3000
Document root is xxxxxxxxxxxxxxxxxxxxx
Press Ctrl-C to quit.
[Thu Oct 23 15:13:55 2014] 127.0.0.1:55959 [200]: /
[Thu Oct 23 15:13:55 2014] 127.0.0.1:55960 [404]: /bower_components/history.js/scripts/bundled/html4+html5/jquery.history.js - No such file or directory

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-09-05 11:16 UTC] cmb@php.net
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: cmb
 [2015-09-05 11:16 UTC] cmb@php.net
The culprit is the URL decoding of the path component of the
request. This is done as if the path was
application/x-www-form-urlencoded, and not in the way specified by
RFC 3986, so that + signs in the path are erroneously decoded as
space characters.
 [2015-09-05 12:52 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fd94c92171eb4f25a792b38c7754bdd76933ec04
Log: Fix #68291: 404 on urls with '+'
 [2015-09-05 12:52 UTC] cmb@php.net
-Status: Analyzed +Status: Closed
 [2015-09-05 12:53 UTC] cmb@php.net
The fix for this bug has been committed.

Thank you for the report, and for helping us make PHP better.
 [2015-09-15 12:13 UTC] ab@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=fd94c92171eb4f25a792b38c7754bdd76933ec04
Log: Fix #68291: 404 on urls with '+'
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC