[libsoup] xmlrpc-server.php: Don't try to count NULL params



commit 508fe8f3a449f8bbbafadef713219782abe84988
Author: Jan Alexander Steffens (heftig) <jan steffens gmail com>
Date:   Thu Jan 11 20:22:58 2018 +0100

    xmlrpc-server.php: Don't try to count NULL params
    
    Trying to count something uncountable causes PHP ≥7.2 to emit a warning
    before returning zero.
    
    I assume that the ping() function's $params is NULL when there are no
    parameters.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795111

 tests/xmlrpc-server.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/tests/xmlrpc-server.php b/tests/xmlrpc-server.php
index 4025f95..f315b6d 100644
--- a/tests/xmlrpc-server.php
+++ b/tests/xmlrpc-server.php
@@ -71,7 +71,7 @@ function echo_ ($method_name, $params, $app_data)
 
 function ping ($method_name, $params, $app_data)
 {
-       if (count ($params) == 0)
+       if (is_null ($params) or count ($params) == 0)
                return "pong";
        else
                return paramfault ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]