Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
通过所见即所得编辑器(例如,页面模块中的页面块)将上传的图像插入文本区域时,我注意到了一个问题。更新记录后不保留插入图像上的对齐方式。
经过一些测试后,我注意到图像上的对齐是通过向 img 标签添加内联样式来完成的,例如 style='float:right',但是如果手动添加了 'align=right' 属性,则会保留此属性保存到数据库后。
因此,我的假设是 Pyro 正在从 WYSIWYG 内容中剥离内联样式。有没有办法防止这种情况?
这是因为XSS filtering已为相关模块打开。
XSS filtering
在 Pyro 数据库中有一个名为的表default_modules(如果您有不同的站点标识符,则为其他名称)。
default_modules
在该表中有一个名为 的列skip_xss。您可以将其设置1为允许给定模块的表单输入中的内联样式(以及其他一些具有潜在危险的内容)。
skip_xss
1
如果您正在制作自定义模块,则可以在文件中添加skip_xss => 1以关闭。$infodetails.phpXSS filtering
skip_xss => 1
$info
details.php