1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

Use e107 methods in Ajax callback.

This commit is contained in:
Lóna Lore
2016-03-31 10:15:07 +02:00
parent df4e45f2a4
commit 91a0e57cee

View File

@@ -47,10 +47,11 @@ if(e_AJAX_REQUEST)
{
if(vartrue($_POST['q']))
{
$q = filter_var($_POST['q'], FILTER_SANITIZE_STRING);
$l = vartrue($_POST['l']) ? intval($_POST['l']) : 10;
$db = e107::getDb();
$tp = e107::getParser();
$q = $tp->filter($_POST['q']);
$l = vartrue($_POST['l']) ? intval($_POST['l']) : 10;
if($db->select("user", "user_id,user_name", "user_name LIKE '". $q."%' ORDER BY user_name LIMIT " . $l))
{
@@ -65,8 +66,8 @@ if(e_AJAX_REQUEST)
if(count($data))
{
header('Content-type: application/json');
echo json_encode($data);
$ajax = e107::getAjax();
$ajax->response($data);
}
}
}