Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 10 Jun 2017, 20:35
farsgsm farsgsm is offline
 
Join Date: Jun 2008
Cool PHP Warning: Illegal string offset 'usergroupid' in

Dear friends,
I recently upgraded php to ver 5.6
i checked error logs of vbulletin and saw these errors.
would u please let me know how can fix it or replace to correct string?!

[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'usergroupid' in /home/user/public_html/includes/functions.php on line 383
[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'usergroupid' in /home/user/public_html/includes/functions.php on line 449
[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'userid' in /home/user/public_html/includes/functions.php on line 449
[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'userid' in /home/user/public_html/includes/functions.php on line 440
[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'usergroupid' in /home/user/public_html/includes/functions.php on line 449
Reply With Quote
  #2  
Old 10 Jun 2017, 20:53
Dave Dave is offline
 
Join Date: Jun 2010
Real name: Dave
What vBulletin version are you using?

You may have to update your vBulletin version to a version that supports PHP 5.6+ in order to get rid of these errors. Unless of course you don't mind making manual modifications to the /includes/functions.php file.
__________________
https://technidev.com - security, development, exploits, vBulletin
dave[at]technidev[dot]com

Contact me for custom vBulletin 3/4 work & server/website management.
Reply With Quote
  #3  
Old 12 Jun 2017, 13:19
farsgsm farsgsm is offline
 
Join Date: Jun 2008
using:
vBulletin® v3.8.11, Copyright ©2000-2017, vBulletin Solutions Inc.

I think this version supportes php 5.6+
Reply With Quote
  #4  
Old 12 Jun 2017, 13:48
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
First of all, those line numbers dont match up with the default functions.php for 3.8.11, which makes me wonder if you have the correct files uploaded.

Secondly, they are due to invalid data being passed to core functions, which indicates you have an issue elsewhere, in a modification maybe.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #5  
Old 13 Jun 2017, 10:59
farsgsm farsgsm is offline
 
Join Date: Jun 2008
thanks for your reply
here is what my functions.php have on mentioned lines
maybe can help find problem:

[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'usergroupid' in /home/user/public_html/includes/functions.php on line 383

$membergroups[] = $user['usergroupid'];


[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'usergroupid' in /home/user/public_html/includes/functions.php on line 449

if ($userinfo['usergroupid'] == $usergroupid OR in_array($usergroupid, $user_memberships["$userinfo[userid]"]))


[10-Jun-2017 20:16:42 UTC] PHP Warning: Illegal string offset 'userid' in /home/user/public_html/includes/functions.php on line 440

if (!is_array($user_memberships["$userinfo[userid]"]) OR !$cache)
Reply With Quote
  #6  
Old 13 Jun 2017, 12:36
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
I already told you what the actual problem is
Originally Posted by Paul M View Post
... they are due to invalid data being passed to core functions ...
Which as I also said, indicates you have an issue elsewhere, probably in a modification thats calling the functions.
__________________
Former vBulletin.org Staff Member


Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #7  
Old 13 Jun 2017, 12:45
farsgsm farsgsm is offline
 
Join Date: Jun 2008
ok thanks, ill check modifications
and u have same idea on errors below?

[13-Jun-2017 12:43:58 UTC] PHP Deprecated: Function split() is deprecated in /home/user/public_html/global.php(607) : eval()'d code on line 297
[13-Jun-2017 12:43:58 UTC] PHP Deprecated: Function split() is deprecated in /home/user/public_html/global.php(607) : eval()'d code on line 311

[13-Jun-2017 12:47:25 UTC] PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/user/public_html/misc.php(100) : eval()'d code on line 834
Reply With Quote
  #8  
Old 13 Jun 2017, 14:20
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by farsgsm View Post
ok thanks, ill check modifications
and u have same idea on errors below?

[13-Jun-2017 12:43:58 UTC] PHP Deprecated: Function split() is deprecated in /home/user/public_html/global.php(607) : eval()'d code on line 297
[13-Jun-2017 12:43:58 UTC] PHP Deprecated: Function split() is deprecated in /home/user/public_html/global.php(607) : eval()'d code on line 311
You need to find where the split() function is being used and replace those with the explode() function.

Originally Posted by farsgsm View Post
[13-Jun-2017 12:47:25 UTC] PHP Deprecated: Assigning the return value of new by reference is deprecated in /home/user/public_html/misc.php(100) : eval()'d code on line 834
In line 100 of misc.php, you will likely find "=&" being used...replace that with just "=".
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #9  
Old 13 Jun 2017, 14:52
farsgsm farsgsm is offline
 
Join Date: Jun 2008
Originally Posted by MarkFL View Post
You need to find where the split() function is being used and replace those with the explode() function.

In line 100 of misc.php, you will likely find "=&" being used...replace that with just "=".
its what the misc.php line 100 contains:
($hook = vBulletinHook::fetch_hook('misc_start')) ? eval($hook) : false;

here is the only split that i have found on global.php
$val = preg_split('#\n#', $vbulletin->GPC['vbulletin_collapse'], -1, PREG_SPLIT_NO_EMPTY);

please advise how to fix the functions
Reply With Quote
  #10  
Old 13 Jun 2017, 15:04
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Real name: Mark
Originally Posted by farsgsm View Post
its what the misc.php line 100 contains:
($hook = vBulletinHook::fetch_hook('misc_start')) ? eval($hook) : false;
Yes, I was mistaken...there is code being evaluated at that hook with the deprecated code in it. Try to find the "=&" operator being used in a plugin hooked at "misc_start".

Originally Posted by farsgsm View Post
here is the only split that i have found on global.php
$val = preg_split('#\n#', $vbulletin->GPC['vbulletin_collapse'], -1, PREG_SPLIT_NO_EMPTY);

please advise how to fix the functions
The deprecated functions won't be in the "global.pho" file itself, but rather in code executed at the plugin hook locations specified at those given lines.

To make finding text within your plugins much easier, I highly recommend installing this product:

Search Plugins
__________________
Former vBulletin.org Staff Member



Support for my products (as well as updates/new product publishing) has been moved to MHB - vBulletin Products and TAZ - Add-ons
Reply With Quote
  #11  
Old 08 Sep 2019, 18:51
oldengine oldengine is offline
 
Join Date: Mar 2004
Admin Control Panel (vBulletin 3.8.11) PHP 7.1

[08-Sep-2019 18:18:50 UTC] PHP Warning: Illegal string offset 'userid' in /home/smoky/public_html/forum/includes/functions.php on line 439
[08-Sep-2019 18:18:50 UTC] PHP Warning: Illegal string offset 'userid' in /home/smoky/public_html/forum/includes/functions.php on line 442
[08-Sep-2019 18:18:50 UTC] PHP Warning: Illegal string offset 'usergroupid' in /home/smoky/public_html/forum/includes/functions.php on line 382
[08-Sep-2019 18:18:50 UTC] PHP Warning: Illegal string offset 'usergroupid' in /home/smoky/public_html/forum/includes/functions.php on line 448
[08-Sep-2019 18:18:50 UTC] PHP Warning: Illegal string offset 'userid' in /home/smoky/public_html/forum/includes/functions.php on line 448

These are likely to be in the calendar Plugin Event Attendance - show/enroll
The question is where?


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Last edited by oldengine; 08 Sep 2019 at 18:56.
Reply With Quote
  #12  
Old 08 Sep 2019, 20:59
iA1 iA1 is offline
 
Join Date: Jul 2018
Wherever you see userinfo[userid] in the code, add quotation marks for userid, like userinfo['userid']. Do the same for usergroupid
__________________
Make your forum mobile friendly and get app-like features:
App-like icon on your smartphone homescreen
Responsive style - for vBulletin 4.2.x as well as vB 3.8.x - Contact for custom work
Push notifications for new replies, likes and PM
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 10:43.

Layout Options | Width: Wide Color: