Single Quotes Doubling

Author Message

Deane Barker

Thursday 05 February 2004 12:07:21 pm

I'm having problems with single quotes (apostrophes) doubling up. If I have text like this:

"This is Deane's car."

It becomes this after I save.

"This is Deane''s car."

I tried fiddling with magic_quotes, but it's already off. If I turn it on, I get about EIGHT single quotes after saving for each one I had before saving.

I searched these forums, but all I found was references to slashes, which magic_quotes is supposed to fix. I couldn't find anything about single quotes.

Any througts on this?

Deane

Balazs Halasy

Friday 06 February 2004 1:14:26 am

Hi,

I'm not sure in which context this problem of yours relates to, if it is related to template code then perhaps the following lines shed some light on the issue:

It is possible to use quotes inside strings. This can be done in two ways:

-by using a different kind of quote
-by using an escape character

In other words, if you need to use a quote inside a string, you can either switch to the other enclosing quote type, or escape the quote character with a backslash. The following examples demonstrate the use of quotes inside strings:

{'The following text is double quoted: "Rock and roll!"  '}
{"The following text is single quoted: 'Rock and roll!'  "}
{'Using both single and double quotes: "Rock\'n roll!"   '}
{'Using both single and double quotes: \'Rock\'n roll!\' '}
{"Using both single and double quotes: 'Rock'n roll!'    "}
{"Using both single and double quotes: \"Rock'n roll\"   "}

The output of the template code above will be:

The following text is double quoted: "Rock and roll!"
The following text is single quoted: 'Rock and roll!'
Using both single and double quotes: "Rock'n roll!"
Using both single and double quotes: 'Rock'n roll!'
Using both single and double quotes: 'Rock'n roll!'
Using both single and double quotes: "Rock'n roll!"

Because of the way template code is defined (template code is encapsulated in a matching pair of curly brackets), the right curly bracket, "}", must also be prepended by the backslash escape character. The following example demonstrates this:

{'{ This text is inside curly brackets.\}'}

The output of the template code above will be:

{This text is inside curly brackets.}

Balazs

Deane Barker

Friday 06 February 2004 4:40:56 am

I'm sorry, this isn't in template code. This is in object properties. When I create a new object and enter a value in a text field. When I save and go back to edit again, all the single quotes have been doubled.

I should have been more clear. Sorry.

Deane Barker

Wednesday 18 February 2004 10:43:34 am

Still looking for an answer here. Anyone?

Balazs Halasy

Thursday 19 February 2004 5:46:53 am

Hmm, I think you'll have to describe the problem in a bit more detail. Write down a step-by-step list that describes your actions. Where is it that you get the double quote phenomenon? Does this thing appear when you use the admin interface? Which version of eZ publish are you running? Please understand that if you want help then you need to provide as much information as possible (or else, other people in the forum will not be able to answer).

Balazs

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.