aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/db/driver
diff options
context:
space:
mode:
authorDerky <derky@phpbb.com>2018-01-04 21:20:46 +0100
committerDerky <derky@phpbb.com>2018-01-04 21:20:46 +0100
commit2fcb8ab87fb30c57b106695859c2661fc3cc2837 (patch)
tree4e2a1437ff2cc9b3ca742716047660bf0367c824 /phpBB/phpbb/db/driver
parent0ff5f9fa0edf9ac3125cc4e871609a90cee1cfac (diff)
parentc1ec6517bfe0f080ad052e727073794583464bfb (diff)
downloadforums-2fcb8ab87fb30c57b106695859c2661fc3cc2837.tar
forums-2fcb8ab87fb30c57b106695859c2661fc3cc2837.tar.gz
forums-2fcb8ab87fb30c57b106695859c2661fc3cc2837.tar.bz2
forums-2fcb8ab87fb30c57b106695859c2661fc3cc2837.tar.xz
forums-2fcb8ab87fb30c57b106695859c2661fc3cc2837.zip
Merge pull request #5069 from marc1706/ticket/14972-rhea
[ticket/14972] Backport for PHP 7.2 compatibility
Diffstat (limited to 'phpBB/phpbb/db/driver')
-rw-r--r--phpBB/phpbb/db/driver/driver.php19
-rw-r--r--phpBB/phpbb/db/driver/mssqlnative.php2
-rw-r--r--phpBB/phpbb/db/driver/oracle.php6
3 files changed, 12 insertions, 15 deletions
diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php
index 214c5590e7..5851469806 100644
--- a/phpBB/phpbb/db/driver/driver.php
+++ b/phpBB/phpbb/db/driver/driver.php
@@ -537,7 +537,9 @@ abstract class driver implements driver_interface
*/
function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
{
- if (!sizeof($array))
+ $array = (array) $array;
+
+ if (!count($array))
{
if (!$allow_empty_set)
{
@@ -559,12 +561,7 @@ abstract class driver implements driver_interface
}
}
- if (!is_array($array))
- {
- $array = array($array);
- }
-
- if (sizeof($array) == 1)
+ if (count($array) == 1)
{
@reset($array);
$var = current($array);
@@ -632,7 +629,7 @@ abstract class driver implements driver_interface
*/
function sql_multi_insert($table, $sql_ary)
{
- if (!sizeof($sql_ary))
+ if (!count($sql_ary))
{
return false;
}
@@ -738,7 +735,7 @@ abstract class driver implements driver_interface
// We run the following code to determine if we need to re-order the table array. ;)
// The reason for this is that for multi-aliased tables (two equal tables) in the FROM statement the last table need to match the first comparison.
// DBMS who rely on this: Oracle, PostgreSQL and MSSQL. For all other DBMS it makes absolutely no difference in which order the table is.
- if (!empty($array['LEFT_JOIN']) && sizeof($array['FROM']) > 1 && $used_multi_alias !== false)
+ if (!empty($array['LEFT_JOIN']) && count($array['FROM']) > 1 && $used_multi_alias !== false)
{
// Take first LEFT JOIN
$join = current($array['LEFT_JOIN']);
@@ -848,7 +845,7 @@ abstract class driver implements driver_interface
default:
- switch (sizeof($condition))
+ switch (count($condition))
{
case 3:
@@ -1138,7 +1135,7 @@ abstract class driver implements driver_interface
$html_table = func_get_arg(2);
$row = func_get_arg(3);
- if (!$html_table && sizeof($row))
+ if (!$html_table && count($row))
{
$html_table = true;
$this->html_hold .= '<table cellspacing="1"><tr>';
diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php
index 50dce35baa..2859945915 100644
--- a/phpBB/phpbb/db/driver/mssqlnative.php
+++ b/phpBB/phpbb/db/driver/mssqlnative.php
@@ -267,7 +267,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
unset($row['line2'], $row['line3']);
}
}
- return (sizeof($row)) ? $row : false;
+ return (count($row)) ? $row : false;
}
/**
diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php
index 54238a15ef..5fd14709f8 100644
--- a/phpBB/phpbb/db/driver/oracle.php
+++ b/phpBB/phpbb/db/driver/oracle.php
@@ -136,7 +136,7 @@ class oracle extends \phpbb\db\driver\driver
*/
function _rewrite_col_compare($args)
{
- if (sizeof($args) == 4)
+ if (count($args) == 4)
{
if ($args[2] == '=')
{
@@ -290,7 +290,7 @@ class oracle extends \phpbb\db\driver\driver
and/or need the db restore script, uncomment this.
- if (sizeof($cols) !== sizeof($vals))
+ if (count($cols) !== count($vals))
{
// Try to replace some common data we know is from our restore script or from other sources
$regs[3] = str_replace("'||chr(47)||'", '/', $regs[3]);
@@ -332,7 +332,7 @@ class oracle extends \phpbb\db\driver\driver
if ($string)
{
// New value if cols != value
- $vals[(sizeof($cols) !== sizeof($vals)) ? $i : $i - 1] .= $string;
+ $vals[(count($cols) !== count($vals)) ? $i : $i - 1] .= $string;
}
$vals = array(0 => $vals);