2017 © Pedro Peláez
 

library sanitiser

A simple email sanitiser to clean up common input errors

image

actinity/sanitiser

A simple email sanitiser to clean up common input errors

  • Tuesday, December 12, 2017
  • by actinity
  • Repository
  • 1 Watchers
  • 0 Stars
  • 126 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 47 % Grown

The README.md

A simple class to fix common input errors in Email addresses., (*1)

This library takes a string and tries to turn it into a 'clean' email address without any extraneous junk that would cause it to fail., (*2)

Why would I use it?

This library was written to simplify importing email addresses from files and other systems where proper sanitisation hadn't previously been applied. Lists of users to add to a system supplied in Excel, email addresses collected from conferences etc. The intention is to be 'good enough' to fix 99% of the common errors you see in that kind of data, leaving you free to only look at the ones that definitely failed., (*3)

What does it do?

Catch and 'fix' a variety of common issues like:, (*4)

  • Trailing semi-colons, commas etc
  • Leading or trailing whitespace (including zero-widths)
  • Addresses wrapped in quotes or primes
  • Addresses wrapped in angle brackets (discarding anything else like a name)
  • Rejects obviously broken addresses like test, test@, test@. etc.

What it doesn't do

  • Verify that the email address/domain/mail server exists or will work, obviously. The only way to test an email address is to actually send to it. Anyone who tells you otherwise is selling something.
  • Work for every possible RFC compliant email - there are plenty of things you're technically allowed to do that you're not going to come across in the real world. e.g. me@localhost
  • Guarantee that it matches the user's intent (e.g. if there were multiple email addresses listed, it will only pick the first one. Is that correct? ¯\_(ツ)_/¯)

How to use it.

use Actinity\Sanitiser\Sanitiser;, (*5)

$address = Sanitiser::clean($address), (*6)

clean() returns either a clean address, or false if it looks hopelessly broken., (*7)

The Versions

12/12 2017

dev-master

9999999-dev

A simple email sanitiser to clean up common input errors

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Kieran Ashley

12/12 2017

1.0.3

1.0.3.0

A simple email sanitiser to clean up common input errors

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Kieran Ashley

12/12 2017

1.0.2

1.0.2.0

A simple email sanitiser to clean up common input errors

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Kieran Ashley

06/08 2017

1.0.1

1.0.1.0

A simple email sanitiser to clean up common input errors

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Kieran Ashley

05/08 2017

1.0.0

1.0.0.0

A simple email sanitiser to clean up common input errors

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

by Kieran Ashley