Skip to content

Commit

Permalink
additional adjustments made to accommodate use with PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
ron4mac committed Oct 7, 2021
1 parent f632b16 commit eeeee3e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 39 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 3 or later; see LICENSE
*
* CHANGELOG.txt
* @since 1.6.14
* @since 1.6.15
*/
Changelog
=========
Expand All @@ -20,6 +20,7 @@ Changelog
[S] = Security fix (issues that are related to security)
*********************************************

2021-10-07 [B] Correct some additional issues when running with PHP 8 {ron4mac}
2021-09-24 [B] Correct conditions causing failures under PHP 8 {ron4mac}
2021-09-24 [A] Added re_key admin tool to distribution {ron4mac}
2021-08-18 [S] Remove possibility of XSS injection in upload_h5a plugin {ron4mac}
Expand Down
6 changes: 3 additions & 3 deletions displayimage.php
Expand Up @@ -4,11 +4,11 @@
*
* v1.0 originally written by Gregory Demar
*
* @copyright Copyright (c) 2003-2020 Coppermine Dev Team
* @copyright Copyright (c) 2003-2021 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* displayimage.php
* @since 1.6.08
* @since 1.6.15
*/

define('IN_COPPERMINE', true);
Expand Down Expand Up @@ -378,7 +378,7 @@ function html_picinfo()
$CURRENT_PIC_DATA = $pic_data[$pos];
}

if (!$superCage->get->keyExists('fullsize') && !$superCage->get->keyExists('ajax_show') && !count($CURRENT_PIC_DATA)) {
if (!$superCage->get->keyExists('fullsize') && !$superCage->get->keyExists('ajax_show') && empty($CURRENT_PIC_DATA)) {
cpg_die(ERROR, $lang_errors['non_exist_ap'], __FILE__, __LINE__);
}

Expand Down
15 changes: 11 additions & 4 deletions editpics.php
Expand Up @@ -4,11 +4,11 @@
*
* v1.0 originally written by Gregory Demar
*
* @copyright Copyright (c) 2003-2020 Coppermine Dev Team
* @copyright Copyright (c) 2003-2021 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* editpics.php
* @since 1.6.09
* @since 1.6.15
*/

define('IN_COPPERMINE', true);
Expand Down Expand Up @@ -420,10 +420,18 @@ function form_pic_info($text)
$loop_counter = 0;
}

$thumb_block = <<<EOT
<a href="$thumb_link" target="_blank"><img src="$thumb_url" class="image" border="0" alt="" /></a><br />
<span{$isgalleryicon_disabled}><input type="radio" name="galleryicon" id="galleryicon{$CURRENT_PIC['pid']}" value="{$CURRENT_PIC['pid']}" {$isgalleryicon_selected}class="checkbox" /><label for="galleryicon{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['gallery_icon']}</label></span>
EOT;

if ($CURRENT_PIC['approved'] == 'YES') {
$pic_approval_checked = 'checked="checked"';
} else {
$pic_approval_checked = '';
if (!GALLERY_ADMIN_MODE && !MODERATOR_MODE) {
$thumb_block = '<img src="'.$thumb_url.'" class="image" border="0" alt="" /><br /><span style="color:red;background-color:white">'.$lang_editpics_php['unapproved'].'</span>';
}
}

// The approve checkbox is shown only if the user is admin or moderator.
Expand Down Expand Up @@ -487,8 +495,7 @@ function form_pic_info($text)
$pic_info
</td>
<td class="{$row_style_class}" align="center" rowspan="$THUMB_ROWSPAN">
<a href="$thumb_link" target="_blank"><img src="$thumb_url" class="image" border="0" alt="" /></a><br />
<span{$isgalleryicon_disabled}><input type="radio" name="galleryicon" id="galleryicon{$CURRENT_PIC['pid']}" value="{$CURRENT_PIC['pid']}" {$isgalleryicon_selected}class="checkbox" /><label for="galleryicon{$CURRENT_PIC['pid']}" class="clickable_option">{$lang_editpics_php['gallery_icon']}</label></span>
$thumb_block
</td>
</tr>
Expand Down
24 changes: 12 additions & 12 deletions include/cpg16x.files.xml
Expand Up @@ -2,10 +2,10 @@
<file_data>
<element>
<fullpath>CHANGELOG.txt</fullpath>
<version>1.6.14</version>
<version>1.6.15</version>
<status>optional</status>
<permission>read</permission>
<hash>5c0283aec629ace6fce09029802df16d</hash>
<hash>2697c05ca639cc8f152380f2736d571f</hash>
</element>
<element>
<fullpath>LICENSE.txt</fullpath>
Expand Down Expand Up @@ -319,10 +319,10 @@
</element>
<element>
<fullpath>displayimage.php</fullpath>
<version>1.6.08</version>
<version>1.6.15</version>
<status>mandatory</status>
<permission>read</permission>
<hash>39cfdfc6ad5d3d392fd27158527e7d64</hash>
<hash>b90fe2ec8e7dd4890af2b725f1d932f4</hash>
</element>
<element>
<fullpath>displayreport.php</fullpath>
Expand Down Expand Up @@ -356,10 +356,10 @@
</element>
<element>
<fullpath>editpics.php</fullpath>
<version>1.6.09</version>
<version>1.6.15</version>
<status>mandatory</status>
<permission>read</permission>
<hash>873c007e00fe55f964ba973cbb87d86f</hash>
<hash>0b12fa0e5d4248b54aaa811f50c6f49d</hash>
</element>
<element>
<fullpath>exifmgr.php</fullpath>
Expand Down Expand Up @@ -5371,10 +5371,10 @@
</element>
<element>
<fullpath>include/init.inc.php</fullpath>
<version>1.6.14</version>
<version>1.6.15</version>
<status>mandatory</status>
<permission>read</permission>
<hash>beccd4df2bde57c62f36a664e94f7d06</hash>
<hash>001a5050e4e76bdf2702958d806af081</hash>
</element>
<element>
<fullpath>include/inspekt.php</fullpath>
Expand Down Expand Up @@ -5483,10 +5483,10 @@
</element>
<element>
<fullpath>include/makers/gps.php</fullpath>
<version>1.6.03</version>
<version>1.6.15</version>
<status>mandatory</status>
<permission>read</permission>
<hash>f1bf13b8226bb2d5194e4e703d6e283b</hash>
<hash>9816af87f6c9f60f4c62cc6138a8c450</hash>
</element>
<element>
<fullpath>include/makers/nikon.php</fullpath>
Expand Down Expand Up @@ -7991,10 +7991,10 @@
</element>
<element>
<fullpath>stat_details.php</fullpath>
<version>1.6.14</version>
<version>1.6.15</version>
<status>mandatory</status>
<permission>read</permission>
<hash>d4c1b1b77a8fc60bf407daafb791bd06</hash>
<hash>6813e9822aaa296ae2c0cd8cc0552def</hash>
</element>
<element>
<fullpath>themes/</fullpath>
Expand Down
4 changes: 2 additions & 2 deletions include/init.inc.php
Expand Up @@ -8,10 +8,10 @@
* @license GNU General Public License version 3 or later; see LICENSE
*
* include/init.inc.php
* @since 1.6.14
* @since 1.6.15
*/

define('COPPERMINE_VERSION', '1.6.14');
define('COPPERMINE_VERSION', '1.6.15');
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
27 changes: 12 additions & 15 deletions include/makers/gps.php
@@ -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-2021 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* include/makers/gps.php
* @since 1.6.15
*/
//================================================================================================
//================================================================================================
//================================================================================================
Expand Down Expand Up @@ -94,7 +91,7 @@ function formatGPSData($type,$tag,$intel,$data) {

if($type=="ASCII") {
if($tag=="0001" || $tag=="0003"){ // Latitude Reference, Longitude Reference
$data = ($data{1} == $data{2} && $data{1} == $data{3}) ? $data{0} : $data;
$data = ($data[1] == $data[2] && $data[1] == $data[3]) ? $data[0] : $data;
}

} else if($type=="URATIONAL" || $type=="SRATIONAL") {
Expand Down
4 changes: 2 additions & 2 deletions stat_details.php
Expand Up @@ -8,7 +8,7 @@
* @license GNU General Public License version 3 or later; see LICENSE
*
* stat_details.php
* @since 1.6.14
* @since 1.6.15
*/

// Todo list (stuff the hasn't been implemented yet):
Expand Down Expand Up @@ -36,7 +36,7 @@
if ($superCage->get->keyExists('pid')){
$pid = $superCage->get->getInt('pid');
} else {
$pid = 0;
$pid = '';
}
$type_allowed = array('vote','hits','total','blank','users');
$amount_allowed = array(20,50,100,200);
Expand Down

0 comments on commit eeeee3e

Please sign in to comment.