Encoding error when updating from shortcode 7.x 2.23 to shortcode 7.x 2.25.

Previously working two column style, still creates two columns but the contents aren't encoded properly - the html is displaying.

Please see screen shots for examples of the displays before and after and resulting html.

Drupal info:
Drupal 7.56
Database system: MySQL, MariaDB, or equivalent
Database system version: 10.1.30-MariaDB

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

lorren created an issue. See original summary.

shivam.addweb’s picture

FileSize
30.21 KB
9.6 KB

This is working fine on my side. I used module version 7.x-2.25 and Drupal version 7.56. Make sure you enable all settings related to the shortcode in text format settings. config/content/formats/full_html.

PFA screenshot.

Denes.Szabo’s picture

@lorren can you give us the source you used in the textarea? I see there few unnecessary quotation marks…

Denes.Szabo’s picture

Status: Active » Postponed (maintainer needs more info)
saramato’s picture

After upgrading version 7. x-2.2 to 7. x-2.6, for example tag [item] doesn't work (the html format is configured correctly)
Drupal displays htm code instead of contents. 7.x-2.3 work correctly
I did not test other versions

joaogarin’s picture

Hello,

I have now also upgrade to the version 2.2.6 and am getting the same behaviour mentioned by @saramato. Still trying to figure out how to get it back working. Any help would be appreciated.

As far as I can tell the problem is with the [item] tag.

Can definitely confirm the behaviour describe in the issue.

I cant however go back to 2.2.3 because I am in PHP7

joaogarin’s picture

Here is a patch that fixes the issue :

Its using check_plain in $vars['text'] when in fact this often includes html.I still suspect there might be more places where it happens though

joaogarin’s picture

Status: Postponed (maintainer needs more info) » Needs review
joaogarin’s picture

Actually, I think the [item] shouldn't even do any check since it contains html inside? Unless we are actually able to know the format being used..

so it would need something like :

'text' => check_markup($text, $format'),

but I don't think at render we have access to $format? Would leave this to the maintainers.

Vali Hutchison’s picture

I had a similar issue using the video embed shortcode with some HTMl output under the video. When I moved the 'Convert URLs into links' filter in the 'Filter processing order' section to be under the Shortcodes filter then this fixed the issue. See attached screenshot of my filtering order.

  • Denes.Szabo committed dfdfea3 on 7.x-2.x authored by joaogarin
    Issue #2937183 by joaogarin, lorren, nishant.addweb, Vali Hutchison:...
Denes.Szabo’s picture

Status: Needs review » Fixed

@joaogarin You was right, the item macro can contain another HTML, the check_plain() was wrong there. THX!

The check_markup($text, $format') is the way how the ShortCode process the text, so this will filter out tags, we do not need to call it.

Denes.Szabo’s picture

Status: Fixed » Closed (fixed)