I'm attaching some cropped screenshots for these.

Tested these on one of my sites (bryrock.raindearmedia.com), using the 127.1.20.1 and 127.1.80.1 tests.

In the first two examples (greylist_parse and blacklist_parse), the IP is missing from the message, and the first link, reading "IP_data," resolves to nonsense: http://bryrock.raindearmedia.com/%5C%22http://bryrock.raindearmedia.comhttpbl/%5C%22%3Ca

Clicking the link for the whitelisting test (second link in the greylist_parse example) resolves as shown in the safari and firefox examples.

When I manually jiggered with the url in my browser, in order to see the whitelisting test, the test appeared to work. I followed directions once, in order to be whitelisted (and was whitelisted), and disobeyed once, to get myself blacklisted (and was blacklisted).

Comments

bryrock’s picture

I was able to get url for the whitelisting test to work by tweaking two lines and not escaping the double quotes in the url.

I replaced line 91 ...

$message = 'Sorry, %ip has been greylisted by <a href=\"%ipurl\">http:BL</a>.<br>You may try whitelisting on <a href=\"%whitelisturl\">%whitelisturl</a>.%honeypot';

...with...

$message = 'Sorry, %ip has been greylisted by <a href="%ipurl">http:BL</a>.<br>You may try whitelisting on <a href="%whitelisturl">%whitelisturl</a>.%honeypot';

Though I also removed the escaping backslashes from the double quotes in "%ipurl", that one still has me baffled.

Also, I added a slash in line 102: changing _httpbl_url('httpbl/whitelist') to _httpbl_url('/httpbl/whitelist')

Doing this resulted in a clean link to the whitelist test, from my base url.

bryrock’s picture

More info in reference to the parsing error in the first line shown in each of the two images above ( http://drupal.org/files/issues/greylist_parse.jpg & http://drupal.org/files/issues/greylist_parse.jpg)...

I'm still unable to see what the exact problem is, but I recognize that what's being attempted is the same sort of "IP Data" link that is created for the logs, where there is a link to honeypot info on the blocked IP, and because I'm logging these things I can see that "IP Data" link works great in the logs, so I don't get what's breaking down with the onscreen message version.

bryrock’s picture

StatusFileSize
new20.31 KB
new21.68 KB

Related to the results of the parsing issue, the notice to a grey or blacklisted user contains no valid IP address, as shown in the attached images. Image 1 shows no IP in "Sorry, [blank] has been greylisted." Image 2 shows the resulting url to Honeypot in the "http:BL" hyperlink.

For reasons I can't explain, by the time we get to this point in the code...

$message = strtr($message, array('%ip' => $ip, '%ipurl' => _httpbl_ipdata($ip, ip_address()), '%honeypot' => $link, '%whitelisturl' => _httpbl_url('/httpbl/whitelist')));

... $ip no longer has any value.

I don't know if this could possibly be a consequence of having to change code for testing purposes (per comment #1 of #575884: Testing Suggestions (asking for)) or not.

I've been able to solve this problem by changing the line to...
$message = strtr($message, array('%ip' => ip_address(), '%ipurl' => _httpbl_ipdata(ip_address(), FALSE), '%honeypot' => $link, '%whitelisturl' => _httpbl_url('/httpbl/whitelist')));

That will provide the true IP for both the "Sorry..." message and the "http:BL" hyperlink.

This is still a bit quirky to test, though, because you still need to change some code to spoof a grey or blacklisted IP, but then the IP show in the message and hyperlink will be the actual IP of the tester.

bryrock’s picture

StatusFileSize
new1.21 KB

Ok. Bear with me, please, as I am trying to learn how to play by the rules.

Here is my first patch. It addresses these parsing errors. Specifically, it corrects the visible links and resolved URLs that are in the messages to a grey and/or blacklisted visitor.

praseodym’s picture

Status: Active » Fixed

Thanks, committed!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.