From fca7325990a1f3beb1a7ac7cdca1a2c2116381fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rancoud?= Date: Tue, 1 Apr 2025 00:35:52 +0200 Subject: [PATCH 1/4] chore: add better doc --- README.md | 97 +++++++++++++++++++++++++++++++++--------------- src/Security.php | 50 +++++++++++++++++++++++-- 2 files changed, 114 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 153247f..cdd4b2c 100644 --- a/README.md +++ b/README.md @@ -16,51 +16,88 @@ composer require rancoud/security ## How to use it? ```php -Security::escAttr('string'); +use Rancoud\Security\Security; -Security::escHTML('string'); +// When you want to escape string for HTML output. +echo '

' . Security::escHTML('') . '

'; +// ->

<script>alert("test");</script>

-Security::escJS('string'); +// When you want to escape string for HTML attribute output. +echo '