Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
system.module
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
8 May 2008 at 12:11 UTC
Updated:
24 May 2008 at 09:23 UTC
Jump to comment: Most recent file
This patch adds validation to prevent users blocking their own IP addresses from admin/settings/ip-blocking (which'd result in immediate locking out from the site via drupal_is_denied()).
To get into good habits I've added a test for this and related stuff in system.module that wasn't explicitly covered by the integration tests that just got committed to statistics.module.
Ironically the only test that fails is the one for the new validation against ip_address(). I've tested it manually, and it works on my machine - so assuming it's something to do with the internal browser and $_SERVER['REMOTE_ADDR']. Not sure what to do in this case, so uploading for review anyway.
Comments
Comment #1
catchWas cut and pasting IP addresses around and it's confusing if you get a validation error with trailing whitespace, so added a trim().
Comment #2
catchThat patch had a bad string in the test. I've just tried this on a different machine and got 36 passes, 0 fails. Wondering if it might be a curl version issue or something? Debian Etch apparently runs libcurl3 (>= 7.15.5-1) (fails) Ubuntu gutsy runs libcurl3 (>= 7.16.2-1)
Comment #3
dries commentedI reviewed the patch and it looks good.
I tested the patch and that one test is failing as well. I'm running MAMP on OSX.
Nevertheless, I committed this patch. More tests are better, and the fact that a test fails will remind us to fix it. Thanks for the tests catch.
Comment #4
dries commentedThis is exactly why testing is good. It helps us to make progress faster while maintaining quality.
Comment #5
catchI've split the ip_address() inconsistency over to http://drupal.org/node/256886 - since there's other places that'll need to be tested eventually. Going to mark this one to fixed, thanks!
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.