Index: trunk/lib/Auth_SQL.inc.php
===================================================================
--- trunk/lib/Auth_SQL.inc.php	(revision 219)
+++ trunk/lib/Auth_SQL.inc.php	(revision 224)
@@ -529,5 +529,5 @@
 
         // Test login with information stored in session. Skip IP matching for users from trusted networks.
-        if (isset($_SESSION['_auth_sql'][$this->_ns])
+        if (isset($_SESSION['_auth_sql'][$this->_ns]['authenticated']) 
             && true === $_SESSION['_auth_sql'][$this->_ns]['authenticated']
             && !empty($_SESSION['_auth_sql'][$this->_ns]['username'])
@@ -552,5 +552,5 @@
                 $app->logMsg(sprintf('User update failed. Record not found for user %s (%s).', $this->get('user_id'), $this->get('username')), LOG_NOTICE, __FILE__, __LINE__);
             }
-        } else if (isset($_SESSION['_auth_sql'][$this->_ns]) && true === $_SESSION['_auth_sql'][$this->_ns]['authenticated']) {
+        } else if (isset($_SESSION['_auth_sql'][$this->_ns]['authenticated']) && true === $_SESSION['_auth_sql'][$this->_ns]['authenticated']) {
             // User is authenticated, but login has expired.
             if (strtotime($_SESSION['_auth_sql'][$this->_ns]['last_access_datetime']) > time() - 43200) {
Index: trunk/lib/ImageThumb.inc.php
===================================================================
--- trunk/lib/ImageThumb.inc.php	(revision 219)
+++ trunk/lib/ImageThumb.inc.php	(revision 224)
@@ -521,15 +521,27 @@
         // Create source image data in memory.
         switch ($source_image_type) {
-        case IMAGETYPE_JPEG :
+        case IMAGETYPE_JPEG : // = 2
             $source_image_resource = imagecreatefromjpeg($source_file);
             break;
-        case IMAGETYPE_PNG :
+        case IMAGETYPE_PNG : // = 3
             $source_image_resource = imagecreatefrompng($source_file);
             break;
-        case IMAGETYPE_GIF :
+        case IMAGETYPE_GIF : // = 1
             $source_image_resource = imagecreatefromgif($source_file);
             break;
-        case IMAGETYPE_WBMP :
+        case IMAGETYPE_WBMP : // = 15
             $source_image_resource = imagecreatefromwbmp($source_file);
+        case IMAGETYPE_SWF : // = 4
+        case IMAGETYPE_PSD : // = 5
+        case IMAGETYPE_BMP : // = 6
+        case IMAGETYPE_TIFF_II : // = 7
+        case IMAGETYPE_TIFF_MM : // = 8
+        case IMAGETYPE_JPC : // = 9
+        case IMAGETYPE_JP2 : // = 10
+        case IMAGETYPE_JPX : // = 11
+        case IMAGETYPE_JB2 : // = 12
+        case IMAGETYPE_SWC : // = 13
+        case IMAGETYPE_IFF : // = 14
+        case IMAGETYPE_XBM : // = 16
         default :
             $app->logMsg(sprintf('Source image type %s not supported.', $source_image_type), LOG_WARNING, __FILE__, __LINE__);
Index: trunk/lib/Utilities.inc.php
===================================================================
--- trunk/lib/Utilities.inc.php	(revision 219)
+++ trunk/lib/Utilities.inc.php	(revision 224)
@@ -524,10 +524,10 @@
  * @return string         Comma list of array values.
  */
-function escapedList($in)
+function escapedList($in, $separator="', '")
 {
 	$db =& DB::getInstance();
 	
     if (is_array($in) && !empty($in)) {
-        return "'" . join("', '", array_map(array($db, 'escapeString'), $in)) . "'";
+        return join($separator, array_map(array($db, 'escapeString'), $in));
     } else {
         return $db->escapeString($in);
@@ -549,5 +549,13 @@
     // Translate the human string date into SQL-safe date format.
     if (empty($date) || strpos($date, '0000-00-00') !== false || strtotime($date) === -1 || strtotime($date) === false) {
-        return '0000-00-00';
+        // Return a string of zero time, formatted the same as $format.
+        return strtr($format, array(
+            'Y' => '0000',
+            'm' => '00',
+            'd' => '00',
+            'H' => '00',
+            'i' => '00',
+            's' => '00',
+        ));
     } else {
         return date($format, strtotime($date));
