joomla/joomla-cms — pull request #3277 by Bakual (2014-03-11 10:25:28+00:00)
Title: JHtmlBootstrap::addTab() double escapes quotes

### Issue
Tab titles generated using the JLayout `layouts/libraries/cms/html/bootstrap/addtabscript.php` will be escaped by that JLayout. But the title is already escaped using `JText::_('CONSTANT', true)` (The second argument `true` means `jsSafe`). Thus we end up double escaping the title.

### Test
Edit a language string which will end up in a tab title and add a single quote to it. For example:
`COM_NEWSFEEDS_EDIT_NEWSFEED="Edit News' Feed"`
This one will end up in the newsfeed edit form like this:
![newsfeed](https://f.cloud.github.com/assets/1018684/2384059/ff99665c-a906-11e3-9be3-76e522afb1f7.png)
Apply patch and the backslash will be gone.

### Background
This is a regression introduced with Joomla 3.2.3 due to this PR: #3203
The problem (which we didn't catch...) was that before it used `JText::sprintf('CONSTANT', true)`. But `JText::sprintf()` doesn't take a second argument, thus it didn't escape the string. Since that PR also changed the JText calls to `JText::_('CONSTANT', true)` (removing the sprintf part), the strings are now correctly escaped already.