Update database and helper functionality in CodeIgniter
Revised database drivers, query builder, and file/inflector helpers for improved consistency and functionality. Updated copyrights, links, and standardized function names including deprecating `is_countable` in favor of `word_is_countable`. Added support for new SQL features and optimized query handling.
This commit is contained in:
Executable → Regular
+22
-7
@@ -6,7 +6,7 @@
|
||||
*
|
||||
* This content is released under the MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014 - 2017, British Columbia Institute of Technology
|
||||
* Copyright (c) 2019 - 2022, CodeIgniter Foundation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -29,8 +29,9 @@
|
||||
* @package CodeIgniter
|
||||
* @author EllisLab Dev Team
|
||||
* @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
|
||||
* @copyright Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
|
||||
* @license http://opensource.org/licenses/MIT MIT License
|
||||
* @copyright Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
|
||||
* @copyright Copyright (c) 2019 - 2022, CodeIgniter Foundation (https://codeigniter.com/)
|
||||
* @license https://opensource.org/licenses/MIT MIT License
|
||||
* @link https://codeigniter.com
|
||||
* @since Version 1.0.0
|
||||
* @filesource
|
||||
@@ -44,7 +45,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
* @subpackage Libraries
|
||||
* @category Validation
|
||||
* @author EllisLab Dev Team
|
||||
* @link https://codeigniter.com/user_guide/libraries/form_validation.html
|
||||
* @link https://codeigniter.com/userguide3/libraries/form_validation.html
|
||||
*/
|
||||
class CI_Form_validation {
|
||||
|
||||
@@ -584,7 +585,7 @@ class CI_Form_validation {
|
||||
{
|
||||
if ($row['is_array'] === FALSE)
|
||||
{
|
||||
isset($_POST[$field]) && $_POST[$field] = $row['postdata'];
|
||||
isset($_POST[$field]) && $_POST[$field] = is_array($row['postdata']) ? NULL : $row['postdata'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1056,7 +1057,7 @@ class CI_Form_validation {
|
||||
{
|
||||
return is_array($str)
|
||||
? (empty($str) === FALSE)
|
||||
: (trim($str) !== '');
|
||||
: (trim((string) $str) !== '');
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
@@ -1208,6 +1209,13 @@ class CI_Form_validation {
|
||||
$str = $matches[2];
|
||||
}
|
||||
|
||||
// Apparently, FILTER_VALIDATE_URL doesn't reject digit-only names for some reason ...
|
||||
// See https://github.com/bcit-ci/CodeIgniter/issues/5755
|
||||
if (ctype_digit($str))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// PHP 7 accepts IPv6 addresses within square brackets as hostnames,
|
||||
// but it appears that the PR that came in with https://bugs.php.net/bug.php?id=68039
|
||||
// was never merged into a PHP 5 branch ... https://3v4l.org/8PsSN
|
||||
@@ -1231,7 +1239,14 @@ class CI_Form_validation {
|
||||
{
|
||||
if (function_exists('idn_to_ascii') && preg_match('#\A([^@]+)@(.+)\z#', $str, $matches))
|
||||
{
|
||||
$str = $matches[1].'@'.idn_to_ascii($matches[2]);
|
||||
$domain = defined('INTL_IDNA_VARIANT_UTS46')
|
||||
? idn_to_ascii($matches[2], 0, INTL_IDNA_VARIANT_UTS46)
|
||||
: idn_to_ascii($matches[2]);
|
||||
|
||||
if ($domain !== FALSE)
|
||||
{
|
||||
$str = $matches[1].'@'.$domain;
|
||||
}
|
||||
}
|
||||
|
||||
return (bool) filter_var($str, FILTER_VALIDATE_EMAIL);
|
||||
|
||||
Reference in New Issue
Block a user