Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use htmlPurifier not to translate & into & amp in filtering input

2025-02-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article shows you how to use htmlPurifier in filtering input, do not translate & into &, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Using htmlPurifier to filter input, can you escape & into &

Today, the operation students said that some garbled codes appeared in the background title, such as & and so on. I took a look at it because the third-party package htmlpurifier was used in the project, and the initial guess is that this package has made some escapes. After searching the Internet, I didn't find it. I only found someone discussing the issue in its official forum:

Https://stackoverflow.com/questions/40463606/html-purifier-convert-amp

Http://htmlpurifier.org/phorum/read.php?3,4655

Http://htmlpurifier.org/phorum/read.php?3,7120,7120

Want to store the native & not & read the following answer: basically, this is not recommended. So I added a php function htmlspecialchars_decode in the final display to directly return &.

Add a link: HTML character entity (Character Entities), escape string (Escape Sequence)

Http://114.xixik.com/character/

On how to use htmlPurifier in the filter input do not escape & into & to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report