mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
Removed bad e_LEGACY_MODE implementation
e_LEGACY_MODE caused the query results from e_db_pdo and e_db_mysql to return different styles (MYSQL_BOTH and MYSQL_ASSOC, respectively). To resolve this inconsistency, e_LEGACY_MODE has been removed from the e107 core.
This commit is contained in:
@@ -38,11 +38,6 @@
|
|||||||
|
|
||||||
public function db_Fetch($type = null)
|
public function db_Fetch($type = null)
|
||||||
{
|
{
|
||||||
if (defined('e_LEGACY_MODE') && !is_int($type))
|
|
||||||
{
|
|
||||||
return $this->fetch('both');
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->fetch($type);
|
return $this->fetch($type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -405,7 +405,7 @@
|
|||||||
unset($actual[$unimportant_key]);
|
unset($actual[$unimportant_key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter out cruft from e_LEGACY_MODE database output
|
// Filter out cruft from MYSQL_BOTH database output
|
||||||
foreach ($actual as $key => $value)
|
foreach ($actual as $key => $value)
|
||||||
{
|
{
|
||||||
if (is_int($key)) unset($actual[$key]);
|
if (is_int($key)) unset($actual[$key]);
|
||||||
|
@@ -651,7 +651,8 @@ abstract class e_db_abstractTest extends \Codeception\Test\Unit
|
|||||||
$this->db->select('user', '*', 'user_id = 1');
|
$this->db->select('user', '*', 'user_id = 1');
|
||||||
$row = $this->db->db_Fetch();
|
$row = $this->db->db_Fetch();
|
||||||
$this->assertEquals("e107", $row['user_name']);
|
$this->assertEquals("e107", $row['user_name']);
|
||||||
$this->assertEquals("e107", $row[1]);
|
$this->assertNull($row[0]);
|
||||||
|
$this->assertNull($row[1]);
|
||||||
|
|
||||||
// legacy tests
|
// legacy tests
|
||||||
$this->db->select('user', '*', 'user_id = 1');
|
$this->db->select('user', '*', 'user_id = 1');
|
||||||
|
@@ -30,7 +30,6 @@ class e_db_pdoTest extends e_db_abstractTest
|
|||||||
$this->fail("Couldn't load e_db_pdo object");
|
$this->fail("Couldn't load e_db_pdo object");
|
||||||
}
|
}
|
||||||
|
|
||||||
define('e_LEGACY_MODE', true);
|
|
||||||
$this->db->__construct();
|
$this->db->__construct();
|
||||||
$this->loadConfig();
|
$this->loadConfig();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user