aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ws_protocols/rest_handler.php4
-rw-r--r--themes/default/js/rating.js1
-rw-r--r--themes/default/js/scripts.js8
3 files changed, 9 insertions, 4 deletions
diff --git a/include/ws_protocols/rest_handler.php b/include/ws_protocols/rest_handler.php
index ece5c0203..d0708f79d 100644
--- a/include/ws_protocols/rest_handler.php
+++ b/include/ws_protocols/rest_handler.php
@@ -41,6 +41,10 @@ class PwgRestRequestHandler
$params[$name]=$value;
}
}
+ if ( empty($method) && isset($_GET['method']) )
+ {
+ $method = $_GET['method'];
+ }
if ( empty($method) )
{
diff --git a/themes/default/js/rating.js b/themes/default/js/rating.js
index d69bd5987..b72b55477 100644
--- a/themes/default/js/rating.js
+++ b/themes/default/js/rating.js
@@ -61,6 +61,7 @@ function updateRating(e)
y.callService(
"pwg.images.rate", {image_id: gRatingOptions.image_id, rate: rateButton.initialRateValue } ,
{
+ method: "POST",
onFailure: function(num, text) {
alert(num + " " + text);
document.location = rateButton.form.action + "&rate="+rateButton.initialRateValue;
diff --git a/themes/default/js/scripts.js b/themes/default/js/scripts.js
index 25707880a..848179592 100644
--- a/themes/default/js/scripts.js
+++ b/themes/default/js/scripts.js
@@ -60,9 +60,9 @@ PwgWS.prototype = {
}
this.xhr.onreadystatechange = pwgBind(this, this.onStateChange);
- var url = this.urlRoot+"ws.php?format=json";
+ var url = this.urlRoot+"ws.php?format=json&method="+method;
- var body = "method="+method;
+ var body = "";
if (parameters)
{
for (var prop in parameters)
@@ -70,10 +70,10 @@ PwgWS.prototype = {
if ( typeof parameters[prop] == 'object' && parameters[prop])
{
for (var i=0; i<parameters[prop].length; i++)
- body += "&"+prop+"[]="+encodeURIComponent(parameters[prop][i]);
+ body += prop+"[]="+encodeURIComponent(parameters[prop][i])+"&";
}
else
- body += "&"+prop+"="+encodeURIComponent(parameters[prop]);
+ body += prop+"="+encodeURIComponent(parameters[prop])+"&";
}
}