Fixed php 5.4 bug

R

ragtek

Guest
#42
hmmmmm, i've fixed it with:


removing in template attachment_editor

Code:
<xen:set var="$attachment"></xen:set>
WHY do we need here a empty variable $attachment?

because xenforo isn't trying to access $attachment['thumbnailUrl'] and the other non existing array elements, i don't get the error anymore:)

also i hadn't noticed any other "bad" side effects
 

Adam Howard

Well-known member
#43
hmmmmm, i've fixed it with:


removing in template attachment_editor

Code:
<xen:set var="$attachment"></xen:set>
WHY do we need here a empty variable $attachment?

because xenforo isn't trying to access $attachment['thumbnailUrl'] and the other non existing array elements, i don't get the error anymore:)

also i hadn't noticed any other "bad" side effects
... It was once used for something.... But I think no longer.... (XenForo's 1st signs of having old code left in?)

I can confirm that removing that resolves things. :)
 

Chris D

XenForo developer
Staff member
#53
Mike said a band-aid was applied.

I assumed this was suppressing the error so it only appears in Debug.

I cannot verify right now, but I assume the error appeared publicly in 1.1.2... either way, this still needs attention :)
 

MattW

Well-known member
#54
Mike said a band-aid was applied.

I assumed this was suppressing the error so it only appears in Debug.

I cannot verify right now, but I assume the error appeared publicly in 1.1.2... either way, this still needs attention :)
Just installed copy of 1.1.2, and it's only present with debug enabled (but the error is larger):

Code:
Template Errors: thread_create
Illegal string offset 'thumbnailUrl' in /home/nginx/domains/dev.z22se.com/public/xf112/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 410:
409: <li id="' . (($__compilerVar12) ? ('AttachedFileTemplate') : ('attachment' . htmlspecialchars($__compilerVar13['attachment_id']))) . '"
410:    class="AttachedFile ' . (($__compilerVar13['thumbnailUrl']) ? ('AttachedImage') : ('')) . ' secondaryContent">
411:
Illegal string offset 'thumbnailUrl' in /home/nginx/domains/dev.z22se.com/public/xf112/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 414:
413:        ';
414: if ($__compilerVar13['thumbnailUrl'])
415: {
Illegal string offset 'filename' in /home/nginx/domains/dev.z22se.com/public/xf112/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 429:
428: $__compilerVar14 .= '
429:            <!--<img src="' . XenForo_Template_Helper_Core::styleProperty('imagePath') . '/xenforo/widgets/page.png" alt="' . htmlspecialchars($__compilerVar13['filename']) . '" />-->
430:            <span class="genericAttachment"></span>
Illegal string offset 'filename' in /home/nginx/domains/dev.z22se.com/public/xf112/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 437:
436:    <div class="AttachmentText">
437:        <div class="Filename"><a href="' . XenForo_Template_Helper_Core::link('attachments', $__compilerVar13, array()) . '" target="_blank">' . htmlspecialchars($__compilerVar13['filename']) . '</a></div>
438:
 

Adam Howard

Well-known member
#57
Is this new to PHP 5.5? Or is it exactly the same as the other bug? Why does this have a separate report?
While it is the same issue, the underline cause maybe or may not be the same, based upon two different versions of php.

It gets it's own thread because it is related to php 5.5 (not php 5.4).
 

Alfa1

Well-known member
#60
Mhm. This may get tricky if no patch is released before PHP 5.3 goes EOL next month. A lot of hosts will move to PHP 5.4 and even 5.5. I would expect XF will receive a lot of support requests if this is not patched.
 
Top