soft_api allows to bypass blockwords

This commit is contained in:
Claude 2016-09-03 11:34:55 +02:00
parent 2c17ac8e24
commit f03278fb7b

View File

@ -40,10 +40,7 @@ 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