Edge case: Embedding a block which returns a string like, "$80K was spent on building widgets."
Result: The block will be embedded but the string will say, "K was spent on building widgets."

Problem:
_embeddable_replace() embeds the content string as one of the replacement patterns in a complex preg_replace(), if you use regex-like strings in that rendered content, preg_replace treats it that way. In this particular example, $80 would be trying to look for the 80th match, which doesn't exist.

Proposed solution: Replace any $ in the embedded content with its html entity. This may need to be refactored to account for any other regex-like syntax that could end up unintentionally in the embedded content.

CommentFileSizeAuthor
#1 1630522-1-escape-dollar-sign.patch680 bytesbmcmurray
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bmcmurray’s picture

Attached is a patch which implements my proposed solution.

wranvaud’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)
Related issues: +#1920318: Dollar sign ($) and following numbers getting cut off