Changeset 746
- Timestamp:
- May 31, 2021 1:51:18 AM (3 years ago)
- Location:
- trunk/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/App.inc.php
r743 r746 429 429 // But not if all DB credentials have been defined already by other means. 430 430 if ($this->cli && '' != $this->getParam('db_auth_file') && (!$this->getParam('db_server') || !$this->getParam('db_name') || !$this->getParam('db_user') || !$this->getParam('db_pass'))) { 431 if (false !== $db_auth_file = stream_resolve_include_path($this->getParam('db_auth_file'))) {431 if (false !== ($db_auth_file = stream_resolve_include_path($this->getParam('db_auth_file')))) { 432 432 if (is_readable($db_auth_file)) { 433 433 $db_auth = json_decode(file_get_contents($db_auth_file), true); … … 622 622 623 623 // Set the application version if defined. 624 if (false !== $site_version_file = stream_resolve_include_path($this->getParam('site_version_file'))) {624 if (false !== ($site_version_file = stream_resolve_include_path($this->getParam('site_version_file')))) { 625 625 if (mb_strpos($site_version_file, '.json') !== false) { 626 626 $version_json = json_decode(trim(file_get_contents($site_version_file)), true); -
trunk/lib/Currency.inc.php
r550 r746 123 123 public function getValue($amount, $base, $target) 124 124 { 125 if (false !== $rate = $this->getRate($base, $target)) {125 if (false !== ($rate = $this->getRate($base, $target))) { 126 126 return abs($rate * $amount); 127 127 } else { … … 231 231 // Fetch XML from ECB <http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml> 232 232 $api_url = 'http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml'; 233 if (false === $sXML = file_get_contents($api_url)) {233 if (false === ($sXML = file_get_contents($api_url))) { 234 234 $app->logMsg(sprintf('Failed to load ECB XML data from: %s', $api_url), LOG_WARNING, __FILE__, __LINE__); 235 235 return false; 236 236 } 237 if (false === $oXML = simplexml_load_string($sXML)) {237 if (false === ($oXML = simplexml_load_string($sXML))) { 238 238 $app->logMsg(sprintf('Failed to decode ECB XML data: %s', truncate($sXML, 200, 'end')), LOG_WARNING, __FILE__, __LINE__); 239 239 return false; -
trunk/lib/Utilities.inc.php
r744 r746 1627 1627 $app =& App::getInstance(); 1628 1628 1629 if (false === $resolved_filename = stream_resolve_include_path($filename)) {1629 if (false === ($resolved_filename = stream_resolve_include_path($filename))) { 1630 1630 $app->logMsg(sprintf('JSON file "%s" not found in path "%s"', $filename, get_include_path()), LOG_ERR, __FILE__, __LINE__); 1631 1631 return null; … … 1637 1637 } 1638 1638 1639 if (null === $data = json_decode(file_get_contents($resolved_filename), $assoc, $depth, $options)) {1639 if (null === ($data = json_decode(file_get_contents($resolved_filename), $assoc, $depth, $options))) { 1640 1640 $app->logMsg(sprintf('JSON is unparsable: %s', $resolved_filename), LOG_ERR, __FILE__, __LINE__); 1641 1641 return null; … … 1705 1705 return false; 1706 1706 case -5: 1707 $app->logMsg('IP Intelligence: Banned: no permissionor invalid email address', LOG_WARNING, __FILE__, __LINE__);1707 $app->logMsg('IP Intelligence: Banned: exceeded query limits, no permission, or invalid email address', LOG_WARNING, __FILE__, __LINE__); 1708 1708 return false; 1709 1709 case -6: … … 1711 1711 return false; 1712 1712 default: 1713 if (!is_numeric($response) || $response < 0 || $response >= $threshold) { 1713 if (!is_numeric($response) || $response < 0) { 1714 $app->logMsg(sprintf('IP Intelligence: Unknown status for IP (%s): %s', $response, $ip), LOG_NOTICE, __FILE__, __LINE__); 1715 return false; 1716 } 1717 if ($response >= $threshold) { 1714 1718 $app->logMsg(sprintf('IP Intelligence: Bad IP (%s): %s', $response, $ip), LOG_NOTICE, __FILE__, __LINE__); 1715 1719 return true;
Note: See TracChangeset
for help on using the changeset viewer.