I am experiencing a strange problem in one of my contributed modules. I have defined a callback using
$myaccess = user_access(...);
$items[] = array(
'path' => 'mymodule/autocomplete',
'callback' => 'mymodule_autocomplete',
'access' => $myaccess,
'type' => MENU_CALLBACK
);
Everything works fine, except when I try to access the callback path with clean urls enabled (e.g. http://localhost/drupal5/mymodule/autocomplete) I am receiving an error 403 (access denied) message. However trying to access the callback using a non-clean url (e.g. http://localhost/drupal5/?q=mymodule/autocomplete) works perfectly. Regardless url rewrite is enabled or not non-clean urls work nicely as callback path, but I cant get this to work using a clean url (with rewrite enabled of course).
What I dont understand is that accessing e.g. user/autcomplete works in all cases.
The above code snippet is in if ($may_cache) { ... snippet ... }
, but I also tried with !$may_cache
.
Any ideas?
Comment | File | Size | Author |
---|---|---|---|
#10 | htaccess_d5.patch | 512 bytes | thePanz |
#8 | htaccess_14_0.patch | 691 bytes | profix898 |
#4 | htaccess_13.patch | 680 bytes | Takafumi |
Comments
Comment #1
greenmother CreditAttribution: greenmother commentedYour "reptag" module conflict with row 6 in .htaccess and this have place only in Windows. I have a vague idea why is it so, but if remove |Tag| from this - all works right
Comment #2
greenmother CreditAttribution: greenmother commentedoops, i accidentally change title, sorry
Comment #3
profix898 CreditAttribution: profix898 commentedI played a bit with .htaccess on my windows dev box and GreenMother is completely right. Nice catch :) The problem exists with all modules where the module name partially matches the FilesMatch list. What means e.g. template_module, anytag etc. doesnt work either.
Not sure how this can be fixed, but I'm making this a bug report to call developers attention to it.
Comment #4
Takafumi CreditAttribution: Takafumi commentedThis patch fix it. Please apply a patch and fix this issue.
Comment #5
ChrisKennedy CreditAttribution: ChrisKennedy commentedIs the FilesMatch string the full path or just the last part? I'm thinking that it's probably the full path, in which case your addition of ^ will prevent the second half of matches from ever being caught. Or am I wrong?
Comment #6
Takafumi CreditAttribution: Takafumi commentedIt works correctly. Please confirm it.
Comment #7
profix898 CreditAttribution: profix898 commentedIts still a problem in both 5.x and HEAD. Lets fix it at least for Drupal 6 (and maybe backport to 5.x afterwards)! The patch still applies and solves the problem. RTBC.
Comment #8
profix898 CreditAttribution: profix898 commentedRerolled for latest HEAD. '.schema' was added to the list of protected files.
Comment #9
Gábor HojtsyThanks, committed!
Comment #10
thePanz CreditAttribution: thePanz commentedI made a patch against .htacces of Drupal 5.2.. it works, but maybe need some review!
Bye
-thePanz-
Comment #11
drummCommitted to 5.x.
Comment #12
(not verified) CreditAttribution: commented