Skip to content

Instantly share code, notes, and snippets.

@dai1741
Created July 16, 2013 18:25
Show Gist options
  • Save dai1741/6011256 to your computer and use it in GitHub Desktop.
Save dai1741/6011256 to your computer and use it in GitHub Desktop.
A dirty and insecure patch for kk-star-ratings 1.x. When using it with PHP 5.3, a warning message from php such like 'Deprecated: Function set_magic_quotes_runtime() ...' is injected into ajax response of kk-ratings.js. This ignores it by checking existence of returned contents directly.
--- a/kk-star-ratings/js/kk-ratings.js 2012-05-08 21:00:16.000000000 +0900
+++ b/kk-star-ratings/js/kk-ratings.js 2013-07-17 02:04:01.539796700 +0900
@@ -93,7 +93,7 @@
msg = msg.replace(/^\s+|\s+$/g,"");
var response = msg.split('|||');
- if(response[0]=='SUCCESS')
+ if(response[1]!='')
{
var per = response[1];
var legend = response[2];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment