Audio Tag in HTML-Field

huggi

New member
Hi,

I was trying to display a audio Player for each row (it is a Song database) but I had no luck. Dadabik seems to ignore all tags like <audio> or <iframe>. My workaround is a klickable Link, but this opens a new tab in the browser which is a bit annoying if you want to quickly search audio Files by listening.

Why can´t I use a simple <audio> tag??

Cheers,
Michael

--------
You are using DaDaBIK version 9.2.1-Monterosso enterprise, installed on 01-22-2019 (installation code: 0), the latest version of DaDaBIK is 9.2.1-Monterosso released on 12-19-2018

You are runnning the last release of DaDaBIK

PHP Version: 7.0.31-1~dotdeb+8.1

mysql version: 5.7.24

Web server: Apache/2.4.10 (Debian)

Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15
 

eugenio

Administrator
Staff member
For security reason.
If you wan to show HTML content you should select HTML as content type in form configurator.
You can still have security risks, please read the documentation before using it.

Best,
 

huggi

New member
Of course I have used the HTML content type. Things like normal markups and Links are working. But the <audio> tag is not working. If I look at the HTML-code Dadabik produces, I can see that this tag is missing.
Is there any switch in config.php that is blocking this kind of HTML-Code for security reasons?

Cheers,
Michael
 

eugenio

Administrator
Staff member
I see; in this case, probably htmLawed (the library we use to filter dangerous tags) is blocking some of your tags:

http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/

in config.php you have a parameter $htmlawed_config that you can adjust.

Best,
 

huggi

New member
Hi Eugenio,

thanks for the hint. Still I can't get it to work.
No Matter what I set in config.php, it doesn`t seem to have any influence at all.

According to the htmlAwed Documentation the right value should be:

$htmlawed_config = array('safe'=>1, 'deny_attribute'=>'style,class', 'elements'=>'* +audio');

But even if I try:
$htmlawed_config = array('safe'=>0);
the Dadabik-page is still filtering all the <audio> tags.

If I try my code on the htmlAwed Test-Page everything is working as expected!

It seems like Dadabik ignores the settings in $htmlawed...

Thanks,
Michael
 

eugenio

Administrator
Staff member
Hello,
you are right, apparently it's a problem related to the htmlawed version used by DaDaBIK, the latest version works correctly with audio tags.

You can download the last htmlawed version and replace the file /include/htmlawed/htmLawed.php

Since we haven't officially tested this version, I can't guarantee that everything will run as expected, but I think you shouldn't have problems.

Best,
 
Top