dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse

This website has run out of funding so feel free to contribute if you can afford it (see footer)

Author Topic: PHP 7.4 issues and their code changes  (Read 1970 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 6648
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Yesterday at 05:53:23 PM
  • Deeply Confused Learner
  • Profession: IT Engineer
PHP 7.4 issues and their code changes
« on: May 30, 2021, 01:49:30 PM »
The following changes were made and tested in a PHP 7.4 system (make backups of the files first !):

mod: Post and PM Inline Attachments   5.10

error:
Code: [Select]
8192: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence
File: /var/www/html/Sources/Subs-InlineAttachmentsAdmin.php
Line: 292

in ./Sources/Subs-InlineAttachmentsAdmin.php:

find:
Code: [Select]
<input type="hidden" name="count2" value="' . $context['ila_completed'] + ($count - $start). '" />
replace:
Code: [Select]
<input type="hidden" name="count2" value="' . ($context['ila_completed'] + ($count - $start)). '" />


mod: Advanced Reputation System   1.8.3 (originates from install.xml)

error:
Code: [Select]
8192: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
File: /var/www/html/Themes/default/Display.template.php
Line: 50

in ./Themes/default/Display.template.php:

find:
Code: [Select]
<input type="radio" name="type" value="disagree"', !$context['can_neg_rep'] ? ' disabled="disabled"' : !$context['can_pos_rep'] ? ' checked="checked"' : '', ' /> ', $txt['karma_disagree'], '
replace:
Code: [Select]
<input type="radio" name="type" value="disagree"', (!$context['can_neg_rep'] ? ' disabled="disabled"' : !$context['can_pos_rep']) ? ' checked="checked"' : '', ' /> ', $txt['karma_disagree'], '


mod: Resize Attached Images   (final)

error:
Code: [Select]
8: Trying to access array offset on value of type bool
File: /var/www/html/Sources/Subs-Post.php
Line: 2322

in ./Sources/Subs-Post.php:

find:
Code: [Select]
                if (!empty($size['mime']))
                        $mime = $size['mime'];
                elseif (isset($validImageTypes[$size[2]]))
                        $mime = 'image/' . $validImageTypes[$size[2]];
                else
                        $mime = '';

replace:
Code: [Select]
                if (!empty($size['mime']))
                        $mime = $size['mime'];
                elseif  ($size != false) {
                                if (isset($validImageTypes[$size[2]]))
                                $mime = 'image/' . $validImageTypes[$size[2]];
                                else
                                        $mime = '';
                        }
                else
                        $mime = '';
« Last Edit: May 30, 2021, 05:25:33 PM by Chip »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal