From 850c2e7c4319efcacd94ee246c3290f81e27769a Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 4 May 2009 20:10:55 +0200 Subject: fixed GET support in lib/exe/ajax.php FS#1679 Ignore-this: e77d9d77e6a02bb18b0cf7043a7eb3cb darcs-hash:20090504181055-7ad00-f8bf902e0c93f45eb6ca33fd5b32c9f8bb85512e.gz --- lib/exe/ajax.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php index b4bd20b70..4a30b0349 100644 --- a/lib/exe/ajax.php +++ b/lib/exe/ajax.php @@ -24,18 +24,21 @@ header('Content-Type: text/html; charset=utf-8'); //call the requested function if(isset($_POST['call'])) - $call = 'ajax_'.$_POST['call']; + $call = $_POST['call']; else if(isset($_GET['call'])) - $call = 'ajax_'.$_GET['call']; + $call = $_GET['call']; else exit; -if(function_exists($call)){ - $call(); + +$callfn = 'ajax_'.$call; + +if(function_exists($callfn)){ + $callfn(); }else{ - $call = $_POST['call']; $evt = new Doku_Event('AJAX_CALL_UNKNOWN', $call); if ($evt->advise_before()) { - print "AJAX call '".htmlspecialchars($_POST['call'])."' unknown!\n"; + print "AJAX call '".htmlspecialchars($call)."' unknown!\n"; + exit; } $evt->advise_after(); unset($evt); -- cgit v1.2.3