PHP security. Now in Perl 6.
Latest commit 7959e7d Nov 2, 2016 @xfix committed on GitHub Merge pull request #3 from paultcochrane/pr/add-travis-config
Add Travis-CI configuration
Failed to load latest commit information.
lib/Acme Add unit declarator to module declaration May 20, 2015
logotype Make logotype look even cooler on Jun 8, 2012
.gitattributes Just leave default text=auto case May 20, 2014
.travis.yml Add Travis-CI configuration Oct 21, 2016 Use proper copyright symbol. Apr 3, 2014 Add mandatory "perl" META field Oct 26, 2016 Update the address. May 30, 2014

Acme::Addslashes - Perl 6 port of Perl 5 version of Acme::Addslashes which is "port" of PHP addslashes() function. Or something.


use Acme::Addslashes;

my $unsafe_string  = "Robert'); DROP TABLE Students;--";

my $totally_safe_string = addslashes($unsafe_string);

# $totally_safe_string now contains:
# R̸o̸b̸e̸r̸t̸'̸)̸;̸ ̸D̸R̸O̸P̸ ̸T̸A̸B̸L̸E̸ ̸S̸t̸u̸d̸e̸n̸t̸s̸;̸-̸-̸

# If that's not enough slashes to be safe, then I don't know what is



The only function exported by this module. Will literally add slashes to anything. Letters, numbers, punctuation, whitespace, unicode symbols. You name it, this function can add a slash to it.


Original function was written by James Aitken, this port was done by Konrad Borowski Ok, it's not really a port as logic wasn't copied. But you can call it a port if you want.