Download & Extend

flag_create_link generates bad HTML

Project:Flag
Version:6.x-1.0-rc1
Component:Flag core
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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>

Comments

#1

Status:active» closed (fixed)

#2

Status:closed (fixed)» active

#3

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

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

Status:active» fixed

I committed the above patch.

#6

Status:fixed» closed (fixed)

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

#7

Component:Code» Flag core

I apploed it dint work