Advertisement:

Author Topic: SMF 2.0.x and PHP 7.1 Search Method [] operator not supported for strings  (Read 2584 times)

Offline GL700Wing

  • Jr. Member
  • **
  • Posts: 270
  • Gender: Female
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:
Code: [Select]
        $context['fulltext_index'] = '';
        if ($request !== false || $smcFunc['db_num_rows']($request) != 0)
Replace With:
Code: [Select]
        $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


Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,366
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
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

Offline @rjen

  • Jr. Member
  • **
  • Posts: 171
  • Gender: Male
    • FJR-club Nederland
Re: SMF 2.0.x and PHP 7.1 Search Method [] operator not supported for strings
« Reply #2 on: November 20, 2017, 01:53:15 PM »
I noticed this one bug has not been fixed in version 2.0.15...

is that on purpose?
Running SMF 2.0 with Tinyportal 1.3R at www.fjr-club.nl
Testing SMF 2.1 beta 3 with Tinyportal 2.0 at http://test2.fjr-club.nl/