From 16c13fd25ab83673d54432d94349226114b216f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=99=9A=20PH=E2=91=A6=20de=20Soria=E2=84=A2=E2=99=9B?= Date: Sun, 1 Dec 2024 18:46:41 +1100 Subject: [PATCH] Fix typos in example snippets --- README.md | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d4fc43c..ae1ee16 100644 --- a/README.md +++ b/README.md @@ -29,37 +29,34 @@ if (Ban::isUsername('admin')) { } if (Ban::isEmail('james@spamhole.com')) { - echo '"@spamhole.com" domain is considered as a email spam host.'; + echo '"@spamhole.com" domain is considered a spam email host.'; } if (Ban::isWord('He is an asshole')) { echo 'Please watch your mouth :-)'; } -if(Ban::isIp('1.170.36.229')) { +if (Ban::isIp('1.170.36.229')) { echo 'This IP address is blacklisted'; } -$userinput = 'admin'; -if (Ban::isUsername($userinput, ['root', 'sudo', 'admin'])) { - echo "$userinput is not allowed"; +$userInput = 'admin'; +if (Ban::isUsername($userInput, ['root', 'sudo', 'admin'])) { + echo "$userInput is not allowed"; } -// Validate of the userinput is a banned word _OR_ a banned username -if (Ban::isAny($userinput, email: false, word: true, username: true)) { - echo "$userinput is not allowed"; +// Validate if the userInput is a banned word *OR* a banned username +if (Ban::isAny($userInput, email: false, word: true, username: true)) { + echo "$userInput is not allowed"; } ``` ### Extending Banned Phrases - -You can supply your own values to be merged with the out-of-box banned-data 2 ways - +You can supply your own values to be merged with the out-of-box banned data in 2 ways: 1. `Ban::merge(string $scope, string | array $value)` 2. `Ban::mergeFile(string $scope, string $path)` `$scope` refers to the category of data. Possible values are currently: - - usernames - words - ips @@ -76,10 +73,9 @@ Ban::mergeFile('emails', './my_banned_emails.txt'); ``` +Now simply validate per normal conventions. -Now simply validate per normal conventions - ## 🚀 Author **[Pierre-Henry Soria][author-url]**, a highly passionate, zen & cool software engineer 😊 @@ -88,10 +84,11 @@ Now simply validate per normal conventions [![Pierre-Henry Soria](https://avatars0.githubusercontent.com/u/1325411?s=220)](https://pierrehenry.be "Pierre-Henry - Software Developer Website :-)") -## 👩🏻‍💻 Helpers +### 👩🏻‍💻 Helpers **[soulshined](https://github.com/soulshined)** - just a coder + ## 🧐 Used By... **[pH7Builder][ph7cms-url]**, a social dating webapp builder. Used here: [https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/framework/Security/Ban/Ban.class.php](https://github.com/pH7Software/pH7-Social-Dating-CMS/blob/master/_protected/framework/Security/Ban/Ban.class.php).