Skip to content

Commit

Permalink
Merge branch 'hotfix-install'
Browse files Browse the repository at this point in the history
  • Loading branch information
johnvanbreda committed Jun 16, 2020
2 parents 67db514 + 9ee948c commit e357d6d
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ sudo: required
language: php

php:
- '7.1'
- '7.2'
- '7.3'
- '7.4'

env:
- POSTGRESQL_VERSION=postgresql-9.3-postgis-2.1
- POSTGRESQL_VERSION=postgresql-9.5-postgis-2.2
- POSTGRESQL_VERSION=postgresql-10-postgis-2.4


Expand Down
4 changes: 2 additions & 2 deletions application/config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
*
* @var string
*/
$config['version'] = '4.0.7';
$config['version'] = '4.0.8';

/**
* Version release date.
*
* @var string
*/
$config['release_date'] = '2020-06-02';
$config['release_date'] = '2020-06-16';

/**
* Link to the code repository downloads page.
Expand Down
2 changes: 1 addition & 1 deletion application/libraries/XMLReportReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public function applyWebsitePermissions(&$query, $websiteIds, $providedParams, $
unset($websiteIds[$key]);
}
}
$idList = implode($websiteIds, ',');
$idList = implode(',', $websiteIds);
// query can either pull in the filter or just the list of website ids.
$filter = empty($this->websiteFilterField) ? "1=1" : "({$this->websiteFilterField} in ($idList) or {$this->websiteFilterField} is null)";
$query = str_replace(array('#website_filter#', '#website_ids#'), array($filter, $idList), $query);
Expand Down
6 changes: 0 additions & 6 deletions modules/indicia_setup/helpers/config_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,6 @@ private static function check_email(&$messages, $problems_only) {
* False reports both failures and successes.
*/
private static function check_php_version(&$messages, $problems_only) {
// PHP_VERSION_ID is available as of PHP 5.2.7, if our
// version is lower than that, then emulate it.
if (!defined('PHP_VERSION_ID')) {
$version = PHP_VERSION;
define('PHP_VERSION_ID', ($version{0} * 10000 + $version{2} * 100 + $version{4}));
}
if (PHP_VERSION_ID < 50600) {
array_push($messages, array(
'title' => 'PHP Version',
Expand Down
25 changes: 1 addition & 24 deletions system/libraries/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ class Input_Core {
// Enable or disable automatic XSS cleaning
protected $use_xss_clean = FALSE;

// Are magic quotes enabled?
protected $magic_quotes_gpc = FALSE;

// IP address of current user
public $ip_address;

Expand All @@ -42,7 +39,7 @@ public static function instance()

/**
* Sanitizes global GET, POST and COOKIE data. Also takes care of
* magic_quotes and register_globals, if they have been enabled.
* register_globals, if they have been enabled.
*
* @return void
*/
Expand All @@ -53,20 +50,6 @@ public function __construct()

if (Input::$instance === NULL)
{
// magic_quotes_runtime is enabled
if (get_magic_quotes_runtime())
{
set_magic_quotes_runtime(0);
Kohana::log('debug', 'Disable magic_quotes_runtime! It is evil and deprecated: http://php.net/magic_quotes');
}

// magic_quotes_gpc is enabled
if (get_magic_quotes_gpc())
{
$this->magic_quotes_gpc = TRUE;
Kohana::log('debug', 'Disable magic_quotes_gpc! It is evil and deprecated: http://php.net/magic_quotes');
}

// register_globals is enabled
if (ini_get('register_globals'))
{
Expand Down Expand Up @@ -429,12 +412,6 @@ public function clean_input_data($str)
return $new_array;
}

if ($this->magic_quotes_gpc === TRUE)
{
// Remove annoying magic quotes
$str = stripslashes($str);
}

if ($this->use_xss_clean === TRUE)
{
$str = $this->xss_clean($str);
Expand Down
22 changes: 4 additions & 18 deletions system/vendor/swift/Swift/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,7 @@ class Swift_File
* @var resource
*/
protected $handle = null;
/**
* The status of magic_quotes in php.ini
* @var boolean
*/
protected $magic_quotes = false;


/**
* Constructor
* @param string The path the the file
Expand All @@ -49,7 +44,6 @@ class Swift_File
public function __construct($path)
{
$this->setPath($path);
$this->magic_quotes = get_magic_quotes_runtime();
}
/**
* Set the path to the file
Expand Down Expand Up @@ -133,16 +127,13 @@ public function getByte()
*/
public function readln()
{
set_magic_quotes_runtime(0);
$this->createHandle();
if (!$this->EOF())
{
$ret = fgets($this->handle);
}
else $ret = false;

set_magic_quotes_runtime($this->magic_quotes);


return $ret;
}
/**
Expand All @@ -153,9 +144,7 @@ public function readln()
public function readFull()
{
$ret = "";
set_magic_quotes_runtime(0);
while (false !== $chunk = $this->read(8192, false)) $ret .= $chunk;
set_magic_quotes_runtime($this->magic_quotes);
return $ret;
}
/**
Expand All @@ -164,18 +153,15 @@ public function readFull()
* @return string
* @throws Swift_FileException If the file cannot be read
*/
public function read($bytes, $unquote=true)
public function read($bytes)
{
if ($unquote) set_magic_quotes_runtime(0);
$this->createHandle();
if (!$this->EOF())
{
$ret = fread($this->handle, $bytes);
}
else $ret = false;

if ($unquote) set_magic_quotes_runtime($this->magic_quotes);


return $ret;
}
/**
Expand Down
21 changes: 9 additions & 12 deletions system/vendor/swift/Swift/Plugin/FileEmbedder.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Swift_Plugin_FileEmbedder implements Swift_Events_BeforeSendListener
* @var array
*/
protected $registeredFiles = array();

/**
* Get the MIME type based upon the extension.
* @param string The extension (sans the dot).
Expand Down Expand Up @@ -199,12 +199,12 @@ public function setTagDefinition($tag, $attributes, $extensions)
$tag = strtolower($tag);
$attributes = (array)$attributes;
$extensions = (array)$extensions;

if (empty($tag) || empty($attributes) || empty($extensions))
{
return null;
}

$this->definitions[$tag] = array("attributes" => $attributes, "extensions" => $extensions);
return true;
}
Expand Down Expand Up @@ -319,7 +319,7 @@ protected function embedRemoteFile($matches)
$url = preg_replace("~^([^#]+)#.*\$~s", "\$1", $matches[3]);
$bits = parse_url($url);
$ext = preg_replace("~^.*?\\.([^\\.]+)\$~s", "\$1", $bits["path"]);

$lower_url = strtolower($url);
if (array_key_exists($lower_url, $this->registeredFiles))
{
Expand All @@ -336,10 +336,7 @@ protected function embedRemoteFile($matches)
$this->registerFile($url, $cid, $registered["obj"]);
return $matches[1] . $cid . $matches[4];
}
$magic_quotes = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
$filedata = @file_get_contents($url);
set_magic_quotes_runtime($magic_quotes);
if (!$filedata)
{
return $matches[1] . $matches[3] . $matches[4];
Expand All @@ -364,7 +361,7 @@ protected function embedLocalFile($matches)
return $matches[1] . $matches[3] . $matches[4];
}
$ext = preg_replace("~^.*?\\.([^\\.]+)\$~s", "\$1", $path);

$lower_path = strtolower($path);
if (array_key_exists($lower_path, $this->registeredFiles))
{
Expand Down Expand Up @@ -403,28 +400,28 @@ public function clearCache()
public function beforeSendPerformed(Swift_Events_SendEvent $e)
{
$this->message = $e->getMessage();

foreach ($this->message->listChildren() as $id)
{
$part = $this->message->getChild($id);
$body = $part->getData();
if (!is_string($body) || substr(strtolower($part->getContentType()), 0, 5) != "text/") continue;

foreach ($this->definitions as $tag_name => $def)
{
if ($this->getEmbedRemoteFiles())
{
$re = $this->getRemoteFilePattern($tag_name);
$body = preg_replace_callback($re, array($this, "embedRemoteFile"), $body);
}

if ($this->getEmbedLocalFiles())
{
$re = $this->getLocalFilePattern($tag_name);
$body = preg_replace_callback($re, array($this, "embedLocalFile"), $body);
}
}

$part->setData($body);
}
}
Expand Down

0 comments on commit e357d6d

Please sign in to comment.