Getting these 2 errors when running cron job ...

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND w.bcast >=' at line 1 query: SELECT COUNT(w.net) FROM troll_whitelist w WHERE w.net <= AND w.bcast >= in /home/dontsail/www/www/includes/database.mysql.inc on line 172.

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND b.bcast >=' at line 1 query: SELECT COUNT(b.net) FROM troll_blacklist b WHERE b.net <= AND b.bcast >= in /home/dontsail/www/www/includes/database.mysql.inc on line 172.

AFAIK, the white lists and blacklist should be empty, FYI. Running on Drupal 5.3. MySQL 5.0.45, PHP 5.2.4

CommentFileSizeAuthor
#1 troll.module.189566.patch1.11 KBjaydub

Comments

jaydub’s picture

Status: Active » Needs review
StatusFileSize
new1.11 KB

This would appear to occur in cases where PHP has no value for $_SERVER['REMOTE_ADDR'].

The included patch will test to return value from the ip2long function call as that will return FALSE
or -1 (in prior php versions) if the IP address is not valid.

If not valid then we should skip the database lookups in the whitelist and blacklist as the
invalid IP will break the SQL.

jaydub’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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