Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-10-2017, 06:35 PM
farsgsm farsgsm is offline
 
Join Date: Jun 2008
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 06-10-2017, 06:53 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 06-12-2017, 11:19 AM
farsgsm farsgsm is offline
 
Join Date: Jun 2008
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

using:
vBulletin® v3.8.11, Copyright ©2000-2017, vBulletin Solutions Inc.

I think this version supportes php 5.6+
Reply With Quote
  #4  
Old 06-12-2017, 11:48 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 06-13-2017, 08:59 AM
farsgsm farsgsm is offline
 
Join Date: Jun 2008
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 06-13-2017, 10:36 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already told you what the actual problem is
Quote:
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.
Reply With Quote
  #7  
Old 06-13-2017, 10:45 AM
farsgsm farsgsm is offline
 
Join Date: Jun 2008
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 06-13-2017, 12:20 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.

Quote:
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 "=".
Reply With Quote
  #9  
Old 06-13-2017, 12:52 PM
farsgsm farsgsm is offline
 
Join Date: Jun 2008
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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 06-13-2017, 01:04 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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".

Quote:
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
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 10:55 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05442 seconds
  • Memory Usage 2,262KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete