- Timestamp:
- Oct 30, 2020 11:44:05 PM (4 years ago)
- Location:
- trunk/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r734 r735 962 962 } 963 963 964 // Make sure to log in the system's locale.964 // Use the system's locale for log messages (return to previous setting below). 965 965 $locale = setlocale(LC_TIME, 0); 966 966 setlocale(LC_TIME, 'C'); 967 968 // Logs should always be in UTC (return to previous setting below). 969 $tz = date_default_timezone_get(); 970 date_default_timezone_set('UTC'); 967 971 968 972 // Data to be stored for a log event. … … 1017 1021 // Restore original locale. 1018 1022 setlocale(LC_TIME, $locale); 1023 1024 // Restore original timezone. 1025 date_default_timezone_set($tz); 1019 1026 1020 1027 return true; -
trunk/lib/Auth_SQL.inc.php
r706 r735 728 728 // Only raise message if last session is less than 12 hours old. 729 729 // Notify user why they were logged out if they haven't yet been given a reason. 730 $user_notified || $app->raiseMsg(sprintf(_("For your security we logged you out after being idle for %s. Please log in again."), humanTime($this->_params['idle_timeout'], 'hour', '%01.0f')), MSG_NOTICE, __FILE__, __LINE__);730 $user_notified || $app->raiseMsg(sprintf(_("For your security, we logged you out after being idle for %s. Please log in again."), humanTime($this->_params['idle_timeout'], 'hour', '%01.0f')), MSG_NOTICE, __FILE__, __LINE__); 731 731 $user_notified = true; 732 732 } … … 740 740 $expire_reasons[] = sprintf('remote_ip not matched (%s != %s)', $_SESSION['_auth_sql'][$this->_ns]['remote_ip'], getRemoteAddr()); 741 741 // Notify user why they were logged out if they haven't yet been given a reason. 742 $user_notified || $app->raiseMsg(sprintf(_("For your security we logged you out because your IP address has changed. Please log in again."), null), MSG_NOTICE, __FILE__, __LINE__);742 $user_notified || $app->raiseMsg(sprintf(_("For your security, we logged you out because your IP address changed. Please log in again."), null), MSG_NOTICE, __FILE__, __LINE__); 743 743 $user_notified = true; 744 744 } else { -
trunk/lib/Email.inc.php
r724 r735 112 112 . '((?:[^.<>\s@",\[\]]+[^<>\s@",\[\]])*[^.<>\s@",\[\]]+)' // Local-part 113 113 . '@' // @ 114 . '((?:(\[)|[ A-Z0-9]?)' // Domain, first char114 . '((?:(\[)|[a-z0-9]?)' // Domain, first char 115 115 . '(?(4)' // Domain conditional for if first domain char is [ 116 116 . '(?:[0-9]{1,3}\.){3}[0-9]{1,3}\]' // TRUE, matches IP address 117 117 . '|' 118 . '[.-]?(?:[ A-Z0-9]+[-.])*(?:[A-Z0-9]+\.)+[A-Z]{2,6}))'// FALSE, matches domain name118 . '[.-]?(?:[a-z0-9]+[-.])*(?:[a-z0-9]+\.)+[a-z]{2,19}))' // FALSE, matches domain name 119 119 . '(?(1)' // Comment conditional for if initial < exists 120 120 . '(?:\s*>\s*|>\s+\([^,@]+\)\s*)' // TRUE, ensure ending > … … 398 398 $envelope_sender_address = sprintf('<%s>', trim($this->_params['envelope_sender_address'], '<>')); 399 399 } else { 400 $envelope_sender_address = preg_replace('/^.*<?([^\s@\[\]<>()]+\@[A-Za-z0-9.-]{1,}\.[A-Za-z]{2, 5})>?$/iU' . $app->getParam('preg_u'), '$1', $this->_params['from']);400 $envelope_sender_address = preg_replace('/^.*<?([^\s@\[\]<>()]+\@[A-Za-z0-9.-]{1,}\.[A-Za-z]{2,19})>?$/iU' . $app->getParam('preg_u'), '$1', $this->_params['from']); 401 401 } 402 402 if ('' != $envelope_sender_address && $this->validEmail($envelope_sender_address)) { -
trunk/lib/Utilities.inc.php
r729 r735 1519 1519 * @since 02 May 2015 15:10:09 1520 1520 */ 1521 function httpExists($url )1521 function httpExists($url, $timeout=5) 1522 1522 { 1523 1523 $ch = curl_init($url); 1524 curl_setopt($ch, CURLOPT_TIMEOUT, 5);1524 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 1525 1525 curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); 1526 1526 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); … … 1547 1547 $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); 1548 1548 return preg_match('/^[23]\d\d$/', $http_code); 1549 } 1550 1551 /* 1552 * Get a HTTP response header. 1553 * 1554 * @access public 1555 * @param string $url URL to hit. 1556 * @param string $key Name of the header to return. 1557 * @param array $valid_response_codes Array of acceptable HTTP return codes. 1558 * @return string Value of the http header. 1559 * @author Quinn Comendant <quinn@strangecode.com> 1560 * @since 28 Oct 2020 20:00:36 1561 */ 1562 function getHttpHeader($url, $key, Array $valid_response_codes=[200]) 1563 { 1564 $headers = @get_headers($url, 1); 1565 1566 if ($headers && preg_match(sprintf('/\b(%s)\b/', join('|', $valid_response_codes)), $headers[0])) { 1567 $headers = array_change_key_case($headers, CASE_LOWER); 1568 $key = strtolower($key); 1569 if (isset($headers[$key])) { 1570 return $headers[$key]; 1571 } 1572 } 1573 1574 return false; 1549 1575 } 1550 1576
Note: See TracChangeset
for help on using the changeset viewer.