1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 05:20:56 +02:00

[ticket/10271] Changed AJAX functions to $request->is_ajax().

PHPBB3-10271
This commit is contained in:
Callum Macrae
2011-08-19 09:38:57 +01:00
committed by Igor Wiedler
parent 69eb7b8332
commit 94172b54dd
2 changed files with 8 additions and 8 deletions

View File

@@ -2448,9 +2448,9 @@ function build_url($strip_vars = false)
*/
function meta_refresh($time, $url, $disable_cd_check = false)
{
global $template, $refresh_data;
global $template, $refresh_data, $request;
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
if ($request->is_ajax())
{
$refresh_data = array(
'time' => $time,
@@ -2629,7 +2629,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg
*/
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
{
global $user, $template, $db;
global $user, $template, $db, $request;
global $phpEx, $phpbb_root_path, $request;
if (isset($_POST['cancel']))
@@ -2710,7 +2710,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
$db->sql_query($sql);
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
if ($request->is_ajax())
{
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;
echo json_encode(array(
@@ -3748,7 +3748,7 @@ function phpbb_checkdnsrr($host, $type = 'MX')
*/
function msg_handler($errno, $msg_text, $errfile, $errline)
{
global $cache, $db, $auth, $template, $config, $user;
global $cache, $db, $auth, $template, $config, $user, $request;
global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
// Do not display notices if we suppress them via @
@@ -3947,7 +3947,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
'S_USER_NOTICE' => ($errno == E_USER_NOTICE) ? true : false)
);
if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
if ($request->is_ajax())
{
global $refresh_data;