More information about the Underscore mailing list

[_] actually not regex, php help needed...

Craig Francis craig at craigfrancis.co.uk
Thu Mar 20 16:54:19 GMT 2008

Welcome to the world of objects... designed to make your life easier,  
but ultimately adds complications.

/me puts on flame proof suit and runs.

And for anyone ready to attack... I hate procedural just as much as  
object orientated... they both have advantages and disadvantages, and  
neither come out on top on the average project.

Anyway, without seeing the whole code, and tracing the execution, I  
have no idea why one method is being called twice... it could possibly  
be:

- If the class sends emails, its possible that you are sending an  
array of addresses for the data to be sent to (also check cc, bcc,  
etc), where the array has an empty element... or is a string which is  
split by some delimiter (like a comma).

- If the class builds a form, and handles the fields, then you might  
want to check if there are two or more email fields.

- There could be a bug in the class.

So good luck... I can heavily recommend the print_r() and exit() calls.

Craig








On 20 Mar 2008, at 16:10, s'unya wrote:

> Hey,
> On 20/03/2008, Craig Francis <craig at craigfrancis.co.uk> wrote:
>>
>> Looks like the code is being run twice?
>>
>> I suspect that its something outside what you have posted here.
>>
>> This snippet is from a class method to check email addresses,  
>> starting
> with this simple check to see that there are expected numbers of  
> characters.
> As far as I can work out it is only being called once, but you are  
> right it
> appears to be running twice. The first time behaving as expected,  
> the second
> being called without email and therefore returning false.
>
> Any ideas what might cause this?
>
>                      o
>            o                 o
>                O   O   O
>      o  0   O s´unya O   0  o
>        www.the-resort.com
> -- 
> underscore_ list info/archive -> http://www.under-score.org.uk/mailman/listinfo/underscore