Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #15255
| From | Jerry Stuckle <jstucklex@attglobal.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Check for a set of strings in a string - pregmatch ? if so how |
| Date | 2015-04-12 16:32 -0400 |
| Organization | A noiseless patient Spider |
| Message-ID | <mgekmb$f0m$1@dont-email.me> (permalink) |
| References | <45272146-5b3d-4a4e-9512-6f3c9bdcb588@googlegroups.com> <mgdq7s$4ra$1@solani.org> <16833927.MVFrP3vJVo@PointedEars.de> |
On 4/12/2015 12:38 PM, the pedantic troll Thomas 'Pointed Head' Lahn wrote: > Christoph M. Becker wrote: > >> Richard Townsend-Rose: >>> for years we checked against injection using >>> >>> if (eregi( "(%0D)|(%0A)|(0x0A)|(0x0D)|(MIME-Version)| >>> (Content-Type)|(Content-Transfer)|(Content-Disposition)| >>> (boundary=)|(Return-Path)", $var ) ) >>> >>> i.e. we want to know if the string 0x0D and any of the other strings >>> exist in $var. so () meant the boundary of the string, and the | >>> character divided the given strings into an array .... i think >>> >>> nowhere can i find a decent meaning of what "the word "pattern" means. >>> nor in the manual can i find anything about delimiters >> >> The introduction of the POSIX Regex extension[1] links to the regex man >> page[2] where the pattern syntax is explained. > > JFTR: The ereg* set of functions, and the ERE-supporting functions in > general, are *deprecated*. This code needs to be rewritten if it is > to work with future PHP versions. Quoth the FM: > Why do you think the OP was asking about how to do this with preg_xxx functions? Oh, I forgot - you can't understand what is written. You can only copy and paste. But you insist on showing your ignorance anyway. <snip a bunch of Pointed Head's usual crap> > > But ISTM that the approach of using regular expressions or filters in PHP to > prevent e-mail injection is wrong in the first place. Using a well-tested > mailer like PHPMailer instead of the mail() function directly, installing > and configuring the Suhosin patch, using a *current* PHP version with > stricter configuration settings, or using stricter configuration settings > for the system mailer (e.g. sendmail) are the better alternatives. Those > can be combined, of course. > You don't remember very well, do you? Can you point to where you found such a stupid statement? Not saying that PHPMailer is bad - but properly filtering the input (which can be done with regex's, among other things) also works quite well. -- ================== Remove the "x" from my email address Jerry Stuckle jstucklex@attglobal.net ==================
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Check for a set of strings in a string - pregmatch ? if so how Richard Townsend-Rose <richard.townsendrose@gmail.com> - 2015-04-12 05:19 -0700
Re: Check for a set of strings in a string - pregmatch ? if so how "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-12 14:59 +0200
Re: Check for a set of strings in a string - pregmatch ? if so how Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-04-12 18:38 +0200
Re: Check for a set of strings in a string - pregmatch ? if so how Jerry Stuckle <jstucklex@attglobal.net> - 2015-04-12 16:32 -0400
Re: Check for a set of strings in a string - pregmatch ? if so how "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-04-12 23:45 +0200
Re: Check for a set of strings in a string - pregmatch ? if so how Richard Townsend-Rose <richard.townsendrose@gmail.com> - 2015-04-12 06:21 -0700
Re: Check for a set of strings in a string - pregmatch ? if so how Richard Yates <richard@yatesguitar.com> - 2015-04-12 07:06 -0700
Re: Check for a set of strings in a string - pregmatch ? if so how Curtis Dyer <dyer85@gmail.com> - 2015-04-30 23:17 +0000
Re: Check for a set of strings in a string - pregmatch ? if so how Richard Townsend-Rose <richard.townsendrose@gmail.com> - 2015-04-12 08:28 -0700
csiph-web