Allow html not work

Hi @asmecher ,

I am using OJS version 3.1.2 and the html tags that I am putting in the announsments, the announsments page are not reflected. I already have the allowed_html variable set in the config.inc.php file, with all the tags I need What else could it be.

Hi @diegomejia07,

Are you using the Default theme? Are you referring to the Announcement Description, Short Description or another field?

Hello @Vitaliy ,

If I am using the default theme and I mean the description.

@diegomejia07,

Do you have access to the files of your OJS instance? Can you confirm that in the correspondent template you have this line: pkp-lib/announcement_full.tpl at 5fbfa71d5c31d9d9231ea76f5beaa57b15fdd2f0 · pkp/pkp-lib · GitHub?
The path to the file is: lib/pkp/templates/frontend/objects/announcement_full.tpl
What I want to confirm is that the announcement description is escaped with strip_unsafe_html.

Hi @Vitaliy ,
check that the file is normal.

image

Hmm, I can’t reproduce it in OJS 3.1.2. I’ve added div[class] to the allowed html, then entered into the announcement description

<div class="custom">
  Content Here
</div>

And it works as expected, leaving tags intact. What element are you trying to add?

Hi, @Vitaliy
For example

Para conocer en detalle nuestro proceso editorial ingrese al Informe de gestión editorial de Estudios de Literatura Colombiana.

Not recognized tag in html in the announsment.

image

But, not view here

image

allowed_html = “a[href|target|title],em,strong,cite,code,ul,ol,li[class],dl,dt,dd,b,i,u,img[src|alt],sup,sub,br,p”

Did the curly-quotes come in from an intermediate copy-and-paste, or do these appear in config.inc.php? If you have styleized quotes like “ and ” in config.inc.php, try swapping them out for plain double quotes, like " ".

Hi @Vitaliy and @ctgraham ,

I already checked the quotes and arranged them but the problem still.
y asi:

image

and so I see when inspecting the page, which does not recognize the labels

Hi @Vitaliy and @ctgraham,

The code inserted it like this in the text editor:

image

This is how it looks when I save it and show the tag link well:

image

But that’s how it looks on the announcement page and it doesn’t show me the link of tag:

image

I need to activate something else on the server or what do I need to do to make this work.

Regards…

Hmm, all the tags are filtered out. Is there anything relevant in PHP error log?

Hi @Vitaliy and @ctgraham,

No, in the PHP error logs, there is nothing relevant, there are only cosmetic messages, but nothing to do with this topic.

What else could it be or where else could it check.

Thank you.

Hi @Vitaliy and @ctgraham,

Who of you can really help me with this, since I have enough problems for this and my platform is already in production.

@diegomejia07, are you comfortable debugging the PHP code? I think the next step would be to copy your site into a test/development server and then either connect a remote debugger, or add some error_log PHP statements to try to see what is going on.

Hi @Vitaliy and @ctgraham,

This is the only thing that shows:

[Mon Apr 13 16:36:05.430010 2020] [php7:warn] [pid 13718] [client 66.249.79.201:64004] PHP Warning: Declaration of AddThisPlugin::register($category, $path) should be compatible with LazyLoadPlugin::register($category, $path, $mainContextId = NULL) in /var/www/html/site.revistas.udea.edu.co/plugins/generic/addThis/AddThisPlugin.inc.php on line 0, referer: https://revistas.udea.edu.co/plugins/generic/pdfJsViewer/pdf.js/build/pdf.worker.js
[Mon Apr 13 16:36:05.452794 2020] [php7:warn] [pid 13659] [client 190.250.175.166:15531] PHP Warning: Declaration of DRIVERDAO::setOAI(&$oai) should be compatible with PKPOAIDAO::setOAI($oai) in /var/www/html/site.revistas.udea.edu.co/plugins/generic/driver/DRIVERDAO.inc.php on line 19, referer: Revista Interamericana de Bibliotecología

Hi @Vitaliy and @ctgraham,

Or is it that I am missing some extension on my server or something else, since it is very strange that this happens, and also I think I have everything well configured.

The INSTALL file suggests that HTMLPurifier is pure PHP, with no library dependencies, so it shouldn’t be a module issue.

If you are comfortable editing the PHP code, you could add an error_log() statement to the PKPString::stripUnsafeHtml() method to debug what is going on.