1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/13713] Fix case for phpBB directory

PHPBB3-13713
This commit is contained in:
lavigor
2018-05-30 22:06:26 +03:00
committed by Marc Alexander
parent 6c42563b4d
commit eec7703d3b
12 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
namespace phpbb\mention\source;
abstract class user implements source_interface
{
/** @var \phpbb\db\driver\driver_interface */
protected $db;
/**
* Constructor
*/
public function __construct(\phpbb\db\driver\driver_interface $db)
{
$this->db = $db;
}
/**
* Builds a query based on user input
*
* @param string $keyword Search string
* @param int $topic_id Current topic ID
* @return string Query ready for execution
*/
abstract protected function query($keyword, $topic_id);
/**
* {@inheritdoc}
*/
public function get($keyword, $topic_id)
{
$keyword = utf8_clean_string($keyword);
$res = $this->db->sql_query_limit($this->query($keyword, $topic_id), 5);
$names = [];
while ($row = $this->db->sql_fetchrow($res))
{
$names['u' . $row['user_id']] = [
'name' => $row['username'],
'param' => 'user_id',
'id' => $row['user_id'],
];
}
return $names;
}
}