From f03278fb7b0f690aef21014aa3514f4e3a996d65 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Sep 2016 11:34:55 +0200 Subject: [PATCH] soft_api allows to bypass blockwords --- htdocs/application/controllers/Api.php | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/htdocs/application/controllers/Api.php b/htdocs/application/controllers/Api.php index 69475d8..43bd306 100644 --- a/htdocs/application/controllers/Api.php +++ b/htdocs/application/controllers/Api.php @@ -39,11 +39,8 @@ class Api extends Main function create() { - - // if config soft_api is set, allow interaction: - // without api_key: use blockwords - // with api_key: pass blockwords - if (config_item('apikey') != $this->input->get('apikey')) + + if (config_item('apikey') != $this->input->get('apikey') && config_item('soft_api') == false) { die("Invalid API key\n"); } @@ -77,9 +74,19 @@ class Api extends Main die("You are not allowed to paste\n"); } - if (!$this->_blockwords_check()) + if (config_item('soft_api') == true && (config_item('apikey') == $this->input->get('apikey'))) { - die("Your paste contains blocked words\n"); + + //pass + + } + else + { + + if (!$this->_blockwords_check()) + { + die("Your paste contains blocked words\n"); + } } //create paste