I'm not sure if its a php bug or a feature, but with the php version I'm using, crypt -function returns an empty string if salt parameter is not specified. (http://php.net/manual/en/function.crypt.php). This creates an infinite loop when submitting an ecard.. The following hack fixed the problem:

diff --git a/ecard/ecard.module b/ecard/ecard.module
index 0728644..0ceccc9 100644
--- a/ecard/ecard.module
+++ b/ecard/ecard.module
@@ -309,7 +309,7 @@ function ecard_form_submit($form_id, $form_values) {
unset($random);
//makding a random variable
while (!$random) {
- $random = strtr(crypt(microtime()), '/\|$^&.,;?+=!@#$%^&*()', '_-_-_-_-_-_-_-_-_-_-_-');
+ $random = strtr(crypt(microtime(),"saltstring"), '/\|$^&.,;?+=!@#$%^&*()', '_-_-_-_-_-_-_-_-_-_-_-');
$result = db_fetch_object(db_query("SELECT random FROM {ecard} WHERE random = '%s'", $random));
if ($result) unset($random);
}

The php version I'm using:

php5 -v
PHP Warning: Xdebug MUST be loaded as a Zend extension in Unknown on line 0
PHP 5.2.5-0.dotdeb.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Dec 10 2007 08:44:45)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Suhosin v0.9.22, Copyright (c) 2007, by SektionEins GmbH

Comments

mssarath’s picture

i didn't face it yet. anyway i didn't like that loop, i will change it to md5 instead i feel its better. will do it on next release

mssarath’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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