Closed (cannot reproduce)
Project:
Drupal core
Version:
7.x-dev
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 May 2010 at 09:46 UTC
Updated:
14 Dec 2012 at 04:27 UTC
If string passed to truncate_utf8 contains tag, with attribute, truncate splits tag in middle of if, causing markup to fail. Example in dblog_overview, where message is split of 56 characters, <span class="foo"></span> can be split to <span ....
Comments
Comment #1
dawehnerIf someone wants to truncate html strings http://api.drupal.org/api/function/text_summary/7 is the function to use.
Perhaps this function can be added to the filter api, so it can be used on other places, too, if you have disable the text module.
Comment #2
lyricnz commentedtruncate_utf8 doesn't claim to deal with HTML tags.
dblog_overview() itself doesn't truncate messages, that's done in theme_dblog_message() - but it does use:
The filter_xss($output, array()) will remove all tags, so the risk identified in this issue cannot happy. Please reopen if this analysis is incorrect, and describe how to get truncated tags.