Fixed php 5.4 bug

  • Thread starter Thread starter ragtek
  • Start date Start date
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
 
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. :)
 
I think we've established that the error is still there, but only visible in debug mode... Or am I thinking of something else?

Correct, It's that it was marked as solved and I wasn't sure if it's for the next release or the past 1.1.3, so I reported just in case ;)
 
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 :)
 
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:
 
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).
 
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 Bottom