Forbid non-CLI access to command-line scripts
[friendica.git/.git] / bin / daemon.php
index 596f4de..3fe803d 100755 (executable)
  * This script was taken from http://php.net/manual/en/function.pcntl-fork.php
  */
 
+if (php_sapi_name() !== 'cli') {
+       header($_SERVER["SERVER_PROTOCOL"] . ' 403 Forbidden');
+       exit();
+}
+
 use Dice\Dice;
 use Friendica\Core\Logger;
 use Friendica\Core\Worker;