Similarly to #2201703: Strip HTML in hook_node_operations(), flag labels with HTML in them display raw HTML when used in a confirm form button. The forthcoming patch passes the label through strip_tags().

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhedstrom’s picture

Status: Active » Needs review
FileSize
625 bytes

And the patch.

joachim’s picture

Looks like the right thing to do.

I was thinking it would be nice to have tests for this, and I tried changing FlagLinkTypeConfirmTestCase to have some HTML in its flag link text, but I can't figure out how assertLink() is meant to work when the link text contains HTML. Neither including it in the parameter nor stripping it seems to work!!

joachim’s picture

Figured it out -- well a workaround at least.

Here's two patches: one is just the changes to tests, and should fail. The other adds in the changes from patch #1.

The last submitted patch, 3: 2255199.flag_.flag-confirm-form-strip-tags-tests-only.patch, failed testing.

joachim’s picture

Status: Needs review » Fixed

Perfect.

Committing.

Thanks for reporting & fixing!

  • Commit 7afd35d on 7.x-3.x by joachim:
    Issue #2255199 by jhedstrom, joachim: Fixed button in flagging confirm...

Status: Fixed » Closed (fixed)

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