ardabeyazoglu/htmlpurifierx 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ardabeyazoglu/htmlpurifierx

Composer 安装命令:

composer require ardabeyazoglu/htmlpurifierx

包简介

A shim around original HTMLPurifier library to allow more customizations

README 文档

README

HTMLPurifierX is a small wrapper around original ezyang/htmlpurifier library, providing a few more customization options. It is also compatible with xemlock/htmlpurifier-html5.

It extends configuration options to allow following features that can't be accomplished otherwise, because htmlpurifier follows a design principle based on whitelisting single elements and attributes.

  • Allow all data-* attributes on elements, since they are harmless and used very often.

      $configObject->set("HTML.AllowDataAttributes", true);
    
  • Allow namespaced attributes like "xxx:yyyyyy" on elements, since they are used in modern frameworks.

      $configObject->set("HTML.AllowNamespacedAttributes", true);
    
  • Allow all custom element names that satisy a regex, since they are widely used in web components and modern frameworks. A common use case would be to allow all elements with a user defined prefix.

      $configObject->set("HTML.AllowCustomElements", true);
      // default "": means allow all custom elements.
      $configObject->set("HTML.AllowCustomElementsRegex", "/^x-/");
    

Check examples to see how it works.

Installation

composer require ardabeyazoglu/htmlpurifierx

This will also install original ezyang/htmlpurifier library if not already installed.

Why not fork ?

The customizations made here might be against the design principles of original library. It is easier and faster to provide them as an extra layer.

License

LGPL (same as the original library)

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1-or-later
  • 更新时间: 2021-07-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固