[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

@ -25,7 +25,7 @@ class acp_forums
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache;
global $db, $user, $auth, $template, $cache, $request;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
$user->add_lang('acp/forums');
@ -256,7 +256,7 @@ class acp_forums
$cache->destroy('sql', FORUMS_TABLE);
}
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')
if ($request->is_ajax())
{
echo json_encode(array('success' => ($move_forum_name !== false)));
exit;

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;