diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 849ee474..283a9e06 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,11 +3,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2021 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * CHANGELOG.txt - * @since 1.6.17 + * @since 1.6.18 */ Changelog ========= @@ -20,6 +20,7 @@ Changelog [S] = Security fix (issues that are related to security) ********************************************* +2022-03-25 [M] Updates for PHP 8.1.x; remove use of strftime() {ron4mac} 2022-02-02 [B] Handle failure to get image dimensions in thumb updater tool {ron4mac} 2021-11-22 [B] Allow ratings from different logged in users regardless of IP address {ron4mac} 2021-11-20 [M] Update third party (ZenPhoto maintained) exif reader {ron4mac} diff --git a/db_ecard.php b/db_ecard.php index 25153b55..ec767686 100644 --- a/db_ecard.php +++ b/db_ecard.php @@ -1,18 +1,15 @@ fetchAssoc()) { - $date = strftime($lang_date['lastcom'], $line['date']); + $date = date($lang_date['lastcom'], $line['date']); list($line['ip_detail']) = CPGPluginAPI::filter('ip_information', array('', $line['sender_ip'])); echo <<< EOT diff --git a/include/cpg16x.files.xml b/include/cpg16x.files.xml index 32944830..5dfcf861 100644 --- a/include/cpg16x.files.xml +++ b/include/cpg16x.files.xml @@ -2,10 +2,10 @@ CHANGELOG.txt - 1.6.17 + 1.6.18 optional read - 8d101e6a987a5b8f02c4fea0b7bd1e15 + faa52db17c8783811659c0ca8324b8ce LICENSE.txt @@ -291,10 +291,10 @@ db_ecard.php - 1.6.03 + 1.6.18 mandatory read - 92d8b29f15ff9232e9a5304c8afa519b + 356596aec52497c1b1719f49459a989e db_input.php @@ -5301,10 +5301,10 @@ include/debugger.inc.php - 1.6.03 + 1.6.18 mandatory read - 3a61d1db4a78751d8455cb83a35a702a + 081915a5b2bdae03108ae94565b367eb include/exif.php @@ -5322,10 +5322,10 @@ include/functions.inc.php - 1.6.14 + 1.6.18 mandatory read - 5a115d5aadc473300a46cba32daf11e5 + ed590c45811e32ab24bdf8058b7115c0 include/imageObjectGD.class.php @@ -5371,10 +5371,10 @@ include/init.inc.php - 1.6.17 + 1.6.18 mandatory read - 84b13a816343e59c45cc2e5f471b2dcf + bdfef470fcf63d0f51f8943c00a70eb7 include/inspekt.php @@ -5450,10 +5450,10 @@ include/logger.inc.php - 1.6.16 + 1.6.18 mandatory read - 46159918122f637fa0b43cfbd5964e76 + f13ac527002944ba2a13a745de23ddea include/mailer.inc.php @@ -7193,31 +7193,31 @@ lang/english.php - 1.6.10 + 1.6.18 mandatory read - 569142ad5d7d51446418c54c2a2fff3d + 89a6ef29d3fb138b47632d2acb8d28b0 lang/estonian.php - 1.6.07 + 1.6.18 optional read - 2ce7f4ec91554d049d98472fcce3e6db + c9fd32b00700e1429b0e8a6d87e1fcd7 lang/french.php - 1.6.06 + 1.6.18 optional read - 69eae632c5121e8ae1b0080cca595622 + 66748b5d2d27cc8f2d52cdfd8fa198ea lang/german.php - 1.6.06 + 1.6.18 optional read - 768aa9269156e229308cfae7793aa588 + 0445d0e2cad89d65cd8bab24c755559c lang_check.php @@ -7991,10 +7991,10 @@ stat_details.php - 1.6.15 + 1.6.18 mandatory read - 6813e9822aaa296ae2c0cd8cc0552def + e64b89cd4db2c2e9add0a0cde42e7f15 themes/ diff --git a/include/debugger.inc.php b/include/debugger.inc.php index b4edee0e..2627391e 100644 --- a/include/debugger.inc.php +++ b/include/debugger.inc.php @@ -1,18 +1,15 @@ active) { - $this->report = false; + $this->report = []; if (CAN_MOD_INI) { $this->old_display_level = ini_set('display_errors', 1); $this->old_error_logging = ini_set('log_errors', 0); @@ -75,7 +72,7 @@ function stop() { // ini_set('error_log', $this->old_error_log); } $this->active = false; - return $this->report; + return $this->report ?: false; } } diff --git a/include/functions.inc.php b/include/functions.inc.php index 49fb8e6d..f9cf963c 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -4,11 +4,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2021 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * include/functions.inc.php - * @since 1.6.14 + * @since 1.6.18 */ if (!function_exists('stripos')) { @@ -542,10 +542,13 @@ function localised_date($timestamp, $datefmt) $timestamp = localised_timestamp($timestamp); - $date = str_replace(array('%a', '%A'), $lang_day_of_week[(int)strftime('%w', $timestamp)], $datefmt); - $date = str_replace(array('%b', '%B'), $lang_month[(int)strftime('%m', $timestamp)-1], $date); + $dow = '\\' . implode('\\', str_split($lang_day_of_week[(int)date('w', $timestamp)])); + $frmt = str_replace(['l','D'], '+', $datefmt); + $mon = '\\' . implode('\\', str_split($lang_month[(int)date('m', $timestamp)-1])); + $frmt = str_replace(['M','F'], '=', $frmt); + $frmt = str_replace(['+','='], [$dow,$mon], $frmt); - return strftime($date, $timestamp); + return date($frmt, $timestamp); } /** @@ -1382,7 +1385,7 @@ function get_pic_data($album, &$count, &$album_name, $limit1=-1, $limit2=-1, $se } $album_name = $album_name_keyword['title']; - $album_keyword = addslashes($album_name_keyword['keyword']); + $album_keyword = $album_name_keyword['keyword'] ? addslashes($album_name_keyword['keyword']) : ''; if (!empty($album_keyword)) { $keyword = "OR (keywords like '%$album_keyword%' $forbidden_set_string )"; @@ -2157,8 +2160,8 @@ function get_pic_pos($album, $pid) } $album_name_keyword = get_album_name($album); - //$album_name = $album_name_keyword['title']; - $album_keyword = addslashes($album_name_keyword['keyword']); + //$album_name = $album_name_keyword['title']; + $album_keyword = $album_name_keyword['keyword'] ? addslashes($album_name_keyword['keyword']) : ''; if (!empty($album_keyword)) { $keyword = "OR (keywords like '%$album_keyword%' $forbidden_set_string )"; diff --git a/include/init.inc.php b/include/init.inc.php index fe42d79e..91b45751 100644 --- a/include/init.inc.php +++ b/include/init.inc.php @@ -4,14 +4,14 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2021 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * include/init.inc.php - * @since 1.6.17 + * @since 1.6.18 */ -define('COPPERMINE_VERSION', '1.6.17'); +define('COPPERMINE_VERSION', '1.6.18'); define('COPPERMINE_VERSION_STATUS', 'stable'); // Define path to jQuery for this version of Coppermine define('CPG_JQUERY_VERSION', 'js/jquery-1.12.4.js'); diff --git a/include/logger.inc.php b/include/logger.inc.php index 15dbc4b6..8781f32a 100644 --- a/include/logger.inc.php +++ b/include/logger.inc.php @@ -4,11 +4,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2021 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * include/logger.inc.php - * @since 1.6.16 + * @since 1.6.18 */ defined('IN_COPPERMINE') or die('Not in Coppermine...'); @@ -52,7 +52,7 @@ function log_write($text, $log = null) } if (!isset($lang_date['log'])) { - $lang_date['log'] = '%Y-%m-%d %H:%M:%S'; + $lang_date['log'] = 'Y-m-d H:i:s'; } $fp = fopen($log, 'a'); diff --git a/lang/english.php b/lang/english.php index 9c72f623..064e0a47 100644 --- a/lang/english.php +++ b/lang/english.php @@ -4,11 +4,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2021 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * lang/english.php - * @since 1.6.10 + * @since 1.6.18 */ if (!defined('IN_COPPERMINE')) die('Not in Coppermine...'); @@ -34,15 +34,15 @@ $lang_month = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); // The various date formats -// See http://www.php.net/manual/en/function.strftime.php to define the variable below -$lang_date['album'] = '%B %d, %Y'; -$lang_date['lastcom'] = '%m/%d/%y at %H:%M'; -$lang_date['lastup'] = '%B %d, %Y'; -$lang_date['register'] = '%B %d, %Y'; -$lang_date['lasthit'] = '%B %d, %Y at %I:%M %p'; -$lang_date['comment'] = '%B %d, %Y at %I:%M %p'; -$lang_date['log'] = '%B %d, %Y at %I:%M %p'; -$lang_date['scientific'] = '%Y-%m-%d %H:%M:%S'; +// See https://www.php.net/manual/en/datetime.format.php to define the date format strings below +$lang_date['album'] = 'F d, Y'; +$lang_date['lastcom'] = 'm/d/y at H:i'; +$lang_date['lastup'] = 'F d, Y'; +$lang_date['register'] = 'F d, Y'; +$lang_date['lasthit'] = 'F d, Y at h:i A'; +$lang_date['comment'] = 'F d, Y at h:i A'; +$lang_date['log'] = 'F d, Y at h:i A'; +$lang_date['scientific'] = 'Y-m-d H:i:s'; // For the word censor $lang_bad_words = array('*fuck*', 'asshole', 'assramer', 'assrammer', 'bitch*', 'c0ck', 'clits', 'Cock', 'cum', 'cunt*', 'dago', 'daygo', 'dego', 'dick*', 'dildo', 'fanculo', 'feces', 'foreskin', 'Fu\(*', 'fuk*', 'honkey', 'hore', 'injun', 'kike', 'lesbo', 'masturbat*', 'motherfucker', 'nazis', 'nigger*', 'nutsack','penis', 'phuck', 'poop', 'pussy', 'scrotum', 'shit', 'slut', 'titties', 'titty', 'twaty', 'wank*', 'whore', 'wop*'); diff --git a/lang/estonian.php b/lang/estonian.php index 00d221e8..cb71b31d 100644 --- a/lang/estonian.php +++ b/lang/estonian.php @@ -4,11 +4,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2018 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * lang/estonian.php - * @since 1.6.07 + * @since 1.6.18 */ if (!defined('IN_COPPERMINE')) die('Not in Coppermine...'); @@ -34,15 +34,15 @@ $lang_month = array('jaan', 'veebr', 'märts', 'apr', 'mai', 'juuni', 'juuli', 'aug', 'sept', 'okt', 'nov', 'dets'); // The various date formats -// See http://www.php.net/manual/en/function.strftime.php to define the variable below -$lang_date['album'] = '%B %d, %Y'; -$lang_date['lastcom'] = '%m/%d/%y kell %H:%M'; -$lang_date['lastup'] = '%B %d, %Y'; -$lang_date['register'] = '%B %d, %Y'; -$lang_date['lasthit'] = '%B %d, %Y kell %I:%M %p'; -$lang_date['comment'] = '%B %d, %Y kell %I:%M %p'; -$lang_date['log'] = '%B %d, %Y kell %I:%M %p'; -$lang_date['scientific'] = '%Y-%m-%d %H:%M:%S'; +// See https://www.php.net/manual/en/datetime.format.php to define the date format strings below +$lang_date['album'] = 'F d, Y'; +$lang_date['lastcom'] = 'm/d/y \k\e\l\l H:i'; +$lang_date['lastup'] = 'F d, Y'; +$lang_date['register'] = 'F d, Y'; +$lang_date['lasthit'] = 'F d, Y \k\e\l\l h:i A'; +$lang_date['comment'] = 'F d, Y \k\e\l\l h:i A'; +$lang_date['log'] = 'F d, Y \k\e\l\l h:i A'; +$lang_date['scientific'] = 'Y-m-d H:i:s'; // For the word censor $lang_bad_words = array('*fuck*', 'asshole', 'assramer', 'assrammer', 'bitch*', 'c0ck', 'clits', 'Cock', 'cum', 'cunt*', 'dago', 'daygo', 'dego', 'dick*', 'dildo', 'fanculo', 'feces', 'foreskin', 'Fu\(*', 'fuk*', 'honkey', 'hore', 'injun', 'kike', 'lesbo', 'masturbat*', 'motherfucker', 'nazis', 'nigger*', 'nutsack','penis', 'phuck', 'poop', 'pussy', 'scrotum', 'shit', 'slut', 'titties', 'titty', 'twaty', 'wank*', 'whore', 'wop*'); diff --git a/lang/french.php b/lang/french.php index 70a6bb26..6ae3e0fb 100644 --- a/lang/french.php +++ b/lang/french.php @@ -4,11 +4,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2018 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * lang/french.php - * @since 1.6.06 + * @since 1.6.18 */ if (!defined('IN_COPPERMINE')) die('Not in Coppermine...'); @@ -34,15 +34,15 @@ $lang_month = array('Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'); // The various date formats -// See http://www.php.net/manual/en/function.strftime.php to define the variable below -$lang_date['album'] = '%d %B %Y'; -$lang_date['lastcom'] = '%d/%m/%y à %H:%M'; -$lang_date['lastup'] = '%d %B %Y'; -$lang_date['register'] = '%d %B %Y'; -$lang_date['lasthit'] = '%a %d %B %Y à %H:%M'; -$lang_date['comment'] = '%a %d %B %Y à %H:%M'; -$lang_date['log'] = '%B %d, %Y at %I:%M %p'; -$lang_date['scientific'] = '%d-%m-%Y %H:%M:%S'; +// See https://www.php.net/manual/en/datetime.format.php to define the date format strings below +$lang_date['album'] = 'd F Y'; +$lang_date['lastcom'] = 'd/m/y \à H:i'; +$lang_date['lastup'] = 'd F Y'; +$lang_date['register'] = 'd F Y'; +$lang_date['lasthit'] = 'D d F Y \à H:i'; +$lang_date['comment'] = 'D d F Y \à H:i'; +$lang_date['log'] = 'F d, Y \a\t h:i A'; +$lang_date['scientific'] = 'd-m-Y H:i:s'; // For the word censor $lang_bad_words = array('merde', 'putain', 'enculé*', 'salope', 'bite', 'cul', 'pute', 'pénis', 'clito', 'couille', 'pétasse', 'connard', 'salaud'); diff --git a/lang/german.php b/lang/german.php index 8aafe303..f7c680e9 100644 --- a/lang/german.php +++ b/lang/german.php @@ -4,11 +4,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2018 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * lang/german.php - * @since 1.6.06 + * @since 1.6.18 */ if (!defined('IN_COPPERMINE')) die('Not in Coppermine...'); @@ -34,15 +34,15 @@ $lang_month = array('Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'); // The various date formats -// See http://www.php.net/manual/en/function.strftime.php to define the variable below -$lang_date['album'] = '%d. %B %Y'; -$lang_date['lastcom'] = '%d.%m.%y um %H:%M'; -$lang_date['lastup'] = '%d. %B %Y'; -$lang_date['register'] = '%d. %B %Y'; -$lang_date['lasthit'] = '%d. %B %Y um %H:%M'; -$lang_date['comment'] = '%d. %B %Y um %H:%M'; -$lang_date['log'] = '%d. %B %Y um %H:%M'; -$lang_date['scientific'] = '%Y-%m-%d %H:%M:%S'; +// See https://www.php.net/manual/en/datetime.format.php to define the date format strings below +$lang_date['album'] = 'd. F Y'; +$lang_date['lastcom'] = 'd.m.y \u\m H:i'; +$lang_date['lastup'] = 'd. F Y'; +$lang_date['register'] = 'd. F Y'; +$lang_date['lasthit'] = 'd. F Y \u\m H:i'; +$lang_date['comment'] = 'd. F Y \u\m H:i'; +$lang_date['log'] = 'd. F Y \u\m H:i'; +$lang_date['scientific'] = 'Y-m-d H:i:s'; // For the word censor $lang_bad_words = array('*fuck*', 'Fu\(*', 'fuk*', 'masturbat*', 'motherfucker', 'nigger*', 'penis', 'pussy', 'shit', 'titties', 'titty', 'arsch*', 'fick*', 'fotze', 'votze', 'Sieg Heil', 'Heil Hitler', 'Nutte', 'Möse', 'Moese', 'Pimmel', 'Schwengel', 'Titte*', 'bums*', 'Scheiss*', 'Scheiß*'); diff --git a/stat_details.php b/stat_details.php index 102b36ba..89ca6875 100644 --- a/stat_details.php +++ b/stat_details.php @@ -4,11 +4,11 @@ * * v1.0 originally written by Gregory Demar * - * @copyright Copyright (c) 2003-2021 Coppermine Dev Team + * @copyright Copyright (c) 2003-2022 Coppermine Dev Team * @license GNU General Public License version 3 or later; see LICENSE * * stat_details.php - * @since 1.6.15 + * @since 1.6.18 */ // Todo list (stuff the hasn't been implemented yet): @@ -117,14 +117,14 @@ $date_display_fmt = $lang_date['log']; } elseif($get_date_display == 3) { $date_display = 3; - $date_display_fmt = '%Y-%m-%d %H:%M:%S'; + $date_display_fmt = 'Y-m-d H:i:s'; } else { $date_display = 4; - $date_display_fmt = '%Y-%m-%d'; + $date_display_fmt = 'Y-m-d'; } } else { $date_display = 4; - $date_display_fmt = '%Y-%m-%d'; + $date_display_fmt = 'Y-m-d'; } //if ($_GET['mode'] == 'fullscreen') { @@ -460,7 +460,7 @@ function confirmDelete() { if ($loop_counter > 1) { $loop_counter = 0; } - $row['sdate'] = strftime($date_display_fmt,localised_timestamp($row['sdate'])); + $row['sdate'] = date($date_display_fmt,localised_timestamp($row['sdate'])); $is_internal = ''; $row['referer'] = rawurldecode($row['referer']); // is it an internal reference (most should be)? @@ -558,11 +558,11 @@ function confirmDelete() { $date_display_2_selected = ($date_display == '2') ? 'selected="selected"' : ''; $date_display_3_selected = ($date_display == '3') ? 'selected="selected"' : ''; $date_display_4_selected = ($date_display == '4') ? 'selected="selected"' : ''; - $localized_time[0] = strftime($lang_date['album'],localised_timestamp(time())); - $localized_time[1] = strftime($lang_date['lastcom'],localised_timestamp(time())); - $localized_time[2] = strftime($lang_date['log'],localised_timestamp(time())); - $localized_time[3] = strftime('%Y-%m-%d %H:%M:%S',localised_timestamp(time())); - $localized_time[4] = strftime('%Y-%m-%d',localised_timestamp(time())); + $localized_time[0] = date($lang_date['album'],localised_timestamp(time())); + $localized_time[1] = date($lang_date['lastcom'],localised_timestamp(time())); + $localized_time[2] = date($lang_date['log'],localised_timestamp(time())); + $localized_time[3] = date('Y-m-d H:i:s',localised_timestamp(time())); + $localized_time[4] = date('Y-m-d',localised_timestamp(time())); foreach ($amount_allowed as $key) { } print <<< EOT