Did you encodeURI() your data before you send it by javascript? I never used jQuery, but I will be surprised if jQuery don't have a function to wrap everything from your form, encodeURI() them before sending it to your server. You shouldn't be seeing your data truncated, as & should have been encoded as %26 already.
On May 3, 12:51 pm, rartavia <[email protected]> wrote: > Hello guys, thanks for your answers. > > As I supposed, it was the debugger::log() function the one converting > '&' into amp, the real problem was in Dr. Loboto's (thanks man) > observation about the reference parameter. After correcting it, I got > in my DB "&#NUMBER;" no need for more, here is the correction: > > function restore_html_ecoded_characters(&$pArray){ > foreach($pArray as $key => $value){ > if(is_array($value)){ > restore_html_ecoded_characters($pArray[$key]); > }else{ > $pArray[$key] = str_replace("_#", "&#", $value); > } > } > > } > > Lapinski: About your suggestion, I like it for entities as áéíóú but > what about the ampersand? I'm sending via ajax something like this: > jQuery.ajax({ > data:"data[Model][attribute]=value1&data[Model][attribute2]=value2&data > [Model][attribute]=value3&...", > ...otherAjaxOptions...}); > > some of my values contain '&' which would, for cake divide the > parameter value, > IE: "data[Model][url]=<object...value="http://somepage.com/ > example&hl=en&fs=1">...</object>&..." > in controller, when I read data["Model"]["url"] would be > "<object...value="http://somepage.com/example" ignoring the rest since > the ampersand is the parameter separator. For the rest, for sure i'll > use php's htmlentities, that way is less processing in JavaScript, > thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
