Skip to content

Commit ea2d95f

Browse files
authored
Merge pull request #68 from tinoest/master
Fixes for PHP 8.0 and typecase logic
2 parents d264f7f + 3376c3a commit ea2d95f

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

TinyPortal/Controller/ArticleAdmin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1285,10 +1285,10 @@ public function action_settings() {{{
12851285
$checkboxes = array('use_wysiwyg', 'use_dragdrop', 'hide_editarticle_link', 'print_articles', 'allow_links_article_comments', 'hide_article_facebook', 'hide_article_twitter', 'hide_article_reddit', 'hide_article_digg', 'hide_article_delicious', 'hide_article_stumbleupon');
12861286
foreach($checkboxes as $v) {
12871287
if(TPUtil::checkboxChecked('tp_'.$v)) {
1288-
$updateArray[$v] = "1";
1288+
$updateArray[$v] = 1;
12891289
}
12901290
else {
1291-
$updateArray[$v] = "";
1291+
$updateArray[$v] = 0;
12921292
}
12931293
// remove the variable so we don't process it twice before the old logic is removed
12941294
unset($_POST['tp_'.$v]);

TinyPortal/Controller/BlockAdmin.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,10 @@ public function action_panels() {{{
713713
$checkboxes = array('hidebars_admin_only', 'hidebars_profile', 'hidebars_pm', 'hidebars_memberlist', 'hidebars_search', 'hidebars_calendar');
714714
foreach($checkboxes as $v) {
715715
if(TPUtil::checkboxChecked('tp_'.$v)) {
716-
$updateArray[$v] = "1";
716+
$updateArray[$v] = 1;
717717
}
718718
else {
719-
$updateArray[$v] = "";
719+
$updateArray[$v] = 0;
720720
}
721721
// remove the variable so we don't process it twice before the old logic is removed
722722
unset($_POST['tp_'.$v]);

TinyPortal/Controller/PortalAdmin.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ public function update_settings() {{{
117117
$checkboxes = array('imageproxycheck', 'admin_showblocks', 'oldsidebar', 'disable_template_eval', 'fulltextsearch', 'hideadminmenu', 'useroundframepanels', 'showcollapse', 'blocks_edithide', 'uselangoption', 'use_groupcolor', 'showstars');
118118
foreach($checkboxes as $v) {
119119
if(TPUtil::checkboxChecked('tp_'.$v)) {
120-
$updateArray[$v] = "1";
120+
$updateArray[$v] = 1;
121121
}
122122
else {
123-
$updateArray[$v] = "";
123+
$updateArray[$v] = 0;
124124
}
125125
// remove the variable so we don't process it twice before the old logic is removed
126126
unset($_POST['tp_'.$v]);
@@ -219,10 +219,10 @@ public function update_frontpage() {{{
219219
$checkboxes = array('allow_guestnews', 'forumposts_avatar', 'use_attachment');
220220
foreach($checkboxes as $v) {
221221
if(TPUtil::checkboxChecked('tp_'.$v)) {
222-
$updateArray[$v] = "1";
222+
$updateArray[$v] = 1;
223223
}
224224
else {
225-
$updateArray[$v] = "";
225+
$updateArray[$v] = 0;
226226
}
227227
// remove the variable so we don't process it twice before the old logic is removed
228228
unset($_POST['tp_'.$v]);

0 commit comments

Comments
 (0)