Skip to content

Commit

Permalink
Updates for PHP 8.1.x; release of CPG 1.6.18
Browse files Browse the repository at this point in the history
  • Loading branch information
ron4mac committed Mar 25, 2022
1 parent 7a09680 commit 032ae66
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 124 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
=========
Expand All @@ -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}
Expand Down
27 changes: 12 additions & 15 deletions db_ecard.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2016 Coppermine Dev Team
v1.0 originally written by Gregory Demar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.6.03
$HeadURL$
**********************************************/
/**
* Coppermine Photo Gallery
*
* v1.0 originally written by Gregory Demar
*
* @copyright Copyright (c) 2003-2022 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* db_ecard.php
* @since 1.6.18
*/

define('IN_COPPERMINE', true);
define('DB_ECARD_PHP', true);
Expand Down Expand Up @@ -333,7 +330,7 @@ function cpgGetUrlVars($exception)

while ($line = $result->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
Expand Down
44 changes: 22 additions & 22 deletions include/cpg16x.files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<file_data>
<element>
<fullpath>CHANGELOG.txt</fullpath>
<version>1.6.17</version>
<version>1.6.18</version>
<status>optional</status>
<permission>read</permission>
<hash>8d101e6a987a5b8f02c4fea0b7bd1e15</hash>
<hash>faa52db17c8783811659c0ca8324b8ce</hash>
</element>
<element>
<fullpath>LICENSE.txt</fullpath>
Expand Down Expand Up @@ -291,10 +291,10 @@
</element>
<element>
<fullpath>db_ecard.php</fullpath>
<version>1.6.03</version>
<version>1.6.18</version>
<status>mandatory</status>
<permission>read</permission>
<hash>92d8b29f15ff9232e9a5304c8afa519b</hash>
<hash>356596aec52497c1b1719f49459a989e</hash>
</element>
<element>
<fullpath>db_input.php</fullpath>
Expand Down Expand Up @@ -5301,10 +5301,10 @@
</element>
<element>
<fullpath>include/debugger.inc.php</fullpath>
<version>1.6.03</version>
<version>1.6.18</version>
<status>mandatory</status>
<permission>read</permission>
<hash>3a61d1db4a78751d8455cb83a35a702a</hash>
<hash>081915a5b2bdae03108ae94565b367eb</hash>
</element>
<element>
<fullpath>include/exif.php</fullpath>
Expand All @@ -5322,10 +5322,10 @@
</element>
<element>
<fullpath>include/functions.inc.php</fullpath>
<version>1.6.14</version>
<version>1.6.18</version>
<status>mandatory</status>
<permission>read</permission>
<hash>5a115d5aadc473300a46cba32daf11e5</hash>
<hash>ed590c45811e32ab24bdf8058b7115c0</hash>
</element>
<element>
<fullpath>include/imageObjectGD.class.php</fullpath>
Expand Down Expand Up @@ -5371,10 +5371,10 @@
</element>
<element>
<fullpath>include/init.inc.php</fullpath>
<version>1.6.17</version>
<version>1.6.18</version>
<status>mandatory</status>
<permission>read</permission>
<hash>84b13a816343e59c45cc2e5f471b2dcf</hash>
<hash>bdfef470fcf63d0f51f8943c00a70eb7</hash>
</element>
<element>
<fullpath>include/inspekt.php</fullpath>
Expand Down Expand Up @@ -5450,10 +5450,10 @@
</element>
<element>
<fullpath>include/logger.inc.php</fullpath>
<version>1.6.16</version>
<version>1.6.18</version>
<status>mandatory</status>
<permission>read</permission>
<hash>46159918122f637fa0b43cfbd5964e76</hash>
<hash>f13ac527002944ba2a13a745de23ddea</hash>
</element>
<element>
<fullpath>include/mailer.inc.php</fullpath>
Expand Down Expand Up @@ -7193,31 +7193,31 @@
</element>
<element>
<fullpath>lang/english.php</fullpath>
<version>1.6.10</version>
<version>1.6.18</version>
<status>mandatory</status>
<permission>read</permission>
<hash>569142ad5d7d51446418c54c2a2fff3d</hash>
<hash>89a6ef29d3fb138b47632d2acb8d28b0</hash>
</element>
<element>
<fullpath>lang/estonian.php</fullpath>
<version>1.6.07</version>
<version>1.6.18</version>
<status>optional</status>
<permission>read</permission>
<hash>2ce7f4ec91554d049d98472fcce3e6db</hash>
<hash>c9fd32b00700e1429b0e8a6d87e1fcd7</hash>
</element>
<element>
<fullpath>lang/french.php</fullpath>
<version>1.6.06</version>
<version>1.6.18</version>
<status>optional</status>
<permission>read</permission>
<hash>69eae632c5121e8ae1b0080cca595622</hash>
<hash>66748b5d2d27cc8f2d52cdfd8fa198ea</hash>
</element>
<element>
<fullpath>lang/german.php</fullpath>
<version>1.6.06</version>
<version>1.6.18</version>
<status>optional</status>
<permission>read</permission>
<hash>768aa9269156e229308cfae7793aa588</hash>
<hash>0445d0e2cad89d65cd8bab24c755559c</hash>
</element>
<element>
<fullpath>lang_check.php</fullpath>
Expand Down Expand Up @@ -7991,10 +7991,10 @@
</element>
<element>
<fullpath>stat_details.php</fullpath>
<version>1.6.15</version>
<version>1.6.18</version>
<status>mandatory</status>
<permission>read</permission>
<hash>6813e9822aaa296ae2c0cd8cc0552def</hash>
<hash>e64b89cd4db2c2e9add0a0cde42e7f15</hash>
</element>
<element>
<fullpath>themes/</fullpath>
Expand Down
29 changes: 13 additions & 16 deletions include/debugger.inc.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2016 Coppermine Dev Team
v1.0 originally written by Gregory Demar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.6.03
$HeadURL$
**********************************************/
/**
* Coppermine Photo Gallery
*
* v1.0 originally written by Gregory Demar
*
* @copyright Copyright (c) 2003-2022 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* include/debugger.inc.php
* @since 1.6.18
*/

if (!defined('E_STRICT')) {
define('E_STRICT', 2048); // PHP 5
Expand Down Expand Up @@ -42,7 +39,7 @@ function __construct($log = 'debug.log') {

function start() {
if (!$this->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);
Expand Down Expand Up @@ -75,7 +72,7 @@ function stop() {
// ini_set('error_log', $this->old_error_log);
}
$this->active = false;
return $this->report;
return $this->report ?: false;
}
}

Expand Down
19 changes: 11 additions & 8 deletions include/functions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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 )";
Expand Down Expand Up @@ -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 )";
Expand Down
6 changes: 3 additions & 3 deletions include/init.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
6 changes: 3 additions & 3 deletions include/logger.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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...');

Expand Down Expand Up @@ -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');
Expand Down
22 changes: 11 additions & 11 deletions lang/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -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...');
Expand All @@ -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*');
Expand Down
Loading

0 comments on commit 032ae66

Please sign in to comment.