Skip to content

Commit

Permalink
some security for API #944
Browse files Browse the repository at this point in the history
  • Loading branch information
tablatronix committed Oct 30, 2014
1 parent 06df471 commit 4c44b94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions admin/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
if (empty($_POST)) exit;
if (!defined('GSEXTAPI')) exit;

// disable libxml error output
libxml_use_internal_errors();

// disable entity loading to avoid xxe
libxml_disable_entity_loader();

#step 1 - check post for data
if (!isset($_POST['data'])) {
$message = array('status' => 'error', 'message' => i18n_r('API_ERR_MISSINGPARAM'));
Expand All @@ -36,8 +42,6 @@
$method = (string)$in->method;
echo call_user_func(array($request, $method), '');



exit;

/*
Expand Down

0 comments on commit 4c44b94

Please sign in to comment.