[Fusionforge-commits] r7217 - trunk/gforge/common/include

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Sat Mar 21 12:37:09 CET 2009


Author: aljeux
Date: 2009-03-21 12:37:09 +0100 (Sat, 21 Mar 2009)
New Revision: 7217

Modified:
   trunk/gforge/common/include/forms.php
Log:
Fail back mode if key is empty

Modified: trunk/gforge/common/include/forms.php
===================================================================
--- trunk/gforge/common/include/forms.php	2009-03-20 22:56:39 UTC (rev 7216)
+++ trunk/gforge/common/include/forms.php	2009-03-21 11:37:09 UTC (rev 7217)
@@ -71,6 +71,12 @@
 function form_key_is_valid($key) {
 	global $sys_database_type;
 
+	// Fail back mode if key is empty. This can happen when there is
+	// a problem with the generation. In this case, it may be better
+	// to disable this check instead of blocking all the application.
+	if (empty($key))
+		return true;
+
 	db_begin();
 	if ( $sys_database_type == "mysql" ) {
 		$sql = "SELECT * FROM form_keys WHERE `key`='$key' and is_used=0 FOR UPDATE";
@@ -97,7 +103,7 @@
 }
 
 /**
- *  form_release_key() - Releases the given key if it is already used. If the given key it�s not in the db, it returns false.
+ *  form_release_key() - Releases the given key if it is already used. If the given key it´s not in the db, it returns false.
  *
  *	@param	int	The key.			
  *  @return	boolean	True if the given key is successfully released. False if not. 




More information about the Fusionforge-commits mailing list