Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
adc059a
fix: restore form_prep() removed in 3.2.0-dev.
pocketarc Mar 18, 2026
d9a6c4c
fix: restore do_hash() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
f5cc5c7
fix: restore br() and nbs() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
5273897
fix: restore trim_slashes() and repeater() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
74f6dfc
fix: restore standard_date() and nice_date() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
ebce706
fix: restore is_cli_request() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
9ae1d9a
fix: restore prep_for_form() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
4a80a3b
fix: restore system_url() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
e62bacd
docs: rework upgrade guide and README for the 3.2+ maintenance fork.
pocketarc Mar 19, 2026
56504ca
fix: restore 'unique' and 'encrypt' aliases in random_string() remove…
pocketarc Mar 19, 2026
c3fb46d
fix: restore 'dash' and 'underscore' aliases in url_title() removed i…
pocketarc Mar 19, 2026
cb11ea1
fix: restore 'anchor_class' option in Pagination removed in 3.2.0-dev.
pocketarc Mar 19, 2026
34340cc
fix: restore $_after parameter in add_column() removed in 3.2.0-dev.
pocketarc Mar 19, 2026
53115e6
docs: remove restored items from 3.2+ upgrade removal list.
pocketarc Mar 19, 2026
d3c6e9c
fix: restore Smiley Helper removed in 3.2.0-dev.
pocketarc Mar 20, 2026
6c714a6
fix: restore Javascript Library removed in 3.2.0-dev.
pocketarc Mar 20, 2026
39ccd43
docs: remove restored items from 3.2+ upgrade removal list.
pocketarc Mar 20, 2026
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
64 changes: 64 additions & 0 deletions application/config/smileys.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

/*
| -------------------------------------------------------------------
| SMILEYS
| -------------------------------------------------------------------
| This file contains an array of smileys for use with the emoticon helper.
| Individual images can be used to replace multiple smileys. For example:
| :-) and :) use the same image replacement.
|
| Please see user guide for more info:
| https://codeigniter.com/user_guide/helpers/smiley_helper.html
|
*/
$smileys = array(

// smiley image name width height alt

':-)' => array('grin.gif', '19', '19', 'grin'),
':lol:' => array('lol.gif', '19', '19', 'LOL'),
':cheese:' => array('cheese.gif', '19', '19', 'cheese'),
':)' => array('smile.gif', '19', '19', 'smile'),
';-)' => array('wink.gif', '19', '19', 'wink'),
';)' => array('wink.gif', '19', '19', 'wink'),
':smirk:' => array('smirk.gif', '19', '19', 'smirk'),
':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'),
':-S' => array('confused.gif', '19', '19', 'confused'),
':wow:' => array('surprise.gif', '19', '19', 'surprised'),
':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'),
':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'),
'%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'),
';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'),
':P' => array('raspberry.gif', '19', '19', 'raspberry'),
':blank:' => array('blank.gif', '19', '19', 'blank stare'),
':long:' => array('longface.gif', '19', '19', 'long face'),
':ohh:' => array('ohh.gif', '19', '19', 'ohh'),
':grrr:' => array('grrr.gif', '19', '19', 'grrr'),
':gulp:' => array('gulp.gif', '19', '19', 'gulp'),
'8-/' => array('ohoh.gif', '19', '19', 'oh oh'),
':down:' => array('downer.gif', '19', '19', 'downer'),
':red:' => array('embarrassed.gif', '19', '19', 'red face'),
':sick:' => array('sick.gif', '19', '19', 'sick'),
':shut:' => array('shuteye.gif', '19', '19', 'shut eye'),
':-/' => array('hmm.gif', '19', '19', 'hmmm'),
'>:(' => array('mad.gif', '19', '19', 'mad'),
':mad:' => array('mad.gif', '19', '19', 'mad'),
'>:-(' => array('angry.gif', '19', '19', 'angry'),
':angry:' => array('angry.gif', '19', '19', 'angry'),
':zip:' => array('zip.gif', '19', '19', 'zipper'),
':kiss:' => array('kiss.gif', '19', '19', 'kiss'),
':ahhh:' => array('shock.gif', '19', '19', 'shock'),
':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'),
':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'),
':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'),
':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'),
':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'),
':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'),
':vampire:' => array('vampire.gif', '19', '19', 'vampire'),
':snake:' => array('snake.gif', '19', '19', 'snake'),
':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'),
':question:' => array('question.gif', '19', '19', 'question')

);
18 changes: 5 additions & 13 deletions readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,9 @@ If you prefer the traditional approach of replacing the system directory:

**Upgrading from Original CI3**

⚠️ **Important:** This fork is based on the unreleased CodeIgniter 3.2.0-dev version, not the stable 3.1.13. If you're upgrading from CI 3.1.x, please read the upgrade guide for any changes that may affect your application.
This fork is based on the unreleased CodeIgniter 3.2.0-dev. For most
applications the upgrade is straightforward: install via Composer,
update your `$system_path`, and review the upgrade guide.

**Please review the upgrade guide:** `upgrade_320.rst <user_guide_src/source/installation/upgrade_320.rst>`_

Note: The upgrade guide has been updated to reflect functionality we've restored for backward compatibility (Cart library, Email helper, etc.).

Steps to upgrade:

1. Review the upgrade guide for breaking changes between 3.1.x and 3.2.0
2. Install via Composer as shown above
3. Update the `$system_path` in your `index.php`
4. Apply any necessary changes from the upgrade guide to your application
5. Your existing `application/` directory remains mostly unchanged (except for items noted in the upgrade guide)
6. Test thoroughly with your PHP version (especially if using PHP 8.2+)
The upgrade guide covers both 3.1.x and 3.2-dev users:
`upgrade_320.rst <user_guide_src/source/installation/upgrade_320.rst>`_
14 changes: 14 additions & 0 deletions system/core/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,20 @@ public function base_url($uri = '', $protocol = NULL)

// -------------------------------------------------------------

/**
* System URL
*
* @deprecated 3.0.0
* @return string
*/
public function system_url()
{
$x = explode('/', preg_replace('|/*(.+?)/*$|', '\\1', BASEPATH));
return $this->slash_item('base_url').end($x).'/';
}

// -------------------------------------------------------------

/**
* Build URI string
*
Expand Down
16 changes: 16 additions & 0 deletions system/core/Input.php
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,22 @@ public function is_ajax_request()

// --------------------------------------------------------------------

/**
* Is CLI request?
*
* Test to see if a request was made from the command line.
*
* @deprecated 3.0.0 Use is_cli() instead
* @see is_cli()
* @return bool
*/
public function is_cli_request()
{
return is_cli();
}

// --------------------------------------------------------------------

/**
* Get Request Method
*
Expand Down
7 changes: 6 additions & 1 deletion system/database/DB_forge.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,13 +561,18 @@ public function rename_table($table_name, $new_table_name)
* @param array $field Column definition
* @return bool
*/
public function add_column($table, $field)
public function add_column($table, $field, $_after = NULL)
{
// Work-around for literal column definitions
is_array($field) OR $field = array($field);

foreach (array_keys($field) as $k)
{
if ($_after !== NULL && is_array($field[$k]) && ! isset($field[$k]['after']))
{
$field[$k]['after'] = $_after;
}

$this->add_field(array($k => $field[$k]));
}

Expand Down
102 changes: 102 additions & 0 deletions system/helpers/date_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,42 @@ function mdate($datestr = '', $time = '')

// ------------------------------------------------------------------------

if ( ! function_exists('standard_date'))
{
/**
* Standard Date
*
* Returns a date formatted according to the submitted standard.
*
* As of PHP 5.2, the DateTime extension provides constants that
* serve for the exact same purpose and are used internally by
* date() as well.
*
* @deprecated 3.1.3 Use PHP's native date() with DateTime constants
*
* @param string $fmt = 'DATE_RFC822' the chosen format
* @param int $time = NULL Unix timestamp
* @return string
*/
function standard_date($fmt = 'DATE_RFC822', $time = NULL)
{
if (empty($time))
{
$time = now();
}

// Procedural style pre-defined constants from the DateTime extension
if (strpos($fmt, 'DATE_') !== 0 OR defined($fmt) === FALSE)
{
return FALSE;
}

return date(constant($fmt), $time);
}
}

// ------------------------------------------------------------------------

if ( ! function_exists('timespan'))
{
/**
Expand Down Expand Up @@ -451,6 +487,72 @@ function human_to_unix($datestr = '')

// ------------------------------------------------------------------------

if ( ! function_exists('nice_date'))
{
/**
* Turns many "reasonably-date-like" strings into something
* that is actually useful. This only works for dates after unix epoch.
*
* @deprecated 3.1.3 Use DateTime::createFromFormat($input_format, $input)->format($output_format);
* @param string The terribly formatted date-like string
* @param string Date format to return (same as php date function)
* @return string
*/
function nice_date($bad_date = '', $format = FALSE)
{
if (empty($bad_date))
{
return 'Unknown';
}
elseif (empty($format))
{
$format = 'U';
}

// Date like: YYYYMM
if (preg_match('/^\d{6}$/i', $bad_date))
{
if (in_array(substr($bad_date, 0, 2), array('19', '20')))
{
$year = substr($bad_date, 0, 4);
$month = substr($bad_date, 4, 2);
}
else
{
$month = substr($bad_date, 0, 2);
$year = substr($bad_date, 2, 4);
}

return date($format, strtotime($year.'-'.$month.'-01'));
}

// Date Like: YYYYMMDD
if (preg_match('/^\d{8}$/i', $bad_date, $matches))
{
return DateTime::createFromFormat('Ymd', $bad_date)->format($format);
}

// Date Like: MM-DD-YYYY __or__ M-D-YYYY (or anything in between)
if (preg_match('/^(\d{1,2})-(\d{1,2})-(\d{4})$/i', $bad_date, $matches))
{
return date($format, strtotime($matches[3].'-'.$matches[1].'-'.$matches[2]));
}

// Any other kind of string, when converted into UNIX time,
// produces "0 seconds after epoc..." is probably bad...
// return "Invalid Date".
if (date('U', strtotime($bad_date)) === '0')
{
return 'Invalid Date';
}

// It's probably a valid-ish date format already
return date($format, strtotime($bad_date));
}
}

// ------------------------------------------------------------------------

if ( ! function_exists('timezone_menu'))
{
/**
Expand Down
19 changes: 19 additions & 0 deletions system/helpers/form_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,25 @@ function form_close($extra = '')

// ------------------------------------------------------------------------

if ( ! function_exists('form_prep'))
{
/**
* Form Prep
*
* Formats text so that it can be safely placed in a form field in the event it has HTML tags.
*
* @deprecated 3.0.0 An alias for html_escape()
* @param string|string[] $str Value to escape
* @return string|string[] Escaped values
*/
function form_prep($str)
{
return html_escape($str, TRUE);
}
}

// ------------------------------------------------------------------------

if ( ! function_exists('set_value'))
{
/**
Expand Down
34 changes: 34 additions & 0 deletions system/helpers/html_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,37 @@ function meta($name = '', $content = '', $type = 'name', $newline = "\n")
return $str;
}
}

// ------------------------------------------------------------------------

if ( ! function_exists('br'))
{
/**
* Generates HTML BR tags based on number supplied
*
* @deprecated 3.0.0 Use str_repeat() instead
* @param int $count Number of times to repeat the tag
* @return string
*/
function br($count = 1)
{
return str_repeat('<br />', $count);
}
}

// ------------------------------------------------------------------------

if ( ! function_exists('nbs'))
{
/**
* Generates non-breaking space entities based on number supplied
*
* @deprecated 3.0.0 Use str_repeat() instead
* @param int
* @return string
*/
function nbs($num = 1)
{
return str_repeat('&nbsp;', $num);
}
}
23 changes: 23 additions & 0 deletions system/helpers/security_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,29 @@ function sanitize_filename($filename)

// ------------------------------------------------------------------------

if ( ! function_exists('do_hash'))
{
/**
* Hash encode a string
*
* @deprecated 3.0.0 Use PHP's native hash() instead.
* @param string $str
* @param string $type = 'sha1'
* @return string
*/
function do_hash($str, $type = 'sha1')
{
if ( ! in_array(strtolower($type), hash_algos()))
{
$type = 'md5';
}

return hash($type, $str);
}
}

// ------------------------------------------------------------------------

if ( ! function_exists('strip_image_tags'))
{
/**
Expand Down
Loading
Loading