Welcome, Guest. Please login or register.
Did you miss your activation email?
09 May 2008, 09:07

Login with username, password and session length
Home Chat Help Search Calendar Login Register
Pages: [1]
Print
Author Topic: [Solved] Double quotation mark breaks edit of oneline content block  (Read 794 times)
0 Members and 1 Guest are viewing this topic.
Bash Gordon
Forum Member
*

Karma: 0
Offline Offline

Posts: 5


« on: 27 Mar 2008, 08:58 »

I tried to use a double quotation mark in the content of a oneline content block.

First input and submit works as expected, however, when I subsequently try to edit the page everything following the double quotation mark is lost.

The source of the problem seems to be that quotation marks are not escaped or htmlencoded in the input text box. The source code of the edit page shows for example
<input type="text" name="someonelinecontent" value="foo="bar"" />
with the value field prematurely "ending" after equal sign.

Has anybody else experienced this problem? Is there a known workaround?

I have already tried to set wysiwyg to true and false, but the setting didn't change behavior. Using single quotation marks as a workaround doesn't help as I want to use a variable in a parameter which has to be quoted.

I hope I didn't miss something obvious?

Thank you!
Bash
« Last Edit: 31 Mar 2008, 07:54 by Bash Gordon » Logged
Pierre M.
Support Team member
Support Guru
Power Poster
****

Karma: 28
Offline Offline

Posts: 2345

Location: Paris

Please keep it simple


« Reply #1 on: 27 Mar 2008, 12:12 »

Hello Bash,

The source of the problem seems to be that quotation marks are not escaped or htmlencoded in the input text box. The source code of the edit page shows for example
<input type="text" name="someonelinecontent" value="foo="bar"" />
with the value field prematurely "ending" after equal sign.

Not tried :
<input type="text" name="someonelinecontent" value='foo="bar"' />
<input type="text" name="someonelinecontent" value="foo='bar'" />

Pierre M.
Logged

-- Pierre, support team member. comodérateur du forum francophone.
Please read "how to submit installation/debug help requests" before posting.
Want to contribute to CMSms ? Improve the wiki with your forum account.
Bash Gordon
Forum Member
*

Karma: 0
Offline Offline

Posts: 5


« Reply #2 on: 27 Mar 2008, 13:10 »

Hello Pierre,

Not tried :
<input type="text" name="someonelinecontent" value='foo="bar"' />
Could you give me hint which functions generate the edit pages? Sorry, I have no idea where to start searching.

<input type="text" name="someonelinecontent" value="foo='bar'" />
Yes, but unfortunately this doesn't work (as described above). Actually I want to have a smarty tag with a parameter including a string and a variable, e.g. like this
{mytag par="foo $lang bar"}
and then single quotes no longer work.

Thank you! Best,
Bash
Logged
Nullig
Power Poster
***

Karma: 39
Offline Offline

Posts: 1197

Location: White Rock, BC



« Reply #3 on: 27 Mar 2008, 13:40 »

Can you not do:

$par_val = "foo ".$lang." bar";
{mytag par="$par_val"}

Nullig
Logged

When Irish eyes are smiling, they're usually up to something.
Bash Gordon
Forum Member
*

Karma: 0
Offline Offline

Posts: 5


« Reply #4 on: 28 Mar 2008, 08:51 »

$par_val = "foo ".$lang." bar";
{mytag par="$par_val"}
Yes, this should also work, thanks!

I searched the source code and found the relevant line (231) in lib/classes/contenttypes/Content.inc.php (version 1.2.3, Black Rock):
Code:
$ret[]= array(ucwords($blockName).':','<input type="text" name="'.$blockNameId['id'].'" value="'.$this->GetPropertyValue($blockNameId['id']).'" />');

Would you expect any side effects of converting the content with cms_htmlentities (as it is done with the other input boxes)?
Code:
cms_htmlentities($this->GetPropertyValue($blockNameId['id']))

In case not, would it be possible to include this change in the next release?

Thank you, best
Bash
Logged
Bash Gordon
Forum Member
*

Karma: 0
Offline Offline

Posts: 5


« Reply #5 on: 31 Mar 2008, 07:52 »

Solved in 1.2.4.  Thank you for the fast inclusion of the patch!

Best,
Bash
Logged
Pages: [1]
Print
Jump to: