flag_create_link generates bad HTML

nateprouty - February 24, 2009 - 17:20
Project:Flag
Version:6.x-1.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

On the /admin/build/flags/edit/ page, if I use quotes in any of the description fields that are then added as part of the tag that is generated via the flag_create_link() function, the tag is output incorrectly (doesn't escape the quotes)

For example:

flag_create_link('watchlist', $nid)  --->  <a class="flag flag-action flag-link-toggle flag-processed" list="" watch="" your="" to="" 93)="" (id:="" project="" new="" my="" title="Add the project " href="/flag/flag/watchlist/93?destination=projects&token=xx">Flag</a>

Removing the quotes fixes it:

flag_create_link('watchlist', $nid) ---> <a class="flag flag-action flag-link-toggle flag-processed" title="Add the project My New Project to your watch list" href="/flag/flag/watchlist/93?destination=projects&token=xx">Flag</a>

#1

nateprouty - February 24, 2009 - 17:23
Status:active» closed

#2

nateprouty - February 24, 2009 - 17:23
Status:closed» active

#3

nateprouty - February 24, 2009 - 17:28

Obviously that description and example is wrong, forgot it would automatically convert my links...

Here's the description, again:

On the /admin/build/flags/edit/ page, if I use quotes in any of the description fields that are then added as part of the <a> tag that is generated via the flag_create_link() function, the <a> tag is output incorrectly (doesn't escape the quotes)

For example:

flag_create_link('watchlist', $nid) ---> <a class="flag flag-action flag-link-toggle flag-processed" list="" watch="" your="" to="" project="" new="" my="" title="Add the project " href="/flag/flag/watchlist/93?destination=projects&token=xx" rel="nofollow">Flag</a>

Removing the quotes fixes it:

flag_create_link('watchlist', $nid) ---> <a class="flag flag-action flag-link-toggle flag-processed" title="Add the project My New Project to your watch list" href="/flag/flag/watchlist/93?destination=projects&token=xx" rel="nofollow">Flag</a>

#4

quicksketch - February 26, 2009 - 16:44

Could you try out this patch and see if it causes any unexpected side-effects? Seems like this should do the trick.

AttachmentSize
flag_title_plain.patch 1.08 KB

#5

quicksketch - March 14, 2009 - 06:19
Status:active» fixed

I committed the above patch.

#6

System Message - March 28, 2009 - 06:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.