| Project: | Drupal core |
| Version: | 7.x-dev |
| Component: | xml-rpc system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
| Issue tags: | needs backport to D7 |
Issue Summary
This was discovered by Niklas Fiekas (please credit him on commit) while working on #1463656: Add a Drupal kernel; leverage HttpFoundation and HttpKernel, but is unrelated to that issue, so is being split out here.
This can be replicated locally by accessing a Drupal installation with a dirty URL ("/index.php" appended in the address bar after the base url), and from there running the XML-RPC tests. Doing so currently results in test failures with HEAD. Testbot is not catching this, because it runs tests with clean URLs.
The problem is code like this:
$url = url(NULL, array('absolute' => TRUE)) . 'core/xmlrpc.php';This makes no sense. url() is used for generating URLs to Drupal paths or external URLs. It is not meant for generating a URL to a file. For that, $base_url must be used instead.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| drupal-xmlrpc-url.patch | 2.8 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 36,619 pass(es). | View details | Re-test |
Comments
#1
RTBC'ing cause it's not my patch :)
#2
This issue with paths to actual files was already discussed long ago, and the ability to use url() for files in cases like this was won't fixed at the time, so maybe we should check when it was reintroduced: the same may have been done elsewhere.
#3
Ah crap I'm still waking up this morning and forgot to credit Niklas Fiekas on commit, I'll try to make another mistake with another commit to correct this..
This is in 7.x too so needs a backport.
#4
If you haven't pushed yet you can always commit --amend to fix it. :-)
#5
Nah I already pushed it before even starting to type the comment :(
#6
Needed to be rerolled manually since every new line referred to '/core/xmlrpc.php'.
I grepped around for other instances to change, didn't see any.