diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-05 02:52:43 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-01-05 02:52:43 +0000 |
commit | 63cb7ba1036798742a150cca1cb2f5eccb5a865d (patch) | |
tree | 1229c101287800ac8cc18f34cb949e5a66111803 /modules/system/system.module | |
parent | 6808ba7c918e2236fd78c01ee4411a58126fc8de (diff) | |
download | brdo-63cb7ba1036798742a150cca1cb2f5eccb5a865d.tar.gz brdo-63cb7ba1036798742a150cca1cb2f5eccb5a865d.tar.bz2 |
#352956 by Damien Tournoud, Josh Waihi, drewish: Fix PDOException on install on some versions of PHP.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 575af94b1..f71ccd75c 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -1513,7 +1513,9 @@ function system_cron() { db_query('DELETE FROM {batch} WHERE timestamp < %d', REQUEST_TIME - 864000); // Remove temporary files that are older than DRUPAL_MAXIMUM_TEMP_FILE_AGE. - $result = db_query('SELECT fid FROM {files} WHERE status & :permanent != :permanent AND timestamp < :timestamp', array(':permanent' => FILE_STATUS_PERMANENT, ':timestamp' => REQUEST_TIME - DRUPAL_MAXIMUM_TEMP_FILE_AGE)); + // Use separate placeholders for the status to avoid a bug in some versions + // of PHP. @see http://drupal.org/node/352956 + $result = db_query('SELECT fid FROM {files} WHERE status & :permanent1 != :permanent2 AND timestamp < :timestamp', array(':permanent1' => FILE_STATUS_PERMANENT, ':permanent2' => FILE_STATUS_PERMANENT, ':timestamp' => REQUEST_TIME - DRUPAL_MAXIMUM_TEMP_FILE_AGE)); foreach ($result as $row) { if ($file = file_load($row->fid)) { if (!file_delete($file)) { |