issue60, calendar parameters can also be zero
[phpfspot.git] / rpc.php
diff --git a/rpc.php b/rpc.php
index d5a7e8f09c237b2c71d6e472abb5565a48d757d8..4ffae5f5fbddd3cc58884f25c3136e8abcd809e2 100644 (file)
--- a/rpc.php
+++ b/rpc.php
@@ -107,7 +107,11 @@ class PHPFSPOT_RPC {
             break;
 
          case 'get_calendar_matrix':
-            $fspot->get_calendar_matrix($_GET['year'], $_GET['month'], $_GET['day']);
+            if((is_numeric($_GET['year']) || $_GET['year'] == "") &&
+               (is_numeric($_GET['month']) || $_GET['month'] == "") &&
+               (is_numeric($_GET['day']) || $_GET['month'] == "")) {
+               $fspot->get_calendar_matrix($_GET['year'], $_GET['month'], $_GET['day']);
+            }
             break;
 
          case 'what_to_do':
@@ -121,6 +125,10 @@ class PHPFSPOT_RPC {
          case 'get_next_slideshow_img':
             print $fspot->getNextSlideShowImage();
             break;
+         
+         case 'get_prev_slideshow_img':
+            print $fspot->getPrevSlideShowImage();
+            break;
 
       }