Skip to content

Commit

Permalink
correct failure in bridgemgr for PHP 8; CPG 1.6.19
Browse files Browse the repository at this point in the history
  • Loading branch information
ron4mac committed May 3, 2022
1 parent 6d09708 commit 3354bae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Changelog
[S] = Security fix (issues that are related to security)
*********************************************

2022-05-03 [B] Correct failure in bridgemgr for PHP 8 {ron4mac}
2022-04-01 [B] Reset failure report mode in mysqli for PHP 8.1 {ron4mac}
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}
Expand Down
14 changes: 8 additions & 6 deletions bridgemgr.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-2020 Coppermine Dev Team
* @copyright Copyright (c) 2003-2022 Coppermine Dev Team
* @license GNU General Public License version 3 or later; see LICENSE
*
* bridgemgr.php
* @since 1.6.08
* @since 1.6.19
*/

define('IN_COPPERMINE', true);
Expand All @@ -21,11 +21,13 @@
function write_to_db($step) {
global $BRIDGE,$CONFIG,$default_bridge_data,$lang_bridgemgr_php, $posted_var, $LINEBREAK;
$error = 0;
$return = [];
// do the check for plausibility of posted data
foreach($posted_var as $key => $value) { // loop through the posted data -- start
// filter the post data that doesn't get written
if (array_key_exists($key, $BRIDGE)) { // post data exists as db key -- start
// do the lookups
if (empty($default_bridge_data[$BRIDGE['short_name']][$key.'_used'])) continue;
$options = explode(',', $default_bridge_data[$BRIDGE['short_name']][$key.'_used']);
foreach($options as $key2) {
$options[$key2] = trim($options[$key2], ','); // get rid of the delimiters
Expand Down Expand Up @@ -110,7 +112,7 @@ function write_to_db($step) {
print $key . '|' . $value;
print '<br /></span>';
}
if ($return[$key] != '') {
if (!empty($return[$key])) {
//print '|Error in this key';
} else {
cpg_db_query("UPDATE {$CONFIG['TABLE_BRIDGE']} SET value = '$value' WHERE name = '$key'");
Expand All @@ -131,7 +133,7 @@ function write_to_db($step) {
}

// ouput error messages, if any
if (is_array($return)) {
if (!empty($return)) {
starttable(-1, $lang_bridgemgr_php['error_title']);
print '<tr><td class="tableb" align="left"><ul>';
foreach($return as $key) {
Expand All @@ -147,7 +149,7 @@ function write_to_db($step) {
$error = 1;
}
print '<br />';
if ($error != '') {return 'error';}
if ($error) {return 'error';}
}

function cpg_check_allowed_emergency_logon($timestamp,$failures = '') {
Expand Down Expand Up @@ -431,7 +433,7 @@ function cpg_is_writable($folder)
foreach($loop_array as $key) {
$prefill = cpg_bridge_prefill($BRIDGE['short_name'],$key);
if ($key == 'relative_path_of_forum_from_webroot') {
$minibrowser = '<a href="javascript:;" onclick="MM_openBrWindow(\'minibrowser.php?startfolder='.rawurlencode($prefill).'&amp;parentform='.rawurlencode($step).'&amp;formelementname='.rawurlencode($key).'\',\''.uniqid(rand()) .'\',\'scrollbars=yes,toolbar=no,status=no,locationbar=no,resizable=yes,width=600,height=400\')">' . $folder_icon . '</a>';
$minibrowser = '<a href="javascript:;" onclick="MM_openBrWindow(\'minibrowser.php?startfolder='.rawurlencode($prefill?:'').'&amp;parentform='.rawurlencode($step).'&amp;formelementname='.rawurlencode($key).'\',\''.uniqid(rand()) .'\',\'scrollbars=yes,toolbar=no,status=no,locationbar=no,resizable=yes,width=600,height=400\')">' . $folder_icon . '</a>';
} else {
$minibrowser = '';
}
Expand Down
14 changes: 7 additions & 7 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.18</version>
<version>1.6.19</version>
<status>optional</status>
<permission>read</permission>
<hash>faa52db17c8783811659c0ca8324b8ce</hash>
<hash>fd5a3a5685f1e17019743da38c67c778</hash>
</element>
<element>
<fullpath>LICENSE.txt</fullpath>
Expand Down Expand Up @@ -219,10 +219,10 @@
</element>
<element>
<fullpath>bridgemgr.php</fullpath>
<version>1.6.08</version>
<version>1.6.19</version>
<status>mandatory</status>
<permission>read</permission>
<hash>1520f0836c9660180b2dcad4feb35321</hash>
<hash>1244443af7b96f50c20d479986a07165</hash>
</element>
<element>
<fullpath>calendar.php</fullpath>
Expand Down Expand Up @@ -5264,7 +5264,7 @@
<version>1.6.19</version>
<status>mandatory</status>
<permission>read</permission>
<hash>84ed66a5836cb7312f9e65854683add0</hash>
<hash>01d04e3cf797275751cd53a6686817aa</hash>
</element>
<element>
<fullpath>include/database/mysqli/install.php</fullpath>
Expand Down Expand Up @@ -5371,10 +5371,10 @@
</element>
<element>
<fullpath>include/init.inc.php</fullpath>
<version>1.6.18</version>
<version>1.6.19</version>
<status>mandatory</status>
<permission>read</permission>
<hash>bdfef470fcf63d0f51f8943c00a70eb7</hash>
<hash>a6ba285bea4b5221f1b5425e6bf198a7</hash>
</element>
<element>
<fullpath>include/inspekt.php</fullpath>
Expand Down
2 changes: 1 addition & 1 deletion include/init.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @license GNU General Public License version 3 or later; see LICENSE
*
* include/init.inc.php
* @since 1.6.18
* @since 1.6.19
*/

define('COPPERMINE_VERSION', '1.6.19');
Expand Down

0 comments on commit 3354bae

Please sign in to comment.