Changeset 657 for trunk/lib/DB.inc.php


Ignore:
Timestamp:
Jan 26, 2019 4:36:27 AM (5 years ago)
Author:
anonymous
Message:

Update timezone test regex to support edge cases

File:
1 edited

Legend:

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

    r654 r657  
    204204        $tz = date_default_timezone_get();
    205205        // Check that PHP is configured with a valid timezone name, e.g., "UTC" or "America/Chicago".
    206         if ($app->getParam('timezone') && $app->getParam('timezone') == $tz && preg_match('![A-Z]{3,}|\w+/\w+!', $tz)) {
     206        if ($app->getParam('timezone') && $app->getParam('timezone') == $tz && preg_match('!^([A-Z_/-]{3,}|[-\d:]+)$!/i' '/[A-Z_\+-]{3,}|[-\d:]+/i', $tz)) {
    207207            $this->query(sprintf("SET SESSION time_zone = '%s'", $tz));
    208208        }
Note: See TracChangeset for help on using the changeset viewer.