PHP Classes

Found and fixed a minor bug.

Recommend this page to a friend!

      PHP Ajax  >  All threads  >  Found and fixed a minor bug.  >  (Un) Subscribe thread alerts  
Subject:Found and fixed a minor bug.
Summary:Found a small bug, that when I post anything with quotes.
Messages:3
Author:Marcus Eby
Date:2008-02-12 08:09:22
Update:2008-02-12 22:29:47
 

  1. Found and fixed a minor bug.   Reply   Report abuse  
Picture of Marcus Eby Marcus Eby - 2008-02-12 08:09:22
Whenever I post through phpajax some text box with double quotes, it wasn't adding slashes to the values, just before it turns it into JSON arrays and sends it through to the server.

I found this piece of code in phpajax.js

variable = params[i].value ? params[i].value : getObjValue(params[i].source);

And added the line right after it:
variable=variable.replace(/\"/g,'\\"'); // MARCUS ADDED REPLACE HERE

Everything seems to work fine now.
But I thought I'd post it here, so you can do what you want with it.

It's really bringing down dev time for small apps.
Thanks again man.

Awesome class.

Marcus

  2. Re: Found and fixed a minor bug.   Reply   Report abuse  
Picture of Cesar D. Rodas Cesar D. Rodas - 2008-02-12 20:48:08 - In reply to message 1 from Marcus Eby
Great Marcus!

I just want to ask you if I can add your code, of course recognizing you for that bug report and fix, in as a part of phpajax project. That will mean that will contribution will be a "BSD" contribution.


Best regards,

  3. Re: Found and fixed a minor bug.   Reply   Report abuse  
Picture of Marcus Eby Marcus Eby - 2008-02-12 22:29:47 - In reply to message 2 from Cesar D. Rodas
Of course you can, you don't need to ask.

After all, your the guy who built it.
I just use it. <grin>

Take care.

Marcus