php 5.4.12

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
User avatar
DoYouSpeakWak
Registered User
Posts: 2307
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Name: Hans Lassen
Contact:

php 5.4.12

Post by DoYouSpeakWak » Fri Feb 22, 2013 8:44 pm

Hey all

Today i upgraded my servers to php 5.4.12, But right after i was greeted with this php debug notice

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/includes/session.php on line 2208: Array to string conversion
Board is vanila and latest. no changes. And this error did not show up 2 hours earlier.

Any ideas on what the cause can be and if a bug report to php.net should be submitted, what should it include.

Wak
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid phpBB help and System administrator services.

rxu
Extensions Development Team
Posts: 2525
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: php 5.4.12

Post by rxu » Sat Feb 23, 2013 3:50 am

For phpBB 3.0.11 includes/session.php there's line 2208:

Code: Select all

return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
Here, strtr() with 2 arguments has been used. As per the PHP manual, in this case the second argument should be an array in the form array('from' => 'to', ...).
But $user->lang['datetime'] (see language/en/common.php 'datetime' entry) is a multidimensional array having subarray of

Code: Select all

		'AGO'		=> array(
			0		=> 'less than a minute ago',
			1		=> '%d minute ago',
			2		=> '%d minutes ago',
			60		=> '1 hour ago',
		),
If you put this block of code into comment (/*...*/), the error is gone.

So, with PHP 5.4.12 this pretty much looks like a phpBB bug.

You can temporarily fix the issue by suppressing the error output adding @ sign at the front of strtr call:

Code: Select all

return @strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
This is not an actual fix but getting rid of the error messages only. This bug shouldn't affect the board features operation though.

User avatar
wang5555
Translator
Posts: 565
Joined: Wed Oct 27, 2004 2:57 pm
Location: Taiwan

Re: php 5.4.12

Post by wang5555 » Sat Feb 23, 2013 6:24 am

rxu wrote: You can temporarily fix the issue by suppressing the error output adding @ sign at the front of strtr call:

Code: Select all

return @strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
This is not an actual fix but getting rid of the error messages only. This bug shouldn't affect the board features operation though.
Thanks very much. :D
It is more blessed to give than to reveive, welcome to letter, thanks & good-bye!
Good luck ^_^
Welcome to my forum!!
p.s. Shut down computer before 11 clock night!!!

User avatar
DoYouSpeakWak
Registered User
Posts: 2307
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Name: Hans Lassen
Contact:

Re: php 5.4.12

Post by DoYouSpeakWak » Sat Feb 23, 2013 8:46 am

Thx for the fix rxu.

Bug ticket opened.

http://tracker.phpbb.com/browse/PHPBB3-11361
rxu wrote: This is not an actual fix but getting rid of the error messages only. This bug shouldn't affect the board features operation though.
Sadly not. ucp,mcp,acp doesnt really work with this error and debug,debug extra on. lets hope it gets fixed in the next version. until then not that many will use this latest version of php.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid phpBB help and System administrator services.

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 2520
Joined: Mon Jul 10, 2006 9:58 pm
Name: Andreas Fischer
Contact:

Re: php 5.4.12

Post by bantu » Sat Feb 23, 2013 10:00 am

Please try 'lang' => array_filter($this->lang['datetime'], 'is_string'), in $date_cache[$format] = array( definition.
Powered by Coffee

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 19768
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: php 5.4.12

Post by RMcGirr83 » Sat Feb 23, 2013 11:09 am

Any mods installed?
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
HGN
Former Team Member
Posts: 4706
Joined: Wed Dec 03, 2008 1:53 pm
Location: The Netherlands
Name: Alfred
Contact:

Re: php 5.4.12

Post by HGN » Sat Feb 23, 2013 11:19 am

DoYouSpeakWak wrote:Board is vanila and latest. no changes.

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 19768
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: php 5.4.12

Post by RMcGirr83 » Sat Feb 23, 2013 11:37 am

Damn it...lack of coffee intake
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
DoYouSpeakWak
Registered User
Posts: 2307
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Name: Hans Lassen
Contact:

Re: php 5.4.12

Post by DoYouSpeakWak » Sat Feb 23, 2013 12:03 pm

bantu wrote:Please try 'lang' => array_filter($this->lang['datetime'], 'is_string'), in $date_cache[$format] = array( definition.
Tried with this. i assume thats what you meant.

Code: Select all

			// Is the user requesting a friendly date format (i.e. 'Today 12:42')?
			$date_cache[$format] = array(
				'is_short'		=> strpos($format, '|'),
				'format_short'	=> substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
				'format_long'	=> str_replace('|', '', $format),
				'lang' => array_filter($this->lang['datetime'], 'is_string'),
			);
Only the lang line that is changed. cleaned my cache rm *.php and browser cache, reloaded. same error still there.
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid phpBB help and System administrator services.

rxu
Extensions Development Team
Posts: 2525
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: php 5.4.12

Post by rxu » Sat Feb 23, 2013 3:10 pm

bantu wrote:Please try 'lang' => array_filter($this->lang['datetime'], 'is_string'), in $date_cache[$format] = array( definition.
That worked for me.

User avatar
wang5555
Translator
Posts: 565
Joined: Wed Oct 27, 2004 2:57 pm
Location: Taiwan

Re: php 5.4.12

Post by wang5555 » Sun Feb 24, 2013 2:27 am

rxu wrote:
bantu wrote:Please try 'lang' => array_filter($this->lang['datetime'], 'is_string'), in $date_cache[$format] = array( definition.
That worked for me.
+1, thanks! :D
It is more blessed to give than to reveive, welcome to letter, thanks & good-bye!
Good luck ^_^
Welcome to my forum!!
p.s. Shut down computer before 11 clock night!!!

User avatar
bantu
3.0 Release Manager
3.0 Release Manager
Posts: 2520
Joined: Mon Jul 10, 2006 9:58 pm
Name: Andreas Fischer
Contact:

Re: php 5.4.12

Post by bantu » Sun Feb 24, 2013 11:12 am

DoYouSpeakWak wrote:Only the lang line that is changed. cleaned my cache rm *.php and browser cache, reloaded. same error still there.
Please double check.
Powered by Coffee

User avatar
DoYouSpeakWak
Registered User
Posts: 2307
Joined: Fri Jul 25, 2008 1:32 pm
Location: Island of Wak-Wak
Name: Hans Lassen
Contact:

Re: php 5.4.12

Post by DoYouSpeakWak » Thu Feb 28, 2013 7:37 pm

Checked. was my fault. had apc and did not clear its cache
Whatever you share comes back. Support the phpBB Communities
My Validated and Released Modifications
Offering paid phpBB help and System administrator services.

Locked

Return to “[3.0.x] Support Forum”

Who is online

Users browsing this forum: No registered users and 51 guests