[] operator not supported for strings

Started by inter, January 25, 2018, 04:36:43 AM

Previous topic - Next topic

inter

smf 2.0.15
php 7.1

    $test = 'test';
    $test[] = 123;


Quote[] operator not supported for strings

http://.../index.php?action=admin;area=logs;sa=errorlog

Error Log  is empty!

Sorry for my English

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

d3vcho

Actually it's a known error already solved for SMF 2.1, but I don't know why we didn't apply the fix for 2.0.15

https://www.simplemachines.org/community/index.php?topic=554723.0
"Greeting Death as an old friend, they departed this life as equals"

inter

Quote from: Aleksi "Lex" Kilpinen on January 25, 2018, 04:47:16 AM
So you think you found a bug with SMF?

How to reproduce said error in a clean SMF installation?

added my code for your action function.

perhaps you do not understand - you have an error in the module, but the log does not register it. the administrator does not know about it at all. I accidentally found her yesterday and it's very unpleasant.

I at myself have corrected it so:
index.php
replace this:
// Quickly catch random exceptions.
set_exception_handler(function ($e) use ($db_show_debug)
{
if (isset($db_show_debug) && $db_show_debug === true && allowedTo('admin_forum'))
fatal_error(nl2br($e), false);
else
fatal_error($e->getMessage(), false);
});

on:
// Quickly catch random exceptions.
set_exception_handler(function ($e) use ($db_show_debug)
{
    if (isset($db_show_debug) && $db_show_debug === true
        && allowedTo('admin_forum')
    ) {
fatal_error(nl2br($e));
} else {
fatal_error($e->getMessage());
    }
});
Sorry for my English

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: