Tabs title with utf8 characters
Hello,
I used Bootstrap 3 shortcodes Drupal port for a project, where I implemented Bootstrap Tabs. There seems to be a bug when using UTF-8 characters in the tabs title. I used greek and the output was broken, and so was the functionality. This is because, when building the unordered list with the tags, PHP does not parse the html string as utf-8, so the href attributes get broken.
The problem lies in bs_shortcodes.module @ line 1144
loadHTML($content); ?>The $content variable contains a string of html-text, but as this is not a complete HTML document, there are no meta data to instruct the parser about the encoding.
As it is mentioned in the official documentation: http://php.net/manual/en/domdocument.loadhtml.php there can be two solutions for the problem:
- Replace line 1144 with:
- Replace line 1144 with:
I tried both of them and they both seem to work. I'm not really sure which is the most correct.
I will created two patches, one for each solution, and posted them to the modules issue queue: https://www.drupal.org/node/2458569
Steps to reproduce:
- Install a bootstrap 3 subtheme.
- Install bs_shortcodes module (shortcode module is a dependency).
- Enable Shortcodes filter in FULL HTML text format, and in the filter settings below check "Enable tab shortcode" and "Enable tabs shortcode" options.
- Create a node and include this text in body:
[tabs type="tabs"] [tab title="Αρχική" active="true"] Δοκιμαστικό κείμενο 1[/tab] [tab title="Προφίλ"] Δοκιμαστικό κείμενο 2[/tab] [tab title="Σχετικά"] Δοκιμαστικό κείμενο 3[/tab] [/tabs]
Thank you for this report. Unfortunately we don't maintain the Drupal port of this plugin. You may want to talk to @jjroelofs about implementing your proposed fix in the port.
We've already fixed this issue in the WordPress plugin (see here: https://github.com/filipstefansson/bootstrap-3-shortcodes/blob/master/bootstrap-shortcodes.php#L1991).