SMF 2.0.x and PHP 7.1 Search Method [] operator not supported for strings

Started by GL700Wing, June 20, 2017, 10:39:03 PM

Previous topic - Next topic

GL700Wing

This issue is similar to https://www.simplemachines.org/community/index.php?topic=554454.msg3930251#msg3930251

After changing the Search Method to Fulltext the error '[] operator not supported for strings' is thrown whenever the 'Search Methods' menu is selected.

The fix is as follows:
In ./Sources/ManageSearch.php
Find:
        $context['fulltext_index'] = '';
        if ($request !== false || $smcFunc['db_num_rows']($request) != 0)

Replace With:
        $context['fulltext_index'] = array();
        if ($request !== false || $smcFunc['db_num_rows']($request) != 0)





I've confirmed this issue also affects SMF 2.1 Beta 3 - error log info is as follows:
[21-Jun-2017 02:23:37 UTC] PHP Fatal error:  Uncaught Error: [] operator not supported for strings in /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php:826
Stack trace:
#0 /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php(219): detectFulltextIndex()
#1 /home/abcdefg/public_html/forum_21B3/Sources/Subs.php(4584): EditSearchMethod()
#2 /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php(77): call_helper('EditSearchMetho...')
#3 /home/abcdefg/public_html/forum_21B3/Sources/Admin.php(495): ManageSearch()
#4 /home/abcdefg/public_html/forum_21B3/index.php(152): AdminMain()
#5 {main}
  thrown in /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php on line 826

Life doesn't have to be perfect to be wonderful ...

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

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

@rjen

I noticed this one bug has not been fixed in version 2.0.15...

is that on purpose?
Running SMF 2.1 with latest TinyPortal at www.fjr-club.nl

Plus

Quote from: GL700Wing on June 20, 2017, 10:39:03 PM
This issue is similar to https://www.simplemachines.org/community/index.php?topic=554454.msg3930251#msg3930251

After changing the Search Method to Fulltext the error '[] operator not supported for strings' is thrown whenever the 'Search Methods' menu is selected.

The fix is as follows:
In ./Sources/ManageSearch.php
Find:
        $context['fulltext_index'] = '';
        if ($request !== false || $smcFunc['db_num_rows']($request) != 0)

Replace With:
        $context['fulltext_index'] = array();
        if ($request !== false || $smcFunc['db_num_rows']($request) != 0)





I've confirmed this issue also affects SMF 2.1 Beta 3 - error log info is as follows:
[21-Jun-2017 02:23:37 UTC] PHP Fatal error:  Uncaught Error: [] operator not supported for strings in /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php:826
Stack trace:
#0 /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php(219): detectFulltextIndex()
#1 /home/abcdefg/public_html/forum_21B3/Sources/Subs.php(4584): EditSearchMethod()
#2 /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php(77): call_helper('EditSearchMetho...')
#3 /home/abcdefg/public_html/forum_21B3/Sources/Admin.php(495): ManageSearch()
#4 /home/abcdefg/public_html/forum_21B3/index.php(152): AdminMain()
#5 {main}
  thrown in /home/abcdefg/public_html/forum_21B3/Sources/ManageSearch.php on line 826



thank you :)

shawnb61

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

shawnb61

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

Advertisement: