]> git.wh0rd.org Git - tt-rss.git/commitdiff
detect php cgi binary because people keep trying to run service scripts using it
authorAndrew Dolgov <noreply@fakecake.org>
Thu, 6 Feb 2014 19:03:05 +0000 (23:03 +0400)
committerAndrew Dolgov <noreply@fakecake.org>
Thu, 6 Feb 2014 19:03:05 +0000 (23:03 +0400)
update.php
update_daemon2.php

index c1547fa7f7f00033e0f077686a4b39d506918fd4..521b956ad33b7d60311928690ff0da1716864042 100755 (executable)
 
        $options = getopt("", $longopts);
 
+       if (!is_array($options)) {
+               die("error: getopt() failed. ".
+                       "Most probably you are using PHP CGI to run this script ".
+                       "instead of required PHP CLI. Check tt-rss wiki page on updating feeds for ".
+                       "additional information.\n");
+       }
+
        if (count($options) == 0 && !defined('STDIN')) {
                ?> <html>
                <head>
index 81734bc3c6fc7800959380e6099f82812b1addd1..9b8a7ad66b0e9376cf92c3a9a3fdba7560383630 100755 (executable)
                die("error: This script requires PHP compiled with PCNTL module.\n");
        }
 
+       if (!is_array($options)) {
+               die("error: getopt() failed. ".
+                       "Most probably you are using PHP CGI to run this script ".
+                       "instead of required PHP CLI. Check tt-rss wiki page on updating feeds for ".
+                       "additional information.\n");
+       }
+
        $master_handlers_installed = false;
 
        $children = array();