User tests: Successful: Unsuccessful:
As an extension developer I sometimes include HTML in the description for better presentation in the administrator. When a new module is created the HTML is displayed in the new module screen which not only looks bad but does not provide the user a brief description of the module. I will create a pull request for the changes.
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=33854
Labels |
Labels |
Added:
?
|
Labels |
Added:
?
|
Labels |
Added:
?
|
I think you should only use strip_tags
for the $short_desc
.
The $desc
is used in the tooltip where tags are parsed perfectly fine when escaped.
Also it will break the tooltip, if there is a double quote ("
) in the description, which currently works perfectly fine.
Setting back to in progress.
Labels |
Removed:
?
|
Labels |
Removed:
?
|
A double quote doesn't work fine in the current code. I think the only change needed is to update the current PR with this line instead of the proposed $desc.
$desc = str_replace('"', '', ((JHTML::_('string.truncate', (strip_tags($item->desc)), 200))));
The idea behind it is that only the double quotes need to be removed from the left over description as these mess up the markup.
Any other ideas are welcome of course. Tested this with the provided module in the JC tracker and changing the description in there.
A double quote doesn't work fine in the current code.
Works fine for me. I just double checked in my testing installation. I wouldn't remove them if there is no reason.
What is the issue with using $this->escape for $desc
(which is used in the tooltip)? The tracker only talks about a problem with the $short_desc
.
The only Issue I see is that it could potentially generate invalid markup because we only use the first 200 characters there. This may break the tooltip layout in that the text goes outside and the like. On the other hand formattings and quotes would be preserved.
Agree with @Bakual we need to keep the $this->escape in the code as well. So the new code will look like this:
$desc = JHTML::_('string.truncate', ($this->escape(strip_tags($item->desc))), 200);
$short_desc = JHTML::_('string.truncate', ($this->escape(strip_tags($item->desc))), 90);
The only Issue I see is that it could potentially generate invalid markup
I tested this and Joomla! handles it well because it doesn't break in the middle of a word within quotes.
Status | New | ⇒ | Pending |
Labels |
Labels |
Removed:
?
|
Category | ⇒ | Modules |
@masters1333 Could you please update your PR with the final changes as pointed out? Thanks.
@masters1333 i have just send you a PR with the changes that @roland-d suggested. I hope you can review and merge so we can move this issue forward. Thanks
PR is: masters1333#1
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2015-05-31 08:31:21 |
Closed_By | ⇒ | zero-24 |
Milestone |
Added: |
@masters1333 Works as described. Thank you!