if _error() is invoked from cmd-line, it should not display html-errors
authorAndreas Unterkircher <unki@netshadow.at>
Mon, 29 Dec 2008 20:58:40 +0000 (21:58 +0100)
committerAndreas Unterkircher <unki@netshadow.at>
Mon, 29 Dec 2008 20:58:40 +0000 (21:58 +0100)
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
phpfspot.class.php

index 4acb6473563bd45bd51900364c6f712494d7faa4..f3f78a7bf38744d26ed75ef1d4568d511cf4b5db 100644 (file)
@@ -2061,7 +2061,7 @@ class PHPFSPOT {
          $full_path = $this->translate_path($this->parse_uri($details['uri'], 'fullpath'));
 
          if(!file_exists($full_path)) {
          $full_path = $this->translate_path($this->parse_uri($details['uri'], 'fullpath'));
 
          if(!file_exists($full_path)) {
-            $this->_error("File ". $full_path ." does not exist\n");
+            $this->_error("File ". $full_path ." does not exist");
             return;
          }
 
             return;
          }
 
@@ -2578,8 +2578,12 @@ class PHPFSPOT {
       switch($this->cfg->logging) {
          default:
          case 'display':
       switch($this->cfg->logging) {
          default:
          case 'display':
-            print "<img src=\"resources/green_info.png\" alt=\"warning\" />\n";
-            print $text ."<br />\n";
+            if(isset($this->fromcmd))
+               print $text ."\n";
+            else {
+               print "<img src=\"resources/green_info.png\" alt=\"warning\" />\n";
+               print $text ."<br />\n";
+            }
             break;
          case 'errorlog':  
             error_log($text);
             break;
          case 'errorlog':  
             error_log($text);