Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates/Fixes for PHP 8.2.8 #606

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions fuel/application/config/MY_fuel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
$config['fuel_path'] = 'fuel/';

// the name to be displayed on the top left of the admin
$config['site_name'] = 'My Website';
$config['site_name'] = 'CMS';

// whether the admin backend is enabled or not
$config['admin_enabled'] = FALSE;
$config['admin_enabled'] = TRUE;

// options are cms, views, and auto.
// cms pulls views and variables from the database,
// views mode pulls views from the views folder and variables from the _variables folder,
// and the auto option will first check the database for a page and if it doesn't exist or is
// not published, it will then check for the corresponding view file.
$config['fuel_mode'] = 'views';
$config['fuel_mode'] = 'auto';

// specifies which modules are allowed to be used in the fuel admin
$config['modules_allowed'] = array(
Expand Down
2 changes: 1 addition & 1 deletion fuel/application/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
// DEPRECATED: The BASE_URL constant is dynamically generated by the
// $_SERVER['HTTP_HOST'] variable. It is recommended that you hard code
// this value for security reasons.
$config['base_url'] = BASE_URL;
$config['base_url'] = '';

/*
|--------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions fuel/application/config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => '',
'username' => 'root',
'password' => '',
'database' => '',
'database' => 'fuel',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
Expand Down
2 changes: 1 addition & 1 deletion fuel/application/config/mimes.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'oda' => 'application/oda',
'pdf' => array('application/pdf', 'application/force-download', 'application/x-download', 'binary/octet-stream'),
'ai' => array('application/pdf', 'application/postscript'),
'eps' => array('application/postscript', 'image/x-eps'),
'eps' => 'application/postscript',
'ps' => 'application/postscript',
'smi' => 'application/smil',
'smil' => 'application/smil',
Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/core/Benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

#[AllowDynamicProperties]
/**
* Benchmark Class
*
Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

#[AllowDynamicProperties]
/**
* Application Controller Class
*
Expand Down
1 change: 1 addition & 0 deletions fuel/codeigniter/core/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/libraries/loader.html
*/
#[AllowDynamicProperties]
class CI_Loader {

// All these are set automatically. Don't mess with them.
Expand Down
2 changes: 1 addition & 1 deletion fuel/codeigniter/core/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @filesource
*/
defined('BASEPATH') OR exit('No direct script access allowed');

#[AllowDynamicProperties]
/**
* Router Class
*
Expand Down
7 changes: 7 additions & 0 deletions fuel/codeigniter/core/URI.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
*/
class CI_URI {

/**
* CI_Config instance
*
* @var CI_Config
*/
public $config;

/**
* List of cached URI segments
*
Expand Down
1 change: 1 addition & 0 deletions fuel/codeigniter/database/DB_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
* @author EllisLab Dev Team
* @link https://codeigniter.com/userguide3/database/
*/
#[AllowDynamicProperties]
abstract class CI_DB_driver {

/**
Expand Down
1 change: 1 addition & 0 deletions fuel/codeigniter/libraries/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* @author EllisLab Dev Team
* @link
*/
#[AllowDynamicProperties]
class CI_Driver_Library {

/**
Expand Down
4 changes: 2 additions & 2 deletions fuel/codeigniter/libraries/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,12 +489,12 @@ protected function _compile_template()
return;
}

$this->temp = $this->_default_template();
$temp = $this->_default_template();
foreach (array('table_open', 'thead_open', 'thead_close', 'heading_row_start', 'heading_row_end', 'heading_cell_start', 'heading_cell_end', 'tbody_open', 'tbody_close', 'row_start', 'row_end', 'cell_start', 'cell_end', 'row_alt_start', 'row_alt_end', 'cell_alt_start', 'cell_alt_end', 'table_close') as $val)
{
if ( ! isset($this->template[$val]))
{
$this->template[$val] = $this->temp[$val];
$this->template[$val] = $temp[$val];
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion fuel/modules/fuel/assets/css/fuel.css
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,9 @@ iframe#viewpage_iframe { border: none; width: 100%; height: 100%; }
input#Save, input.submit { margin-top: 10px; width: 150px; text-align: center; }
input#Cancel, input.cancel { margin-top: 10px; margin-right: 10px; width: 60px; text-align: center; }
div#tooltip h3 { font-size: 11px; font-weight: normal; }
a.btn_field { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; line-height: 12px; border: 1px solid #ccc; padding: 3px 5px 3px 5px; background: #eee url(../images/btn.png) repeat-x; white-space: nowrap; }
a.btn_field { -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; line-height: 12px; border: 1px solid #ccc; padding: 3px 5px 3px 5px;
background: #eee url(../images/btn.png) repeat-x;
}
a.btn_field:hover { background-position: 0 -27px; }
a#back_to { margin-bottom: 20px; display: block; }
.hidden_form { visibility:hidden; height: 0px; overflow: hidden; }
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/assets/css/fuel.min.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion fuel/modules/fuel/assets/js/fuel/custom_fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,6 @@ if (typeof(window.fuel.fields) == 'undefined'){
options.addButtonText = fuel.lang('btn_add_another');
options.removeButtonText = fuel.lang('btn_remove');
options.warnBeforeDeleteMessage = fuel.lang('warn_before_delete_msg');
options.prepend = $attrElem.attr('data-prepend') == 1;
$(this).repeatable(options);
})
}
Expand Down
9 changes: 2 additions & 7 deletions fuel/modules/fuel/assets/js/fuel/fuel.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -4029,8 +4029,7 @@ max : null,
min : null,
depth : 1,
allowCollapsingContent : true,
removeable : true,
prepend: false
removeable : true
}, o || {});
// used for issue when renaming checkboxes
var $checked = null;
Expand Down Expand Up @@ -4248,11 +4247,7 @@ return false;
var index = $children.length;
parseTemplate($clonecopy, index);
createRemoveButton($clonecopy);
if (options.prepend) {
$this.before().find(options.repeatableSelector + ':first').before($clonecopy);
} else {
$this.append($clonecopy);
}
// remove values from any form fields
$clonecopy.find('input,select,textarea').not('input[type="radio"], input[type="checkbox"], input[type="button"], .noclear').val('');
$clonecopy.find('input[type="checkbox"]').not('.noclear').prop('checked', false);
Expand Down Expand Up @@ -4311,7 +4306,7 @@ $toDisplay.not(':first').hide();
$toDisplay.hide();
}
}
if ($parent.find('.' + options.addButtonClass).length == 0 && !$this.hasClass('__applied__')){
if ($parent.find(options.addButtonClass).length == 0 && !$this.hasClass('__applied__')){
$parent.append('<a href="#" class="' + options.addButtonClass + '">' + options.addButtonText +' </a>');
}
// add sorting
Expand Down
12 changes: 3 additions & 9 deletions fuel/modules/fuel/assets/js/jquery/plugins/jquery.repeatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ [email protected]
min : null,
depth : 1,
allowCollapsingContent : true,
removeable : true,
prepend: false
removeable : true
}, o || {});

// used for issue when renaming checkboxes
Expand Down Expand Up @@ -305,13 +304,8 @@ [email protected]
var index = $children.length;
parseTemplate($clonecopy, index);
createRemoveButton($clonecopy);
$this.append($clonecopy);

if (options.prepend) {
$this.before().find(options.repeatableSelector + ':first').before($clonecopy);
} else {
$this.append($clonecopy);
}

// remove values from any form fields
$clonecopy.find('input,select,textarea').not('input[type="radio"], input[type="checkbox"], input[type="button"], .noclear').val('');
$clonecopy.find('input[type="checkbox"]').not('.noclear').prop('checked', false);
Expand Down Expand Up @@ -387,7 +381,7 @@ [email protected]
$toDisplay.hide();
}
}
if ($parent.find('.' + options.addButtonClass).length == 0 && !$this.hasClass('__applied__')){
if ($parent.find(options.addButtonClass).length == 0 && !$this.hasClass('__applied__')){
$parent.append('<a href="#" class="' + options.addButtonClass + '">' + options.addButtonText +' </a>');
}
// add sorting
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/controllers/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ protected function _sanitize($data)
{
$func = (isset($valid_funcs[$func])) ? $valid_funcs[$func] : FALSE;

if ($func && isset($posted[$key]))
if ($func)
{
$posted[$key] = $func($posted[$key]);
}
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/core/MY_DB_mysqli_driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function table_info($table, $set_field_key = TRUE)
$max_length = current($max_length);
}

if (strpos((string) $max_length, ',') !== FALSE)
if (strpos($max_length, ',') !== FALSE)
{
$maxes = explode(',', $max_length);
$max_length = 0;
Expand Down
25 changes: 12 additions & 13 deletions fuel/modules/fuel/core/MY_Model.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/**
* FUEL CMS
* http://www.getfuelcms.com
Expand Down Expand Up @@ -67,7 +68,7 @@ class MY_Model extends CI_Model {
public $representatives = array(); // an array of fields that have arrays or regular expression values to match against different field types (e.g. 'number'=>'bigint|smallint|tinyint|int')
public $custom_fields = array(); // an array of field names/types that map to a specific class
public $formatters = array(); // an array of helper formatter functions related to a specific field type (e.g. string, datetime, number), or name (e.g. title, content) that can augment field results

public $last_data_set = array();
/**
* @var CI_DB_query_builder CI database query builder
*/
Expand Down Expand Up @@ -124,7 +125,8 @@ public function __construct($table = NULL, $params = array())
* @param string the table name
* @param array config preferences
* @return void
*/
*/

public function initialize($table = NULL, $params = array())
{
if (!empty($table))
Expand Down Expand Up @@ -5460,18 +5462,15 @@ public function format($field, $funcs = array(), $args = array())
}

// check the current record object for a method, and if exists, use that instead
if ($f)
if (method_exists($this, $f))
{
if (method_exists($this, $f))
{
$f = array($this, $f);
}
// apply function if it exists to the value
if (is_callable($f))
{
$func_args = array_merge(array($value), $args);
$value = call_user_func_array($f, $func_args);
}
$f = array($this, $f);
}
// apply function if it exists to the value
if (is_callable($f))
{
$func_args = array_merge(array($value), $args);
$value = call_user_func_array($f, $func_args);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/helpers/utility_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function capture($on = TRUE, $clean = 'all')
*/
function is_true_val($val)
{
$val = strtolower((string)$val);
$val = strtolower($val);
return ($val == 'y' || $val == 'yes' || $val === 1 || $val == '1' || $val== 'true' || $val == 't');
}
}
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/helpers/validator_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function length_min($str, $limit = 1)
function valid_phone($str)
{
$num = $str;
$num = preg_replace("#[^0-9]#", '', $str);
$num = preg_replace("#[^0-9]#", null, $str);

if(!is_numeric($num))
{
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/libraries/Data_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Data_table {
public $no_data_str = 'No data to display.'; //The default string to display when no data exists
public $lang_prefix = 'table_header_'; // the language prefix to associate with table headers
public $field_styles = array(); // styles to apply to the data columns. Index is the column and the value is the style

var $row_data;
protected $_ordering = TRUE; // sorting order
protected $_field = NULL; // sorted column
protected $_field_formatters = array(); // an array of function to format columns
Expand Down
2 changes: 1 addition & 1 deletion fuel/modules/fuel/libraries/Fuel_blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public function import($block, $sanitize = TRUE)
$model = $this->model();
if (!is_numeric($block))
{
$block_data = $model->find_one_array(array('name' => $block));
$block_data = $model->find_by_name($block, 'array');
}
else
{
Expand Down
6 changes: 4 additions & 2 deletions fuel/modules/fuel/libraries/Fuel_cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Fuel_cache extends Fuel_base_library {

public $ignore = '#^(\..+)|(index\.html)#'; // Regular expression of files to exclude from clearing like .gitignore and .htaccess
public $cache_path = ''; // The cache path. If no path is provided it will use the cache path value found in the main CI config file.

var $compiled_path;
protected $_cache; // the Cache object used for saving, retrieving and deleting cached files
protected $_types = array(
'compiled',
Expand All @@ -59,6 +59,7 @@ public function __construct($params = array())
parent::__construct();
$this->CI->load->library('cache');
$this->_cache = & $this->CI->cache;
$this->compiled_path = '';
$this->initialize($params);
}

Expand Down Expand Up @@ -112,7 +113,8 @@ public function set_cache_path($path)
* @access public
* @param string The path to the compiled templates folder
* @return void
*/
*/

public function set_compiled_path($path)
{
$this->compiled_path = $path;
Expand Down
Loading