slashes being replaced by \/. maybe a bug

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

slashes being replaced by \/. maybe a bug

xpete
I'am doing this:
http://zend-framework-community.634137.n4.nabble.com/How-to-Zend-Dojo-Form-Dependent-Selects-e-g-Country-City-td663650.html

and if i do this:
$this->view->form->getElement('subtipo')->setStoreParams(array('url' => 'http://localhost/~xpete/project/public/info/lookup/tipo/1'));

I get this result on the generated html:
subtipo_id = new dojo.data.ItemFileReadStore({"url":"http:\/\/localhost\/~xpete\/project\/public\/info\/lookup\/tipo\/1"});

I mean, the '\' have been replaced by '\/'.
There's any way i can avoid this? this is a Zend bug?
I tried this with Zend FW 1.11.7 1.11.8 and 1.11.9 preview.

thx
Diogo
Reply | Threaded
Open this post in threaded view
|

Re: slashes being replaced by \/. maybe a bug

MMurphy
Looks like you have an input filter using addslashes() and you are lacking the use of stripslashes() on output. (or more likely mysql_real_escape_string() and its paired function.)  Anyone able to comment on this with more authority?  I'm not a Zend Framework guy, I just get the list emails.

MM

On Wed, Jul 13, 2011 at 6:57 PM, xpete [via Zend Framework Community] <[hidden email]> wrote:
I'am doing this:
http://zend-framework-community.634137.n4.nabble.com/How-to-Zend-Dojo-Form-Dependent-Selects-e-g-Country-City-td663650.html

and if i do this:
$this->view->form->getElement('subtipo')->setStoreParams(array('url' => 'http://localhost/~xpete/project/public/info/lookup/tipo/1'));

I get this result on the generated html:
subtipo_id = new dojo.data.ItemFileReadStore({"url":"http:\/\/localhost\/~xpete\/project\/public\/info\/lookup\/tipo\/1"});

I mean, the '\' have been replaced by '\/'.
There's any way i can avoid this? this is a Zend bug?
I tried this with Zend FW 1.11.7 1.11.8 and 1.11.9 preview.

thx
Diogo



If you reply to this email, your message will be added to the discussion below:
http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666299.html
To start a new topic under Zend Framework, email [hidden email]
To unsubscribe from Zend Framework, click here.

Reply | Threaded
Open this post in threaded view
|

Re: slashes being replaced by \/. maybe a bug

David Muir-2
On Thu 14 Jul 2011 09:06:38 EST, MMurphy wrote:

> Looks like you have an input filter using addslashes() and you are lacking
> the use of stripslashes() on output. (or more likely
> mysql_real_escape_string() and its paired function.)  Anyone able to comment
> on this with more authority?  I'm not a Zend Framework guy, I just get the
> list emails.
>
> MM
>
> On Wed, Jul 13, 2011 at 6:57 PM, xpete [via Zend Framework Community]<
> [hidden email]>  wrote:
>
>> I'am doing this:
>>
>> http://zend-framework-community.634137.n4.nabble.com/How-to-Zend-Dojo-Form-Dependent-Selects-e-g-Country-City-td663650.html
>>
>> and if i do this:
>> $this->view->form->getElement('subtipo')->setStoreParams(array('url' =>  '
>> http://localhost/~xpete/project/public/info/lookup/tipo/1'));
>>
>> I get this result on the generated html:
>> subtipo_id = new
>> dojo.data.ItemFileReadStore({"url":"http:\/\/localhost\/~xpete\/project\/public\/info\/lookup\/tipo\/1"});
>>
>>
>> I mean, the '\' have been replaced by '\/'.
>> There's any way i can avoid this? this is a Zend bug?
>> I tried this with Zend FW 1.11.7 1.11.8 and 1.11.9 preview.
>>
>> thx
>> Diogo
>>
>>
>> ------------------------------
>>   If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666299.html
>>   To start a new topic under Zend Framework, email
>> [hidden email]
>> To unsubscribe from Zend Framework, click here<
>>
>>
>
>
> --
> View this message in context:
http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666311.html
> Sent from the Zend Framework mailing list archive at Nabble.com.

Is Magic Quotes on?

David

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: slashes being replaced by \/. maybe a bug

MMurphy
Good one, David...

On Thu, Jul 14, 2011 at 2:01 AM, David Muir-2 [via Zend Framework Community] <[hidden email]> wrote:
On Thu 14 Jul 2011 09:06:38 EST, MMurphy wrote:

> Looks like you have an input filter using addslashes() and you are lacking
> the use of stripslashes() on output. (or more likely
> mysql_real_escape_string() and its paired function.)  Anyone able to comment
> on this with more authority?  I'm not a Zend Framework guy, I just get the
> list emails.
>
> MM
>
> On Wed, Jul 13, 2011 at 6:57 PM, xpete [via Zend Framework Community]<
> [hidden email]>  wrote:
>
>> I'am doing this:
>>
>> http://zend-framework-community.634137.n4.nabble.com/How-to-Zend-Dojo-Form-Dependent-Selects-e-g-Country-City-td663650.html
>>

>> and if i do this:
>> $this->view->form->getElement('subtipo')->setStoreParams(array('url' =>  '
>> http://localhost/~xpete/project/public/info/lookup/tipo/1'));
>>
>> I get this result on the generated html:
>> subtipo_id = new
>> dojo.data.ItemFileReadStore({"url":"http:\/\/localhost\/~xpete\/project\/public\/info\/lookup\/tipo\/1"});
>>
>>
>> I mean, the '\' have been replaced by '\/'.
>> There's any way i can avoid this? this is a Zend bug?
>> I tried this with Zend FW 1.11.7 1.11.8 and 1.11.9 preview.
>>
>> thx
>> Diogo
>>
>>
>> ------------------------------
>>   If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666299.html
>>   To start a new topic under Zend Framework, email
>> [hidden email]
>> To unsubscribe from Zend Framework, click here<

>>
>>
>
>
> --
> View this message in context:
http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666311.html
> Sent from the Zend Framework mailing list archive at Nabble.com.

Is Magic Quotes on?

David

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]





If you reply to this email, your message will be added to the discussion below:
http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666711.html
To start a new topic under Zend Framework, email [hidden email]
To unsubscribe from Zend Framework, click here.

Reply | Threaded
Open this post in threaded view
|

Re: slashes being replaced by \/. maybe a bug

xpete
I tried with both magic quotes on and off and the result is the same.
I'am using php 5.3.7 so magic quote are desabled by default.

setStoreParams is a method from the Zend Framework and that's why i think this can be a bug and
i wanted feedback from Zend developers.
thx
Diogo
Reply | Threaded
Open this post in threaded view
|

Re: slashes being replaced by \/. maybe a bug

Bart McLeod
In reply to this post by xpete
Hi Diogo,

The best you can do is file an issue for this and upload a unit test
that proves this is a bug. It looks like a bug to me at first sight,
mostly because I can't think of a reason to escape a forward slash.

- Bart McLeod

Op 14-07-11 00:57, xpete schreef:

> I'am doing this:
> http://zend-framework-community.634137.n4.nabble.com/How-to-Zend-Dojo-Form-Dependent-Selects-e-g-Country-City-td663650.html
>
> and if i do this:
> $this->view->form->getElement('subtipo')->setStoreParams(array('url' =>
> 'http://localhost/~xpete/project/public/info/lookup/tipo/1'));
>
> I get this result on the generated html:
> subtipo_id = new
> dojo.data.ItemFileReadStore({"url":"http:\/\/localhost\/~xpete\/project\/public\/info\/lookup\/tipo\/1"});
>
> I mean, the '\' have been replaced by '\/'.
> There's any way i can avoid this? this is a Zend bug?
> I tried this with Zend FW 1.11.7 1.11.8 and 1.11.9 preview.
>
> thx
> Diogo
>
>
> --
> View this message in context: http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666299.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: slashes being replaced by \/. maybe a bug

H Glenn Hatfield
I did some looking into this yesterday. It appears to be a "bug" in
json_encode() that is getting a new option in php 5.4. Not sure if it
was backported into 5.3 or not.

http://www.php.net/manual/en/function.json-encode.php#100679
https://bugs.php.net/bug.php?id=49366

H

On Fri, Jul 15, 2011 at 6:45 AM, Bart McLeod <[hidden email]> wrote:

> Hi Diogo,
>
> The best you can do is file an issue for this and upload a unit test that
> proves this is a bug. It looks like a bug to me at first sight, mostly
> because I can't think of a reason to escape a forward slash.
>
> - Bart McLeod
>
> Op 14-07-11 00:57, xpete schreef:
>>
>> I'am doing this:
>>
>> http://zend-framework-community.634137.n4.nabble.com/How-to-Zend-Dojo-Form-Dependent-Selects-e-g-Country-City-td663650.html
>>
>> and if i do this:
>> $this->view->form->getElement('subtipo')->setStoreParams(array('url' =>
>> 'http://localhost/~xpete/project/public/info/lookup/tipo/1'));
>>
>> I get this result on the generated html:
>> subtipo_id = new
>>
>> dojo.data.ItemFileReadStore({"url":"http:\/\/localhost\/~xpete\/project\/public\/info\/lookup\/tipo\/1"});
>>
>> I mean, the '\' have been replaced by '\/'.
>> There's any way i can avoid this? this is a Zend bug?
>> I tried this with Zend FW 1.11.7 1.11.8 and 1.11.9 preview.
>>
>> thx
>> Diogo
>>
>>
>> --
>> View this message in context:
>> http://zend-framework-community.634137.n4.nabble.com/slashes-being-replaced-by-maybe-a-bug-tp3666299p3666299.html
>> Sent from the Zend Framework mailing list archive at Nabble.com.
>>
>
> --
> List: [hidden email]
> Info: http://framework.zend.com/archives
> Unsubscribe: [hidden email]
>
>
>

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]