From 98baf38d5384b316fc443f764d01041c8912d31e Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 8 Sep 2019 15:58:36 +0300 Subject: improve create_captcha logging --- system/helpers/captcha_helper.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 94365adb5..ca9b86540 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -99,13 +99,19 @@ if ( ! function_exists('create_captcha')) if ( ! extension_loaded('gd')) { + log_message('error', 'create_captcha(): GD extension is not loaded.'); return FALSE; } if ($img_url !== '' OR $img_path !== '') { - if ($img_path === '' OR $img_url === '' OR ! is_dir($img_path) OR ! is_really_writable($img_path)) + if ($img_path === '' OR $img_url === '') { + log_message('error', 'create_captcha(): "img_path" and "img_url" are required.'); + return FALSE; + } elseif ( ! is_dir($img_path) OR ! is_really_writable($img_path)) + { + log_message('error', "create_captcha(): '$img_path' is not a dir, nor it's writable."); return FALSE; } -- cgit v1.2.3-24-g4f1b From f15e51bc3450a1002d545ac61bdca2a087ad043d Mon Sep 17 00:00:00 2001 From: sapics Date: Thu, 19 Sep 2019 09:03:08 +0900 Subject: Update Ubuntu from Precise to Trusty on Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 963d2cd2f..858e1d1eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: php -dist: precise +dist: trusty php: - 5.4 -- cgit v1.2.3-24-g4f1b From 2648cb67668d952495a8deea34c871017218dc5b Mon Sep 17 00:00:00 2001 From: sapics Date: Thu, 19 Sep 2019 09:09:02 +0900 Subject: Add PHP 7.4snapshot tests on Travis --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 858e1d1eb..6e056de53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ php: - 7.1 - 7.2 - 7.3 + - 7.4snapshot - master - hhvm @@ -33,6 +34,7 @@ script: php -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 matrix: allow_failures: + - php: 7.4snapshot - php: hhvm - php: master exclude: @@ -48,6 +50,8 @@ matrix: env: DB=mysql - php: 7.3 env: DB=mysql + - php: 7.4snapshot + env: DB=mysql - php: master env: DB=mysql -- cgit v1.2.3-24-g4f1b From 9e3f9fbb381ca2fcc546db10a0523d34d5d020bb Mon Sep 17 00:00:00 2001 From: sapics Date: Thu, 19 Sep 2019 09:12:40 +0900 Subject: Replace hhvm to hhvm-3.30 on Travis Composer is not support hhvm any more, thus, composer cause error in hhvm-4.x. hhvm-3.30 is the last php support version as https://hhvm.com/blog/2018/12/17/hhvm-3.30.html --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e056de53..bf16d38f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ php: - 7.3 - 7.4snapshot - master - - hhvm + - hhvm-3.30 env: - DB=mysql @@ -35,12 +35,12 @@ script: php -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 matrix: allow_failures: - php: 7.4snapshot - - php: hhvm - php: master + - php: hhvm-3.30 exclude: - - php: hhvm + - php: hhvm-3.30 env: DB=pgsql - - php: hhvm + - php: hhvm-3.30 env: DB=pdo/pgsql - php: 7.0 env: DB=mysql -- cgit v1.2.3-24-g4f1b From 3291dd45518c38909239aacc71eeed272f89dedd Mon Sep 17 00:00:00 2001 From: sapics Date: Thu, 19 Sep 2019 10:32:08 +0900 Subject: Replace master to nightly on Travis From the reference of the travis, nightly is the recommended one. https://docs.travis-ci.com/user/languages/php/ It also updates built version. `master`: version 8.0.0-dev (built: Feb 11 2019 07:59:12) `nightly`: version 8.0.0-dev (built: Sep 3 2019 09:50:37) --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bf16d38f8..8525d5f6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ php: - 7.2 - 7.3 - 7.4snapshot - - master + - nightly - hhvm-3.30 env: @@ -35,7 +35,7 @@ script: php -d zend.enable_gc=0 -d date.timezone=UTC -d mbstring.func_overload=7 matrix: allow_failures: - php: 7.4snapshot - - php: master + - php: nightly - php: hhvm-3.30 exclude: - php: hhvm-3.30 @@ -52,7 +52,7 @@ matrix: env: DB=mysql - php: 7.4snapshot env: DB=mysql - - php: master + - php: nightly env: DB=mysql branches: -- cgit v1.2.3-24-g4f1b From 25931b0d5e639cf48dd8488b46975787ee5e5ed2 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 22 Sep 2019 20:56:55 +0300 Subject: if+elseif => if + if --- system/helpers/captcha_helper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index ca9b86540..4552225ef 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -109,7 +109,9 @@ if ( ! function_exists('create_captcha')) { log_message('error', 'create_captcha(): "img_path" and "img_url" are required.'); return FALSE; - } elseif ( ! is_dir($img_path) OR ! is_really_writable($img_path)) + } + + if ( ! is_dir($img_path) OR ! is_really_writable($img_path)) { log_message('error', "create_captcha(): '$img_path' is not a dir, nor it's writable."); return FALSE; -- cgit v1.2.3-24-g4f1b From 24ff922ccb2cd647f997a7bc074d8863ea34fb10 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 22 Sep 2019 20:57:54 +0300 Subject: adding $img_path in curly; fixing words order --- system/helpers/captcha_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 4552225ef..a71148c97 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -113,7 +113,7 @@ if ( ! function_exists('create_captcha')) if ( ! is_dir($img_path) OR ! is_really_writable($img_path)) { - log_message('error', "create_captcha(): '$img_path' is not a dir, nor it's writable."); + log_message('error', "create_captcha(): '{$img_path}' is not a dir, nor is it writable."); return FALSE; } -- cgit v1.2.3-24-g4f1b From 6c6742cfe6b259e4e675b77c5e42c4e21dbd5104 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Sun, 22 Sep 2019 21:04:41 +0300 Subject: adding $ to var names in the log message --- system/helpers/captcha_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index a71148c97..1d87b80e5 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -107,7 +107,7 @@ if ( ! function_exists('create_captcha')) { if ($img_path === '' OR $img_url === '') { - log_message('error', 'create_captcha(): "img_path" and "img_url" are required.'); + log_message('error', 'create_captcha(): "$img_path" and "$img_url" are required.'); return FALSE; } -- cgit v1.2.3-24-g4f1b From 505f8491b056c3cd93fc73d61730963eddab6502 Mon Sep 17 00:00:00 2001 From: sapics Date: Wed, 25 Sep 2019 13:50:31 +0900 Subject: Fix indent --- application/views/welcome_message.php | 6 +++--- system/database/DB.php | 2 +- system/database/drivers/ibase/ibase_forge.php | 4 ++-- system/database/drivers/pdo/pdo_driver.php | 2 +- .../database/drivers/pdo/subdrivers/pdo_firebird_forge.php | 4 ++-- system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php | 4 ++-- system/database/drivers/postgre/postgre_forge.php | 4 ++-- system/libraries/Cache/drivers/Cache_apc.php | 8 ++++---- system/libraries/Cache/drivers/Cache_apcu.php | 8 ++++---- system/libraries/Cache/drivers/Cache_dummy.php | 8 ++++---- system/libraries/Cache/drivers/Cache_wincache.php | 8 ++++---- system/libraries/Profiler.php | 12 ++++++------ tests/codeigniter/helpers/file_helper_test.php | 6 +++--- tests/mocks/autoloader.php | 4 ++-- tests/mocks/ci_testcase.php | 2 +- 15 files changed, 41 insertions(+), 41 deletions(-) diff --git a/application/views/welcome_message.php b/application/views/welcome_message.php index bc5b441a9..dae768bc8 100644 --- a/application/views/welcome_message.php +++ b/application/views/welcome_message.php @@ -27,7 +27,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } a:hover { - color: #97310e; + color: #97310e; } h1 { @@ -69,8 +69,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } p { - margin: 0 0 10px; - padding:0; + margin: 0 0 10px; + padding:0; } p.footer { diff --git a/system/database/DB.php b/system/database/DB.php index dddcf758c..558212718 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -185,7 +185,7 @@ function &DB($params = '', $query_builder_override = NULL) elseif ( ! class_exists('CI_DB', FALSE)) { /** - * @ignore + * @ignore */ class CI_DB extends CI_DB_driver { } } diff --git a/system/database/drivers/ibase/ibase_forge.php b/system/database/drivers/ibase/ibase_forge.php index 29a3acf69..ad3382042 100644 --- a/system/database/drivers/ibase/ibase_forge.php +++ b/system/database/drivers/ibase/ibase_forge.php @@ -140,7 +140,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { * @return string|string[] */ protected function _alter_table($alter_type, $table, $field) - { + { if (in_array($alter_type, array('DROP', 'ADD'), TRUE)) { return parent::_alter_table($alter_type, $table, $field); @@ -183,7 +183,7 @@ class CI_DB_ibase_forge extends CI_DB_forge { } return $sqls; - } + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/pdo/pdo_driver.php b/system/database/drivers/pdo/pdo_driver.php index c5d120fd3..614d35096 100644 --- a/system/database/drivers/pdo/pdo_driver.php +++ b/system/database/drivers/pdo/pdo_driver.php @@ -302,7 +302,7 @@ class CI_DB_pdo_driver extends CI_DB { $error['code'] = isset($pdo_error[1]) ? $pdo_error[0].'/'.$pdo_error[1] : $pdo_error[0]; if (isset($pdo_error[2])) { - $error['message'] = $pdo_error[2]; + $error['message'] = $pdo_error[2]; } return $error; diff --git a/system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php b/system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php index eceb59796..db7936631 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php +++ b/system/database/drivers/pdo/subdrivers/pdo_firebird_forge.php @@ -126,7 +126,7 @@ class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge { * @return string|string[] */ protected function _alter_table($alter_type, $table, $field) - { + { if (in_array($alter_type, array('DROP', 'ADD'), TRUE)) { return parent::_alter_table($alter_type, $table, $field); @@ -169,7 +169,7 @@ class CI_DB_pdo_firebird_forge extends CI_DB_pdo_forge { } return $sqls; - } + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php index a4ccff407..4e19e9c57 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php +++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_forge.php @@ -106,7 +106,7 @@ class CI_DB_pdo_pgsql_forge extends CI_DB_pdo_forge { * @return string|string[] */ protected function _alter_table($alter_type, $table, $field) - { + { if (in_array($alter_type, array('DROP', 'ADD'), TRUE)) { return parent::_alter_table($alter_type, $table, $field); @@ -154,7 +154,7 @@ class CI_DB_pdo_pgsql_forge extends CI_DB_pdo_forge { } return $sqls; - } + } // -------------------------------------------------------------------- diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php index 481e222b8..a378d146b 100644 --- a/system/database/drivers/postgre/postgre_forge.php +++ b/system/database/drivers/postgre/postgre_forge.php @@ -101,7 +101,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { * @return string|string[] */ protected function _alter_table($alter_type, $table, $field) - { + { if (in_array($alter_type, array('DROP', 'ADD'), TRUE)) { return parent::_alter_table($alter_type, $table, $field); @@ -149,7 +149,7 @@ class CI_DB_postgre_forge extends CI_DB_forge { } return $sqls; - } + } // -------------------------------------------------------------------- diff --git a/system/libraries/Cache/drivers/Cache_apc.php b/system/libraries/Cache/drivers/Cache_apc.php index 8da8854ee..c0527e665 100644 --- a/system/libraries/Cache/drivers/Cache_apc.php +++ b/system/libraries/Cache/drivers/Cache_apc.php @@ -160,10 +160,10 @@ class CI_Cache_apc extends CI_Driver { * @param string user/filehits * @return mixed array on success, false on failure */ - public function cache_info($type = NULL) - { - return apc_cache_info($type); - } + public function cache_info($type = NULL) + { + return apc_cache_info($type); + } // ------------------------------------------------------------------------ diff --git a/system/libraries/Cache/drivers/Cache_apcu.php b/system/libraries/Cache/drivers/Cache_apcu.php index 0d84f8ee3..01f80e79b 100644 --- a/system/libraries/Cache/drivers/Cache_apcu.php +++ b/system/libraries/Cache/drivers/Cache_apcu.php @@ -171,10 +171,10 @@ class CI_Cache_apcu extends CI_Driver { * * @return mixed array on success, false on failure */ - public function cache_info() - { - return apcu_cache_info(); - } + public function cache_info() + { + return apcu_cache_info(); + } // ------------------------------------------------------------------------ diff --git a/system/libraries/Cache/drivers/Cache_dummy.php b/system/libraries/Cache/drivers/Cache_dummy.php index fdb9042ef..0a90d0692 100644 --- a/system/libraries/Cache/drivers/Cache_dummy.php +++ b/system/libraries/Cache/drivers/Cache_dummy.php @@ -138,10 +138,10 @@ class CI_Cache_dummy extends CI_Driver { * @param string user/filehits * @return bool FALSE */ - public function cache_info($type = NULL) - { - return FALSE; - } + public function cache_info($type = NULL) + { + return FALSE; + } // ------------------------------------------------------------------------ diff --git a/system/libraries/Cache/drivers/Cache_wincache.php b/system/libraries/Cache/drivers/Cache_wincache.php index e19c6ca99..703fece7a 100644 --- a/system/libraries/Cache/drivers/Cache_wincache.php +++ b/system/libraries/Cache/drivers/Cache_wincache.php @@ -169,10 +169,10 @@ class CI_Cache_wincache extends CI_Driver { * * @return mixed array on success, false on failure */ - public function cache_info() - { - return wincache_ucache_info(TRUE); - } + public function cache_info() + { + return wincache_ucache_info(TRUE); + } // ------------------------------------------------------------------------ diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 77af7b99b..d7a171f26 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -486,13 +486,13 @@ class CI_Profiler { { $pre = ''; $pre_close = ''; - + if (is_array($val) OR is_object($val)) { $val = print_r($val, TRUE); - + $pre = '
' ;
- 				$pre_close = '
'; + $pre_close = ''; } $output .= '' @@ -524,13 +524,13 @@ class CI_Profiler { { $pre = ''; $pre_close = ''; - + if (is_array($val) OR is_object($val)) { $val = print_r($val, TRUE); - + $pre = '
' ;
- 				$pre_close = '
'; + $pre_close = ''; } $output .= '' diff --git a/tests/codeigniter/helpers/file_helper_test.php b/tests/codeigniter/helpers/file_helper_test.php index 5ed8cb5c0..dd74ee46b 100644 --- a/tests/codeigniter/helpers/file_helper_test.php +++ b/tests/codeigniter/helpers/file_helper_test.php @@ -119,8 +119,8 @@ class File_helper_Test extends CI_TestCase { // -------------------------------------------------------------------- - public function test_write_file() - { + public function test_write_file() + { $content = 'Jack and Jill went up the mountain to fight a billy goat.'; $file = vfsStream::newFile('write.txt', 0777) @@ -129,6 +129,6 @@ class File_helper_Test extends CI_TestCase { ->at($this->_test_dir); $this->assertTrue(write_file(vfsStream::url('write.txt'), $content)); - } + } } diff --git a/tests/mocks/autoloader.php b/tests/mocks/autoloader.php index a912327ca..4dd53d4af 100644 --- a/tests/mocks/autoloader.php +++ b/tests/mocks/autoloader.php @@ -47,10 +47,10 @@ function autoload($class) 'Profiler', 'Table', 'Trackback', - 'Typography', + 'Typography', 'Unit_test', 'Upload', - 'User_agent', + 'User_agent', 'Xmlrpc', 'Zip' ); diff --git a/tests/mocks/ci_testcase.php b/tests/mocks/ci_testcase.php index 4f478fb4e..8dc4682ef 100644 --- a/tests/mocks/ci_testcase.php +++ b/tests/mocks/ci_testcase.php @@ -241,7 +241,7 @@ class CI_TestCase extends PHPUnit_Framework_TestCase { $dir_root = $root->getChild($dir); if ($dir_root) { - // Yes - recurse into subdir + // Yes - recurse into subdir $root = $dir_root; } else -- cgit v1.2.3-24-g4f1b From 315acfa47757aef9355a4658a59269530183819d Mon Sep 17 00:00:00 2001 From: Ossama Mehmood <40134503+ossamamehmood@users.noreply.github.com> Date: Sat, 5 Oct 2019 09:20:04 +0500 Subject: Update user_agents.php --- application/config/user_agents.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/config/user_agents.php b/application/config/user_agents.php index 3523528bf..48d5ab526 100644 --- a/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -153,6 +153,10 @@ $mobiles = array( 'open web' => 'Open Web', 'openweb' => 'OpenWeb', 'meizu' => 'Meizu', + 'huawei' => 'Huawei', + 'xiaomi' => 'Xiaomi', + 'oppo' => 'Oppo', + 'vivo' => 'Vivo', // Operating Systems 'android' => 'Android', -- cgit v1.2.3-24-g4f1b From fa5ab87854124729e83b33470fec1030a61d1b97 Mon Sep 17 00:00:00 2001 From: George Petculescu Date: Tue, 8 Oct 2019 10:11:47 +0300 Subject: removes double quotes --- system/helpers/captcha_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index 1d87b80e5..642ff3a50 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -107,7 +107,7 @@ if ( ! function_exists('create_captcha')) { if ($img_path === '' OR $img_url === '') { - log_message('error', 'create_captcha(): "$img_path" and "$img_url" are required.'); + log_message('error', 'create_captcha(): $img_path and $img_url are required.'); return FALSE; } -- cgit v1.2.3-24-g4f1b