vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   PHP Warning: Illegal string offset 'usergroupid' in (https://vborg.vbsupport.ru/showthread.php?t=325226)

farsgsm 06-10-2017 06:35 PM

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

Dave 06-10-2017 06:53 PM

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.

farsgsm 06-12-2017 11:19 AM

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

I think this version supportes php 5.6+

Paul M 06-12-2017 11:48 AM

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.

farsgsm 06-13-2017 08:59 AM

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)

Paul M 06-13-2017 10:36 AM

I already told you what the actual problem is :)
Quote:

Originally Posted by Paul M (Post 2587461)
... 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.

farsgsm 06-13-2017 10:45 AM

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

MarkFL 06-13-2017 12:20 PM

Quote:

Originally Posted by farsgsm (Post 2587489)
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 (Post 2587489)
[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 "=".

farsgsm 06-13-2017 12:52 PM

Quote:

Originally Posted by MarkFL (Post 2587491)
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

MarkFL 06-13-2017 01:04 PM

Quote:

Originally Posted by farsgsm (Post 2587495)
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 (Post 2587495)
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


All times are GMT. The time now is 11:33 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.01137 seconds
  • Memory Usage 1,738KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete