Categories > TinyButStrong general >

Two small problems

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: sheepy
Date: 2006-09-23
Time: 07:22

Two small problems

Two small things that I had to fix everytime I update TBS:

1) Fatal error: Cannot redeclare property_exists()

This happens because I use Pear's compact module which provides missing functions.  TBS does not check whether the function is already declared before re-declaring it.


2) Does not escape single quote

By default, htmlentities does not escape single quote.  I prefer using single quote for html attributes, so merging single quote in them will create wrong tags.
By: Skrol29
Date: 2006-09-25
Time: 11:00

Re: Two small problems

Hi Sheepy,

1) I will fix that in the next version. TBS 3.2.0 RC2 should have this change.

2) Single quotes for Html attributes is deprectated since XHTML. And XML doesn't support single quotes for attributes, only double quotes.
That's why I guess the PHP function htmlspecialchars() does not convert single quote by default (but with an option).
In TBS, you can tune your own converter function using a plug-in or using custom function.

By: sheepy
Date: 2006-10-11
Time: 07:34

Re: Two small problems

Thanks for the fix, skrol29. =)

I checked the specification, and I can't find the part that says XHTML (attribute) quote must be double.  However XML element attribute can be quoted by either double or single quote.

Reference: http://www.w3.org/TR/2006/REC-xml-20060816/#IDANUDS

My template usually use single or mixed quotes, and for the years I've switched no validators ever complained...
By: Skrol29
Date: 2006-10-12
Time: 18:54

Re: Two small problems

It looks like you're right.
Give me time to check this point deeper.
By: RwD
Date: 2006-10-15
Time: 15:39

Re: Two small problems

Both are allowed, but using double quotes is encouraged. It is usefull when a value has a double quote in it to use single quotes. I do remember several people telling me single quotes must not be used (and I really never ever do) but I never read anything official saying single quotes aren't allowed. If you come across such a document I would like to read it...