Drupal now implodes on false_account

madjoe - March 31, 2009 - 18:43
Project:False Account Detector
Version:5.x-2.4
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:needs review
Description

* implode() [function.implode]: Invalid arguments passed in /home/public_html/sites/all/modules/false_account/false_account.module on line 249.

*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 '' at line 1 query: SELECT COUNT(*) FROM false_accounts WHERE in /home/public_html/includes/database.mysql.inc on line 180.

Also no mails seem to be send anymore to users!!! Even after uninstalling the module... any clues?

#1

madjoe - March 31, 2009 - 19:22

I think I know the reason for the first error:

<?php
   
while ($res_cid = db_fetch_object($res)) {
     
$ors[] = 'cid = "'. $res_cid->cid .'"';
    }
   
$or = implode(' OR ', $ors);
?>

You don't check if $ors is an empty variable (array)...

An email issue is probably not related to this module (but it just happened when I've enabled this module, so I'm not sure). Email contacts, notifications, etc. are being logged by Drupal, but my users don't receive any of those emails anymore, not even within their spam boxes... so I'm confused. I'll still have to check if the domain ended up on some of those blacklists, or something.

#2

a.bond - August 14, 2009 - 16:03

I'm getting the same error. Are there any plans for fixing this?

In my error, I got "Invalid arguments passed" in false_account.module on line 306. My SQL syntax error (same query as above) was triggered on line 314.

Incidentally, this error seems to kill the functionality of the module, as I've had one person make two accounts on my site.

#3

jmpoure - September 23, 2009 - 06:35

By the way, MySQLism: avoid using double quotes for alphanumerical values. So we should write:
$ors[] = "cid = '". $res_cid->cid ."'"</a>
Otherwise the code will not work under SQL99 databases.

#4

jmpoure - September 23, 2009 - 18:02

This bug is a duplicate from http://drupal.org/node/398252 which offers a patch.
MySQL is probably configured in ANSI mode, so it complains.

Could you apply my patch, please?

#5

jmpoure - September 23, 2009 - 18:06
Status:active» needs review
 
 

Drupal is a registered trademark of Dries Buytaert.