Skip to main content
Topic: Attachment settings error (Read 4375 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic. Redirected from MOVED: Attachment settings error

Attachment settings error

When i tried to open the attachment settings, i get this error.

attach.PNG

Re: Attachment settings error

Reply #1

Version of php? 7.2 right?
I remember similar reports for other places, I don't remember if this one was reported yet.

You can replace any instance of:
Code: [Select]
count($modSettings['attachmentUploadDir']) == 1
with:
Code: [Select]
(is_array($modSettings['attachmentUploadDir']) && count($modSettings['attachmentUploadDir']) == 1)
in /sources/admin/ManageAttachments.controller.php


Re: Attachment settings error

Reply #3

Might be a idea to use is_countable from php 7.3 and this polyfill

Code: [Select]
if (PHP_VERSION_ID < 70300) {
    if (!function_exists('is_countable')) {
        function is_countable($var) {
            return is_array($var) || $var instanceof Countable || $var instanceof ResourceBundle || $var instanceof SimpleXmlElement;
        }
    }
}

Re: Attachment settings error

Reply #4

Yes, thank you, that was it. :)
Is there a new BBC tag for this or do I have to write something in the text like [attach] ?


Re: Attachment settings error

Reply #6

Ooops, you're right. I'll post it in the other too.

Re: Attachment settings error

Reply #7

Quote from: emanuele – Version of php? 7.2 right?
I remember similar reports for other places, I don't remember if this one was reported yet.

You can replace any instance of:
Code: [Select]
count($modSettings['attachmentUploadDir']) == 1
with:
Code: [Select]
(is_array($modSettings['attachmentUploadDir']) && count($modSettings['attachmentUploadDir']) == 1)
in /sources/admin/ManageAttachments.controller.php

Has this been committed in 1.1.4?