mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-22 16:22:58 +02:00
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12317] Cast string to int to refix DBMSes not using int for integers. [ticket/12317] Fix notification tests for DBMSes returning integers as int. [ticket/12317] Do not repeat SQL query in notification_submit_post_base. [ticket/12314] Workaround HHVM SPL autoloader sometimes using leading backslash
This commit is contained in:
@@ -141,8 +141,14 @@ class class_loader
|
|||||||
* @param string $class The class name which is being loaded.
|
* @param string $class The class name which is being loaded.
|
||||||
*/
|
*/
|
||||||
public function load_class($class)
|
public function load_class($class)
|
||||||
|
{
|
||||||
|
// In general $class is not supposed to contain a leading backslash,
|
||||||
|
// but sometimes it does. See tickets PHP-50731 and HHVM-1840.
|
||||||
|
if ($class[0] !== '\\')
|
||||||
{
|
{
|
||||||
$class = '\\' . $class;
|
$class = '\\' . $class;
|
||||||
|
}
|
||||||
|
|
||||||
if (substr($class, 0, strlen($this->namespace)) === $this->namespace)
|
if (substr($class, 0, strlen($this->namespace)) === $this->namespace)
|
||||||
{
|
{
|
||||||
$path = $this->resolve_path($class);
|
$path = $this->resolve_path($class);
|
||||||
|
@@ -75,7 +75,7 @@ class bookmark extends \phpbb\notification\type\post
|
|||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$users[] = $row['user_id'];
|
$users[] = (int) $row['user_id'];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@@ -103,7 +103,7 @@ class post extends \phpbb\notification\type\base
|
|||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$users[] = $row['user_id'];
|
$users[] = (int) $row['user_id'];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ class post extends \phpbb\notification\type\base
|
|||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$users[] = $row['user_id'];
|
$users[] = (int) $row['user_id'];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@@ -94,7 +94,7 @@ class quote extends \phpbb\notification\type\post
|
|||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$users[] = $row['user_id'];
|
$users[] = (int) $row['user_id'];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@@ -103,7 +103,7 @@ class topic extends \phpbb\notification\type\base
|
|||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
while ($row = $this->db->sql_fetchrow($result))
|
while ($row = $this->db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$users[] = $row['user_id'];
|
$users[] = (int) $row['user_id'];
|
||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@@ -133,7 +133,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
|
|||||||
FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt
|
FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt
|
||||||
WHERE nt.notification_type_name = '" . $this->item_type . "'
|
WHERE nt.notification_type_name = '" . $this->item_type . "'
|
||||||
AND n.notification_type_id = nt.notification_type_id
|
AND n.notification_type_id = nt.notification_type_id
|
||||||
ORDER BY user_id, item_id ASC";
|
ORDER BY user_id ASC, item_id ASC";
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$this->assertEquals($expected_before, $this->db->sql_fetchrowset($result));
|
$this->assertEquals($expected_before, $this->db->sql_fetchrowset($result));
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
@@ -142,11 +142,6 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
|
|||||||
$post_data = array_merge($this->post_data, $additional_post_data);
|
$post_data = array_merge($this->post_data, $additional_post_data);
|
||||||
submit_post('reply', '', 'poster-name', POST_NORMAL, $poll_data, $post_data, false, false);
|
submit_post('reply', '', 'poster-name', POST_NORMAL, $poll_data, $post_data, false, false);
|
||||||
|
|
||||||
$sql = 'SELECT user_id, item_id, item_parent_id
|
|
||||||
FROM ' . NOTIFICATIONS_TABLE . ' n, ' . NOTIFICATION_TYPES_TABLE . " nt
|
|
||||||
WHERE nt.notification_type_name = '" . $this->item_type . "'
|
|
||||||
AND n.notification_type_id = nt.notification_type_id
|
|
||||||
ORDER BY user_id ASC, item_id ASC";
|
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$this->assertEquals($expected_after, $this->db->sql_fetchrowset($result));
|
$this->assertEquals($expected_after, $this->db->sql_fetchrowset($result));
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
@@ -27,7 +27,7 @@ class phpbb_notification_submit_post_type_bookmark_test extends phpbb_notificati
|
|||||||
$this->greaterThan(0))
|
$this->greaterThan(0))
|
||||||
->will($this->returnValueMap(array(
|
->will($this->returnValueMap(array(
|
||||||
array(
|
array(
|
||||||
array('3', '4', '5', '6', '7'),
|
array(3, 4, 5, 6, 7),
|
||||||
'f_read',
|
'f_read',
|
||||||
1,
|
1,
|
||||||
array(
|
array(
|
||||||
|
@@ -27,7 +27,7 @@ class phpbb_notification_submit_post_type_post_test extends phpbb_notification_s
|
|||||||
$this->greaterThan(0))
|
$this->greaterThan(0))
|
||||||
->will($this->returnValueMap(array(
|
->will($this->returnValueMap(array(
|
||||||
array(
|
array(
|
||||||
array('3', '4', '5', '6', '7', '8'),
|
array(3, 4, 5, 6, 7, 8),
|
||||||
'f_read',
|
'f_read',
|
||||||
1,
|
1,
|
||||||
array(
|
array(
|
||||||
|
@@ -27,7 +27,7 @@ class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_
|
|||||||
$this->greaterThan(0))
|
$this->greaterThan(0))
|
||||||
->will($this->returnValueMap(array(
|
->will($this->returnValueMap(array(
|
||||||
array(
|
array(
|
||||||
array('3', '4', '5', '6', '7'),
|
array(3, 4, 5, 6, 7),
|
||||||
'f_read',
|
'f_read',
|
||||||
1,
|
1,
|
||||||
array(
|
array(
|
||||||
|
Reference in New Issue
Block a user