Closed (fixed)
Project:
Mollom
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Aug 2012 at 19:47 UTC
Updated:
24 Apr 2014 at 17:13 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
sunHm. This interaction is constantly tested actually. And I even took the time to test the full interaction once more manually for this issue now, but I'm not able to reproduce the issue.
Since you're saying that you're moderating the content from the moderation system, this means that your site is actually able to send content to it. There just seems to be some glitch in the other direction.
Perhaps that was a temporary thing? Can you test again?
Comment #2
nwehner commentedI just tried it again (after performing the Mollom update) to moderate ham comments and got a ton of errors...see this screen capture. Everything with Mollom seems to work fine as long as I don't use Mollom's moderation system.
Comment #3
nwehner commentedThis morning I uninstalled Mollom and re-installed the 7.2 module. I waited until I got a few spam posts and moderated them from the Mollom moderation system. I still got the same errors as before: missing protocol parameters and access denied. The comments were not removed from the site. After turning off redirection to Mollom's moderation pages, the spam comments were still there. I was able to successfully delete them and I reported as spam to Mollom the standard way.
Comment #4
dixon_I'm having the same problem on a Drupal 6 site.
I think the problem originates in
MollomDrupal::getServerAuthentication()where there's a check for the functionapache_request_headers(). This function only exists when PHP is installed as an Apache module, which is not always the case.In my case we're running our site on Acquia Cloud which seems to have PHP set up in FastCGI mode.
However, there's an alternative check made in
MollomDrupal::getServerAuthentication()for HTTP Basic Auth, but requests from the Mollom Content Moderation Platform doesn't seem to include the necessary headers for that.Comment #5
sunI investigated the situation and indeed, when PHP runs as CGI, the HTTP request headers are not made available in the usual variables.
I'm relatively confident that attached patch will fix the problem.
Comment #6
sun@dixon_, can you confirm that this patch fixes this issue in your environment?
Comment #7
sunStudying this further:
getallheaders()function not only when running as Apache module, but also for FastCGI.$_ENVdoes not always contain the HTTP header variables. Specifics on when exactly they're made available are hard to find..htaccess:Alternatively the following, although it appears unnecessarily complex to me:
These rewrite rules essentially copy
$_ENV['HTTP_AUTHORIZATION']into$_SERVER['HTTP_AUTHORIZATION'].Attached patch slightly revises #5 to take the PHP 5.4 improvement into account.
Comment #8
dixon_I think this statement is a bit missleading. I think what it actually does is creating (or "updating") the environment variable called
HTTP_AUTHORIZATIONwith the value from the HTTP headerAuthorization. Why is this useful? Because in certain situations (like before PHP < 5.4) it's difficult to fetch theAuthorizationheader consistently. It's more common/easier to access$_SERVER['HTTP_AUTHORIZATION']I guess.So, the patch itself didn't make any difference for me, in my case at least. But the problem was solved after applying the
.htaccessrule you provided. Only then the headers became available in$_SERVER['HTTP_AUTHORIZATION']and things started to work:In any case, I think the patch might be useful, so attached is a D6 version of it.
Moving forward we should probably add a note about the
.htaccessrule inREADME.txtas well as asking hosting companies as Acquia to document this properly for their platforms that run PHP as CGI.Comment #9
sunThanks for reporting, reviewing, and testing! Committed to all branches.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Additionally committed notes and instructions to both the README of the Mollom class/library as well as the README.txt of the module.
I'll also try to get in touch with Acquia Ops to ensure that this is part of their default PHP/CGI server configuration when applicable.
Comment #10
dixon_@sun Awesome! Thanks for quick response and commit!
Comment #11.0
(not verified) commentedFixed formatting