hirasso/html-obfuscator 问题修复 & 功能扩展

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

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

hirasso/html-obfuscator

Composer 安装命令:

composer require hirasso/html-obfuscator

包简介

Obfuscate emails and phone numbers in HTML using modern web technology

README 文档

README

Latest Version on Packagist Test Status Code Coverage

Obfuscate emails and phone numbers in HTML using modern web technology

Why

You might think that obfuscation won't work on spam bots. Turns out it does if done right!

How it works

On the server, PHP finds emails and phone numbers in the HTML, XOR-encodes them with a key derived from a passphrase (MD5 of a shuffled version of it), base64-encodes the result, and replaces the original text with a custom HTML element:

<html-obfuscator-obfuscated value="..." key="..."></html-obfuscator-obfuscated>

In the browser, a Web Component registered under that tag name picks up each element on connectedCallback, reverses the XOR encoding, and swaps itself out with the decoded content. Spam bots crawling the raw HTML never see the actual email or phone number.

Features

  • Fluent API
  • Fully compatible with HTML5
  • All mutations are lazily queued and processed in one go
  • Extensively tested

Installation

# requires PHP >= 8.4
composer require hirasso/html-obfuscator

Minimal Example

use Hirasso\HTMLObfuscator\HTMLObfuscator;

echo HTMLObfuscator::createFromString($html)->render();

Maximal Example

use Hirasso\HTMLObfuscator\HTMLObfuscator;

echo HTMLObfuscator::createFromString($html)
    ->phoneNumbers(false)
    ->passphrase('nobody will guess this!')
    ->render();

→ Browse the tests folder for more usage examples.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固