Changeset 357


Ignore:
Timestamp:
Jun 14, 2009 10:36:48 AM (15 years ago)
Author:
quinn
Message:

updated tests to work. updated email validation regex to include quote marks around name part. changed logmsg tmp dir name to use script_filename.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r348 r357  
    107107
    108108        // Don't email or sms duplicate messages that happen more often than this value (in seconds).
    109         'log_multiple_timeout' => 60,
     109        'log_multiple_timeout' => 61,
    110110
    111111        // Logging priority can be any of the following, or false to deactivate:
     
    556556
    557557        // Create tmp files so that we don't email and sms redundantly.
    558         $site_hash = md5(SITE_BASE);
     558        $site_hash = md5($_SERVER['SCRIPT_NAME']);
    559559        $temp_dir = $this->getParam('tmp_dir') . "/codebase_msgs_$site_hash/";
    560560        $temp_file = $temp_dir . $msg_id;
     
    567567            // Has this message been sent more recently than the timeout?
    568568            if ((time() - $msg_last_sent) < $this->getParam('log_multiple_timeout')) {
    569                 // This message was alreay sent recently
     569                // This message was already sent recently.
    570570                $send_notifications = false;
    571571            } else {
    572                 // Timeout has expired go ahead and send notifications again
     572                // Timeout has expired go ahead and send notifications again.
    573573                unlink($temp_file);
    574574            }
     
    597597        // NOTIFY SOMEONE
    598598        if ($send_notifications) {
    599 
    600599            // EMAIL ACTION
    601600            if ($this->getParam('log_email_priority') && $priority <= $this->getParam('log_email_priority')) {
  • trunk/lib/Email.inc.php

    r347 r357  
    6969    {
    7070        // The regex used in validEmail(). Set here instead of in the default _params above so we can use the concatenation . dot.
    71         // This matches an email address as complex as:
    72         //      Bob John-Smith <bob&smith's/dep=sales!@smith-wick.ca.us> (Sales department)
     71        // This matches a (valid) email address as complex as:
     72        //      "Jane & Bob Smith" <bob&smith's/dep=sales!@smith-wick.ca.us> (Sales department)
    7373        // ...and something as simple as:
    7474        //      x@x.com
    75         $this->setParam(array('regex' => '/^(?:[^,@]*(<)|[^,@]*\s+|)'   // Display name
    76         . '((?:[^.<>\s@",\[\]]+[^<>\s@",\[\]])*[^.<>\s@",\[\]]+)'    // Local-part
     75        $this->setParam(array('regex' => '/^(?:(?:"[^"]*?"\s*|[^,@]*)(<)|(?:"[^"]*?"|[^,@]*)\s+|)'   // Display name
     76        . '((?:[^.<>\s@",\[\]]+[^<>\s@",\[\]])*[^.<>\s@",\[\]]+)'       // Local-part
    7777        . '@'                                                           // @
    7878        . '((?:(\[)|[A-Z0-9]?)'                                         // Domain, first char
  • trunk/tests/Auth_SQLTest.php

    r154 r357  
    4444                first_name,
    4545                last_name,
    46                 email,
    47                 user_type
     46                email
    4847            ) VALUES (
    4948                'testuser',
     
    5150                'John',
    5251                'Doe',
    53                 'root@localhost',
    54                 'admin'
     52                'root@localhost'
    5553            )
    5654        ");
  • trunk/tests/LockTest.php

    r137 r357  
    4646                first_name,
    4747                last_name,
    48                 email,
    49                 user_type
     48                email
    5049            ) VALUES (
    5150                'testuser',
     
    5352                'John',
    5453                'Doe',
    55                 'john@example.com',
    56                 'admin'
     54                'john@example.com'
    5755            )
    5856        ");
  • trunk/tests/VersionTest.php

    r137 r357  
    4646                first_name,
    4747                last_name,
    48                 email,
    49                 user_type
     48                email
    5049            ) VALUES (
    5150                'testuser',
     
    5352                'John',
    5453                'Doe',
    55                 'john@example.com',
    56                 'admin'
     54                'john@example.com'
    5755            )
    5856        ");
  • trunk/tests/run_tests.sh

    r53 r357  
    77for foo in *Test.php;
    88do
    9     /usr/local/bin/php $foo;
     9    php $foo;
    1010done;
Note: See TracChangeset for help on using the changeset viewer.