Index: trunk/lib/App.inc.php
===================================================================
--- trunk/lib/App.inc.php	(revision 474)
+++ trunk/lib/App.inc.php	(revision 475)
@@ -311,9 +311,4 @@
          */
 
-        // Skip session for some user agents.
-        if (preg_match('/Atomz|ApacheBench|Wget/i', getenv('HTTP_USER_AGENT'))) {
-            $this->setParam(array('enable_session' => false));
-        }
-
         // Skip sessions if disabled or automatically skip if run in a CLI script.
         if (true === $this->getParam('enable_session') && !defined('_CLI')) {
@@ -657,11 +652,15 @@
             'type'      => $this->logPriorityToString($priority),
             'file:line' => "$file : $line",
-            'url'       => mb_substr(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', 0, 128),
+            'url'       => mb_substr(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', 0, 1024),
             'message'   => $message
         );
+        // Here's a shortened version of event data.
+        $event_short = $event;
+        $event_short['url'] = truncate($event_short['url'], 120);
+
 
         // FILE ACTION
         if (false !== $this->getParam('log_file_priority') && $priority <= $this->getParam('log_file_priority')) {
-            $event_str = '[' . join('] [', $event) . ']';
+            $event_str = '[' . join('] [', $event_short) . ']';
             error_log(mb_substr($event_str, 0, 1024) . "\n", 3, $this->getParam('log_directory') . '/' . $this->getParam('log_filename'));
         }
@@ -683,5 +682,5 @@
             $hostname = (isset($_SERVER['HTTP_HOST']) && '' != $_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : php_uname('n');
             $subject = sprintf('[%s %s]', $hostname, $priority);
-            $sms_msg = sprintf('%s [%s:%s]', mb_substr($event['message'], 0, 64), basename($file), $line);
+            $sms_msg = sprintf('%s [%s:%s]', mb_substr($event_short['message'], 0, 64), basename($file), $line);
             $headers = 'From: ' . $this->getParam('site_email');
             mb_send_mail($this->getParam('log_to_sms_address'), $subject, $sms_msg, $headers);
@@ -695,4 +694,6 @@
         // Restore original locale.
         setlocale(LC_TIME, $locale);
+
+        unset($event, $event_short);
 
         return true;
Index: trunk/lib/Navigation.inc.php
===================================================================
--- trunk/lib/Navigation.inc.php	(revision 474)
+++ trunk/lib/Navigation.inc.php	(revision 475)
@@ -268,22 +268,34 @@
 
     /**
-     * Returns a string if the queried page is the current page. One use is to print
-     * CSS tags if the current page matches a link, such as:
-     * $nav->currentPage('mypage.php', ' id="current"');
-     *
-     * @access  public
-     *
-     * @param   mixed   $page   The URI of the page to query, with PREG express markup, if needed.
-     * @param   mixed   $return The value to return if the current page matches the page queried.
-     *
-     * @return  mixed   The value set for $return, TRUE by default.
-     */
-    public function currentPage($test_uri, $true_return=true, $false_return=false, $strip_query=false)
-    {
-        $actual_uri = $strip_query ? strtok($_SERVER['REQUEST_URI'], '?') : $_SERVER['REQUEST_URI'];
-        $test_uri = $strip_query ? strtok($test_uri, '?') : $test_uri;
-        if (preg_match('/^' . preg_quote(urldecode($test_uri), '/') . '$/i', $actual_uri)) {
+     * Test if the given URI matches the URL of the current page. By default the URI is tested
+     * without concern
+     * One use is to change the returned value for a positive match
+     * so a css class prints for an element representing the current page:
+     *   echo $nav->currentPage('/script.php?op=info', ' class="current"', '', true);
+     * The above will match only if the current page (REQUEST_URI) is also '/script.php?op=info',
+     * and will return the string ' class="current"' if it is.
+     *
+     * @access  public
+     *
+     * @param   string  $test_uri       A URI to test against the current page.
+     * @param   mixed   $true_return    The value to return if the current page matches the test URI.
+     * @param   mixed   $false_return   The value to return if the current page does not match the test URI.
+     * @param   bool    $include_query  If set true, include the URI query string in the test.
+     *
+     * @return  mixed   If the test URI matches the current page URI, the value given for $true_return
+     *                  is returned (true by default), otherwise the value given for $false_return is
+     *                  returned (false by default).
+     */
+    public function currentPage($test_uri, $true_return=true, $false_return=false, $include_query=false)
+    {
+        $app =& App::getInstance();
+
+        $actual_uri = $include_query ? $_SERVER['REQUEST_URI'] : strtok($_SERVER['REQUEST_URI'], '?');
+        $test_uri = $include_query ? $test_uri : strtok($test_uri, '?');
+        if (mb_strtolower($test_uri) == mb_strtolower($actual_uri)) {
+            // $app->logMsg(sprintf('Current page (%s) == test URI (%s)', $actual_uri, $test_uri), LOG_DEBUG, __FILE__, __LINE__);
             return $true_return;
         }
+        // $app->logMsg(sprintf('Current page (%s) != test URI (%s)', $actual_uri, $test_uri), LOG_DEBUG, __FILE__, __LINE__);
         return $false_return;
     }
