]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix called-from-browser detection in update.php
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 23 Oct 2012 20:25:56 +0000 (00:25 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 23 Oct 2012 20:25:56 +0000 (00:25 +0400)
update.php

index afe70b903d3f5dbe99d507daebda213225645640..6e23892e29b084b080ceddaa17b95beecdae14f4 100755 (executable)
        require_once "db-prefs.php";
        require_once "update_self.php";
 
-       if (!defined('STDIN')) {
+       if (!defined('PHP_EXECUTABLE'))
+               define('PHP_EXECUTABLE', '/usr/bin/php');
+
+       $op = $argv;
+
+       if (count($argv) == 0 && !defined('STDIN')) {
                ?> <html>
                <head>
-               <title>Update Tool</title>
+               <title>Tiny Tiny RSS data update script.</title>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                <link rel="stylesheet" type="text/css" href="utility.css">
                </head>
 
                <body>
                <div class="floatingLogo"><img src="images/logo_wide.png"></div>
-               <h1><?php echo __("Update") ?></h1>
+               <h1><?php echo __("Tiny Tiny RSS data update script.") ?></h1>
 
-               <?php print_error("Please run this script from the command line."); ?>
+               <?php print_error("Please run this script from the command line. Use option \"-help\" to display command help if this error is displayed erroneously."); ?>
 
                </body></html>
        <?php
                exit;
        }
 
-       if (!defined('PHP_EXECUTABLE'))
-               define('PHP_EXECUTABLE', '/usr/bin/php');
-
-       $op = $argv;
-
        if (count($argv) == 1 || in_array("-help", $op) ) {
                print "Tiny Tiny RSS data update script.\n\n";
                print "Options:\n";