Changeset 247 for trunk/lib/App.inc.php


Ignore:
Timestamp:
Apr 5, 2007 1:48:45 AM (17 years ago)
Author:
quinn
Message:

Converted all string functions to multi-byte (mb_*) functions

File:
1 edited

Legend:

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

    r242 r247  
    533533            'date'      => date('Y-m-d H:i:s'),
    534534            'remote ip' => getRemoteAddr(),
    535             'pid'       => (substr(PHP_OS, 0, 3) != 'WIN' ? posix_getpid() : ''),
     535            'pid'       => (mb_substr(PHP_OS, 0, 3) != 'WIN' ? posix_getpid() : ''),
    536536            'type'      => $this->logPriorityToString($priority),
    537537            'file:line' => "$file : $line",
    538             'url'       => substr(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', 0, 128),
     538            'url'       => mb_substr(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', 0, 128),
    539539            'message'   => $message
    540540        );
     
    543543        if ($this->getParam('log_file_priority') && $priority <= $this->getParam('log_file_priority')) {
    544544            $event_str = '[' . join('] [', $event) . ']';
    545             error_log(substr($event_str, 0, 1024) . "\n", 3, $this->getParam('log_directory') . '/' . $this->getParam('log_filename'));
     545            error_log(mb_substr($event_str, 0, 1024) . "\n", 3, $this->getParam('log_directory') . '/' . $this->getParam('log_filename'));
    546546        }
    547547
     
    554554                $email_msg .= sprintf("%-11s%s\n", $k, $v);
    555555            }
    556             mail($this->getParam('log_to_email_address'), $subject, $email_msg, $headers, '-f codebase@strangecode.com');
     556            mb_send_mail($this->getParam('log_to_email_address'), $subject, $email_msg, $headers, '-f codebase@strangecode.com');
    557557        }
    558558
     
    560560        if ($this->getParam('log_sms_priority') && $priority <= $this->getParam('log_sms_priority')) {
    561561            $subject = sprintf('[%s %s]', getenv('HTTP_HOST'), $priority);
    562             $sms_msg = sprintf('%s [%s:%s]', substr($event['message'], 0, 64), basename($file), $line);
     562            $sms_msg = sprintf('%s [%s:%s]', mb_substr($event['message'], 0, 64), basename($file), $line);
    563563            $headers = "From: codebase@strangecode.com";
    564             mail($this->getParam('log_to_sms_address'), $subject, $sms_msg, $headers, '-f codebase@strangecode.com');
     564            mb_send_mail($this->getParam('log_to_sms_address'), $subject, $sms_msg, $headers, '-f codebase@strangecode.com');
    565565        }
    566566
     
    669669
    670670        // Get the first delimiter that is needed in the url.
    671         $delim = strpos($url, '?') !== false ? ini_get('arg_separator.output') : '?';
     671        $delim = mb_strpos($url, '?') !== false ? ini_get('arg_separator.output') : '?';
    672672
    673673        $q = '';
Note: See TracChangeset for help on using the changeset viewer.