aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r--phpBB/includes/functions.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 398a02380b..585e23b2ee 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -175,10 +175,14 @@ function set_config_count($config_name, $increment, $is_dynamic = false)
switch ($db->sql_layer)
{
case 'firebird':
- case 'postgres':
$sql_update = 'CAST(CAST(config_value as DECIMAL(255, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
break;
+ case 'postgres':
+ // Need to cast to text first for PostgreSQL 7.x
+ $sql_update = 'CAST(CAST(config_value::text as DECIMAL(255, 0)) + ' . (int) $increment . ' as VARCHAR(255))';
+ break;
+
// MySQL, SQlite, mssql, mssql_odbc, oracle
default:
$sql_update = 'config_value + ' . (int) $increment;
@@ -236,8 +240,8 @@ function unique_id($extra = 'c')
if ($dss_seeded !== true && ($config['rand_seed_last_update'] < time() - rand(1,10)))
{
- set_config('rand_seed', $config['rand_seed'], true);
set_config('rand_seed_last_update', time(), true);
+ set_config('rand_seed', $config['rand_seed'], true);
$dss_seeded = true;
}
@@ -512,7 +516,7 @@ function _hash_crypt_private($password, $setting, &$itoa64)
$output = '*';
// Check for correct hash
- if (substr($setting, 0, 3) != '$H$')
+ if (substr($setting, 0, 3) != '$H$' && substr($setting, 0, 3) != '$P$')
{
return $output;
}
@@ -4257,7 +4261,7 @@ function phpbb_http_login($param)
if (!is_null($username) && is_null($password) && strpos($username, 'Basic ') === 0)
{
list($username, $password) = explode(':', base64_decode(substr($username, 6)), 2);
- }
+ }
if (!is_null($username) && !is_null($password))
{
@@ -4607,7 +4611,7 @@ function page_footer($run_cron = true)
// Call cron-type script
$call_cron = false;
- if (!defined('IN_CRON') && $run_cron && !$config['board_disable'])
+ if (!defined('IN_CRON') && $run_cron && !$config['board_disable'] && !$user->data['is_bot'])
{
$call_cron = true;
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();