summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml92
-rw-r--r--application/config/mimes.php6
-rw-r--r--system/core/Common.php2
-rw-r--r--system/database/drivers/pdo/pdo_driver.php13
-rw-r--r--system/libraries/Image_lib.php5
-rw-r--r--tests/codeigniter/helpers/text_helper_test.php7
6 files changed, 96 insertions, 29 deletions
diff --git a/.travis.yml b/.travis.yml
index 8525d5f6c..5070c24c2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,20 +1,17 @@
language: php
-dist: trusty
+os: linux
+dist: xenial
php:
- - 5.4
- - 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- - 7.4snapshot
+ - 7.4
- nightly
- - hhvm-3.30
-
+
env:
- - DB=mysql
- DB=mysqli
- DB=pgsql
- DB=sqlite
@@ -22,38 +19,87 @@ env:
- DB=pdo/pgsql
- DB=pdo/sqlite
-sudo: false
+services:
+ - mysql
+ - postgresql
+
+cache:
+ directories:
+ - $HOME/.composer/cache
before_script:
- - sh -c "composer install --dev --no-progress"
+ - sh -c "composer install --no-progress"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'pgsql' ] || [ '$DB' = 'pdo/pgsql' ]; then psql -c 'create database ci_test;' -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ] || [ '$DB' = 'mysqli' ] || [ '$DB' = 'pdo/mysql' ]; then mysql -e 'create database IF NOT EXISTS ci_test;'; fi"
script: php -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 -d mbstring.internal_encoding=UTF-8 vendor/bin/phpunit --coverage-text --configuration tests/travis/$DB.phpunit.xml
-matrix:
+jobs:
allow_failures:
- - php: 7.4snapshot
- php: nightly
- php: hhvm-3.30
- exclude:
- - php: hhvm-3.30
+ include:
+ - php: 5.4
+ dist: trusty
+ env: DB=mysql
+ - php: 5.4
+ dist: trusty
+ env: DB=mysqli
+ - php: 5.4
+ dist: trusty
env: DB=pgsql
- - php: hhvm-3.30
+ - php: 5.4
+ dist: trusty
+ env: DB=sqlite
+ - php: 5.4
+ dist: trusty
+ env: DB=pdo/mysql
+ - php: 5.4
+ dist: trusty
env: DB=pdo/pgsql
- - php: 7.0
- env: DB=mysql
- - php: 7.1
- env: DB=mysql
- - php: 7.2
- env: DB=mysql
- - php: 7.3
+ - php: 5.4
+ dist: trusty
+ env: DB=pdo/sqlite
+ - php: 5.5
+ dist: trusty
env: DB=mysql
- - php: 7.4snapshot
+ - php: 5.5
+ dist: trusty
+ env: DB=mysqli
+ - php: 5.5
+ dist: trusty
+ env: DB=pgsql
+ - php: 5.5
+ dist: trusty
+ env: DB=sqlite
+ - php: 5.5
+ dist: trusty
+ env: DB=pdo/mysql
+ - php: 5.5
+ dist: trusty
+ env: DB=pdo/pgsql
+ - php: 5.5
+ dist: trusty
+ env: DB=pdo/sqlite
+ - php: 5.6
+ dist: xenial
env: DB=mysql
- - php: nightly
+ - php: hhvm-3.30
+ dist: trusty
env: DB=mysql
+ - php: hhvm-3.30
+ dist: trusty
+ env: DB=mysqli
+ - php: hhvm-3.30
+ dist: trusty
+ env: DB=sqlite
+ - php: hhvm-3.30
+ dist: trusty
+ env: DB=pdo/mysql
+ - php: hhvm-3.30
+ dist: trusty
+ env: DB=pdo/sqlite
branches:
only:
diff --git a/application/config/mimes.php b/application/config/mimes.php
index 7aa5c9e4e..f5407ff89 100644
--- a/application/config/mimes.php
+++ b/application/config/mimes.php
@@ -5,7 +5,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| -------------------------------------------------------------------
| MIME TYPES
| -------------------------------------------------------------------
-| This file contains an array of mime types. It is used by the
+| This file contains an array of mime types. It is used by the
| Upload class to help identify allowed file types.
|
*/
@@ -85,9 +85,11 @@ return array(
'jpm' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mj2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
'mjp2' => array('image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'),
- 'png' => array('image/png', 'image/x-png'),
+ 'png' => array('image/png', 'image/x-png'),
'tiff' => 'image/tiff',
'tif' => 'image/tiff',
+ 'heic' => 'image/heic',
+ 'heif' => 'image/heif',
'css' => array('text/css', 'text/plain'),
'html' => array('text/html', 'text/plain'),
'htm' => array('text/html', 'text/plain'),
diff --git a/system/core/Common.php b/system/core/Common.php
index fadc0a0b1..f8ab7e800 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -569,7 +569,7 @@ if ( ! function_exists('set_status_header'))
return;
}
- $server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.0', 'HTTP/1.1', 'HTTP/2'), TRUE))
+ $server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.0', 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0'), TRUE))
? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
header($server_protocol.' '.$code.' '.$text, TRUE, $code);
}
diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php
index 614d35096..b23e8cbda 100644
--- a/system/database/drivers/pdo/pdo_driver.php
+++ b/system/database/drivers/pdo/pdo_driver.php
@@ -326,4 +326,17 @@ class CI_DB_pdo_driver extends CI_DB {
return 'TRUNCATE TABLE '.$table;
}
+ // --------------------------------------------------------------------
+
+ /**
+ * Close DB Connection
+ *
+ * @return void
+ */
+ protected function _close()
+ {
+ $this->result_id = FALSE;
+ $this->conn_id = FALSE;
+ }
+
}
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index 0d9fa4420..0ef76a101 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1474,15 +1474,16 @@ class CI_Image_lib {
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported'));
return FALSE;
}
+
+ return imagecreatefrompng($path);
case 18:
if ( ! function_exists('imagecreatefromwebp'))
{
$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_webp_not_supported'));
return FALSE;
}
- return imagecreatefromwebp($path);
- return imagecreatefrompng($path);
+ return imagecreatefromwebp($path);
default:
$this->set_error(array('imglib_unsupported_imagecreate'));
return FALSE;
diff --git a/tests/codeigniter/helpers/text_helper_test.php b/tests/codeigniter/helpers/text_helper_test.php
index 36465f203..e51d96a29 100644
--- a/tests/codeigniter/helpers/text_helper_test.php
+++ b/tests/codeigniter/helpers/text_helper_test.php
@@ -64,7 +64,12 @@ class Text_helper_test extends CI_TestCase {
public function test_convert_accented_characters()
{
- $this->ci_vfs_clone('application/config/foreign_chars.php');
+ $path = 'application/config/foreign_chars.php';
+ $this->ci_vfs_clone($path);
+ if (is_php('7.4'))
+ {
+ copy(PROJECT_BASE.$path, APPPATH.'../'.$path);
+ }
$this->assertEquals('AAAeEEEIIOOEUUUeY', convert_accented_characters('ÀÂÄÈÊËÎÏÔŒÙÛÜŸ'));
$this->assertEquals('a e i o u n ue', convert_accented_characters('á é í ó ú ñ ü'));
}