issue84, if source picture does not exist or not readable for current user, stop...
[phpfspot.git] / rpc.php
diff --git a/rpc.php b/rpc.php
index 39e2b7726efa606ba11637d5b8359916ac962ba6..0bd04fe9d036e1bef630467205bc07849685dd04 100644 (file)
--- a/rpc.php
+++ b/rpc.php
@@ -31,7 +31,7 @@ class PHPFSPOT_RPC {
 
    } // __construct()
 
-   function process_ajax_request()
+   public function process_ajax_request()
    {
       require_once 'HTML/AJAX/Server.php';
 
@@ -40,6 +40,12 @@ class PHPFSPOT_RPC {
 
       $fspot = new PHPFSPOT();
 
+      /* if no action is specified, no need to further process this
+       * function here.
+       */
+      if(!isset($_GET['action']))
+         return;
+
       switch($_GET['action']) {
          case 'showphoto':
             if(isset($_GET['id']) && is_numeric($_GET['id'])) {
@@ -106,6 +112,7 @@ class PHPFSPOT_RPC {
             break;
 
          case 'get_export':
+            /* $_GET['mode'] will be validated by getExport() */
             $fspot->getExport($_GET['mode']);
             break;
 
@@ -141,7 +148,7 @@ class PHPFSPOT_RPC {
 
    } // process_ajax_request();
 
-}
+} // class PHPFSPOT_RPC
 
 $rpc = new PHPFSPOT_RPC();
 $rpc->process_ajax_request();