Re: cvs: pear /Validate/Validate ISPN.php
| From: | Helgi Þormar | Date: | Tue, 18 Oct 2005 17:42:35 +0000 |
| Subject: | Re: cvs: pear /Validate/Validate ISPN.php | ||
| References: | 1 2 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-35675@lists.php.net to get a copy of this message | ||
On Tue, 2005-10-18 at 10:41 +0200, Hannes Magnusson wrote:
>
>
> On 10/17/05, Helgi Þormar Þorbjörnsson <dufuz@php.net> wrote:
> dufuz Mon Oct 17 17:38:33 2005 EDT
>
> Modified files:
> /pear/Validate/Validate ISPN.php
> [snip]
>
>
>
> - $ismn = eregi_replace('ISMN', '', $ismn);
> - $ismn = eregi_replace('M', '3', $ismn); // change
> first M to 3
> - $ismn = str_replace(array('-', '/', ' ',
> "\t", "\n"),
> '', $ismn);
> + $ismn = strtoupper($ismn);
> + $ismn = str_replace(array('ISMN', '-', '/',
> ' ',
> "\t", "\n"), '', $ismn);
> + ///FIXME probably wrong, this catches them all, have
> to check
> + $ismn = str_replace('M', '3', $ismn); // change first
> M to 3
> [snip]
>
> Don't quite understand what this function is supposed to do. Didn't
> even find test cases for it to check the input. Anyone care to insert
> couple of words describing the logic behind?
>
> Anyhow, looking for something like this?:
> if($pos = strpos($ismn, 'M') !== false) {
> $ismn{$pos} = 3;
> }
I don't quite get what you are getting at.
if you are talking about the "FIXME" part then it's just a note to my
self to have a look, and yes there is a bit of test case for this if you
look hard enough.
This might be the solution and it might not.
- Helgi