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

Resolve the problem that phpcms does not support iframe

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces how to solve the problem that phpcms does not support iframe. It has certain reference value and can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

What if phpcms does not support iframe?

There are a lot of ways to try to solve the problem that the tags iframe and JavaScript are filtered under phpcms's content editor, but they can't get what you want.

And then over the next few days. I went through the function files in phpcms\ libs\ functions\ global.func.php and finally found the problem.

It was found that the function trim_script () on line 149 redefined the label, so it was commented out.

Function trim_script ($str) {if (is_array ($str)) {foreach ($str as $key = > $val) {$str [$key] = trim_script ($val);}} else {$str = preg_replace ('/\] *?)\ > / si',', $str); $str = preg_replace ('/\] *)\ > / si',', $str); $str = preg_replace ('/\] *)\ > / si','', $str) $str = str_replace ('javascript:',' javascript:', $str);} return $str;}

Modify to

Function trim_script ($str) {if (is_array ($str)) {foreach ($str as $key = > $val) {$str [$key] = trim_script ($val);}} else {/ / $str = preg_replace ('/\] *?)\ > / si',', $str); / / $str = preg_replace ('/\] *)\ > / si',', $str); / / $str = preg_replace ('/\] *?)\ > / si',', $str) $str = str_replace ('javascript:',' javascript:', $str);} return $str;}

Then insert iframe or JavaScript into the content editor. Is it possible to insert successfully?

Thank you for reading this article carefully. I hope it is helpful for everyone to share the content of solving the problem that phpcms does not support iframe. At the same time, I also hope that you will support it, pay attention to the industry information channel, and find out if you encounter problems. Detailed solutions are waiting for you to learn!

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

Servers

Wechat

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

12
Report