From a09383eaa9211bb592151c29e7b85f027c05aaec Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 27 Nov 2011 11:43:37 +0100 Subject: avoid PHP notice in ACL ajax backend FS#2384 --- lib/plugins/acl/ajax.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/plugins/acl/ajax.php') diff --git a/lib/plugins/acl/ajax.php b/lib/plugins/acl/ajax.php index d704fa8c9..71a2eb03a 100644 --- a/lib/plugins/acl/ajax.php +++ b/lib/plugins/acl/ajax.php @@ -7,7 +7,7 @@ */ //fix for Opera XMLHttpRequests -if(!count($_POST) && $HTTP_RAW_POST_DATA){ +if(!count($_POST) && !empty($HTTP_RAW_POST_DATA)){ parse_str($HTTP_RAW_POST_DATA, $_POST); } -- cgit v1.2.3 From 96946cc94d3ecb3832e2a1ce35c49743e25329e1 Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Wed, 21 Mar 2012 11:25:00 +0100 Subject: replaced $HTTP_RAW_POST_DATA with http_get_raw_post_data function --- lib/plugins/acl/ajax.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lib/plugins/acl/ajax.php') diff --git a/lib/plugins/acl/ajax.php b/lib/plugins/acl/ajax.php index 71a2eb03a..3a5d89c08 100644 --- a/lib/plugins/acl/ajax.php +++ b/lib/plugins/acl/ajax.php @@ -6,16 +6,17 @@ * @author Andreas Gohr */ -//fix for Opera XMLHttpRequests -if(!count($_POST) && !empty($HTTP_RAW_POST_DATA)){ - parse_str($HTTP_RAW_POST_DATA, $_POST); -} - if(!defined('DOKU_INC')) define('DOKU_INC',dirname(__FILE__).'/../../../'); require_once(DOKU_INC.'inc/init.php'); //close session session_write_close(); +//fix for Opera XMLHttpRequests +$postData = http_get_raw_post_data(); +if(!count($_POST) && !empty($postData)){ + parse_str($postData, $_POST); +} + if(!auth_isadmin()) die('for admins only'); if(!checkSecurityToken()) die('CRSF Attack'); -- cgit v1.2.3