phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

phpBB 2 and php 5.4.9

Goto page 1, 2  Next
 
Search this topic... | Search General Support... | Search Box
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Author Message
achaab
Board Member



Joined: 06 Dec 2012

Posts: 11



PostPosted: Thu Dec 06, 2012 5:30 pm 
Post subject: phpBB 2 and php 5.4.9

Hi guys icon_smile.gif


My webhost upgraded PHP from 5.3 to 5.4.9 and i have few issues :
icon_arrow.gif If a member has an accent in his name, he can not login unless he changes the accent by the same letter w/o accent.
IE : my name is "Téki", i can not login myself if i write "Téki"... i has to write "Teki".

icon_arrow.gif If someone want to creat a new account on my forum with an accent in his name, the forum will give him this msg :
Quote:
You must fill in the required fields.

(everything works if we dont put an accent in the name).

icon_arrow.gif When i want to preview a msg, the page is reloaded but instead to see the preview box, i only have the posting like if i didnt click on the preview button.
EDIT : the preview works for private messages but not for the posting...


Can someone help me pls ? ^^
Back to top
juanpa
Board Member



Joined: 06 Dec 2012

Posts: 2



PostPosted: Fri Dec 07, 2012 11:25 am 
Post subject: Re: phpBB 2 and php 5.4.9

hi,

I've got same problem since php version's upgrade to 5.4.x


I think it's time to get phpBB3.... icon_evil.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 430
Location: Québec


flag
PostPosted: Sat Dec 08, 2012 6:34 am 
Post subject: Re: phpBB 2 and php 5.4.9

Are we sure the error comes from 5.4.9 itself? If juanpa also skipped from 5.3 to there, it could be any change in between...

Is PHP the only thing that was changed/updated? If there were changes to the SQL software, that seems sort of a more likely cause to me. But frankly I have no idea what it could be. I assume it has to do with character encoding, but where from... icon_confused.gif It's really weird that phpBB thinks there's no input at all instead of getting unknown characters (unless the error message is just misleading).

Anyway, check your file and database encodings and make sure everything is as usual. Maybe check your PHP config files if you know your way around them, see if anything related to that seems weird.

In the meantime, the error Téki posted appears twice in includes/usercp_register.php (assuming it's not modded):
Line 177
Code:
   if ( !empty($HTTP_POST_VARS['language']) )
   {
      if ( preg_match('/^[a-z_]+$/i', $HTTP_POST_VARS['language']) )
      {
         $user_lang = htmlspecialchars($HTTP_POST_VARS['language']);
      }
      else
      {
         $error = true;
         $error_msg = $lang['Fields_empty'];
      }
   }

Line 278:
Code:
      if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
      {
         $error = TRUE;
         $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
      }

I'd be more suspicious about the latter. empty() was updated in 5.4:
Quote:
5.4.0 Checking non-numeric offsets of strings returns TRUE.

If I'm getting this right (and I may very well not be), it doesn't really apply here since we're not using offsets. But several things happen to $username before this point so who knows what it looks like when it gets there. It could be a previous function that messes it up because of the unrecognized characters.

Some food for thought, but I can't look into this more for now.

Edit: Oh wait, this might actually be it (line 123):
Code:
$username = ( !empty($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';

Starting with 5.4, this would return true for empty($HTTP_POST_VARS['username']). Which means $username becomes '', leading to the error above. Err. That's what I'm gathering from the manual, but then it should result in the same bug for unaccented usernames. Gah, I don't know and I'm so tired. Sorry icon_neutral.gif
Back to top
achaab
Board Member



Joined: 06 Dec 2012

Posts: 11



PostPosted: Sat Dec 08, 2012 10:14 am 
Post subject: Re: phpBB 2 and php 5.4.9

Hi and thanks you for the answer icon_smile.gif


Im not sure what is the exact version of PHP that created the bug, so yeah the bug is not necessarily on the 5.4.9 but like you said between the 5.3.19-1 (the exact number i had before the update) and the 5.4.9

About the character encoding, everything seems unchanged in files and in the database (idk about the SQL software), so it's something we should fix in the file, but idk what icon_cry.gif


EDIT : i have the same problem with easyphp which has PHP 5.4.6 in it so it's between the 5.4 and the 5.4.6 icon_razz.gif
Back to top
achaab
Board Member



Joined: 06 Dec 2012

Posts: 11



PostPosted: Thu Jan 24, 2013 4:21 pm 
Post subject: Re: phpBB 2 and php 5.4.9

Hi guys ^^


We finally fixed this bug and now we have a phpBB 2 that works with any php 5 icon_cool.gif
I will post the code change in few days/weeks but first we activated the "notice errors" and we try to fix all of them to have a better code icon_smile.gif

During this work we found some functions that was outdated so i started to create a mysqli.php file for php 5.3+ (instead to use the mysql4.php) but i have to deal with new errors. The work itself shouldnt be too long because all the error messages come from 1 file but with my actual knowledge, it could take a while to fix everything.

Anyway as soon as I have finished with this work, i will put the changes here for thoses who are interested icon_wink.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 430
Location: Québec


flag
PostPosted: Thu Jan 24, 2013 5:26 pm 
Post subject: Re: phpBB 2 and php 5.4.9

That will be very appreciated, Téki. Thanks in advance!
Back to top
lumpy burgertushie
Board Member



Joined: 19 Nov 2008

Posts: 224


flag
PostPosted: Thu Jan 24, 2013 6:32 pm 
Post subject: Re: phpBB 2 and php 5.4.9

don't know if it would be any different between mysqli and myql . however, I would venture a guess that most people would be using mysql and not mysqli.

having said that, in cpanel, mysqli is the default, so many people may just accept that without knowing any better.

so, what do I know? icon_lol.gif


I have been doing this since before there was a mysqli and I always change from the default to what I am used to.


robert
Back to top
dondino
Board Member



Joined: 09 Dec 2008

Posts: 144


flag
PostPosted: Sat Feb 02, 2013 10:10 am 
Post subject: Re: phpBB 2 and php 5.4.9

Téki wrote:
Anyway as soon as I have finished with this work, i will put the changes here for thoses who are interested icon_wink.gif

Hello Téki! We will be very grateful if you can share the modifications that needs to be made in order to keep using our beloved phpbb2 even with recent php versions icon_smile.gif
I'm looking forward to hear you again!! Thanks
Back to top
achaab
Board Member



Joined: 06 Dec 2012

Posts: 11



PostPosted: Sun Feb 03, 2013 6:20 pm 
Post subject: Re: phpBB 2 and php 5.4.9

Hi guys ^^


We finished to edit the files. There is no error left and everything works... at least for me and the friend who helped me.
Tomorrow we will send a mail to our members to find more testers. As soon they will confirm that there is actually no error left, i will start to do the update file for my premodded version of phpBB (Sorry it's in french but you have a list in english of all installed mods starting from "MODifications"), then i will do it for a forum w/o any mod.

The big work is done, the wait is "almost" over icon_smile.gif
Back to top
dondino
Board Member



Joined: 09 Dec 2008

Posts: 144


flag
PostPosted: Mon Feb 04, 2013 11:09 am 
Post subject: Re: phpBB 2 and php 5.4.9

Téki wrote:
The big work is done, the wait is "almost" over icon_smile.gif

Thanks for the update! Keep up the good work icon_wink.gif
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Mon Feb 04, 2013 2:02 pm 
Post subject: Re: phpBB 2 and php 5.4.9

Yes, me too is looking forward to your code updates.
_________________
phpBB2 will never die, I hope!
Back to top
achaab
Board Member



Joined: 06 Dec 2012

Posts: 11



PostPosted: Sun Feb 10, 2013 7:33 pm 
Post subject: Re: phpBB 2 and php 5.4.9

H guys ^^


I changed my name from Téki to achaab but dont worry, it's still me icon_razz.gif


-----------------------------------------------------------------------------------------------------


For those who are interested, this is the fix for my forum (mods listed in my previous reply) :
icon_arrow.gif http://premod-shdow.servhome.org/tuto/update/2-9-2_to_3-0-0.xml

It's in french but it's not too hard to understand :
- Copié = Copy
- Ouvrir = Open
- Trouver = Find
- Remplacer par = Replace with
- Ajouter avant = Before, add
- Ajouter aprčs = After, add
- Dans la ligne, trouver = In-line find
- Dans la ligne, remplacer par = In-line replace with
- Dans la ligne, ajouter avant = In-line before, add
- Dans la ligne, ajouter aprčs = In-line after, add

-----------------------------------------------------------------------------------------------------

I did the same work for a vanila forum version 2.0.23 (in english this time) :
icon_arrow.gif http://www.phpbb2refugees.com/attach_files/phpbb2_fixes_759.zip

Please read the "autors' notes" part.

For those who have the version 2.0.24 there is an additional fix that may interest you :
Code:
##############################################################
## MOD Title: Fixed redirection after reauth to admin panel.
## MOD Author: djmati11
##
## MOD Description: Fixed redirection after reauth to admin panel.
##
## MOD Version: 1.0.0
##
## Installation Level: easy
## Installation Time: 5 minutes
##
## Files To Edit: includes/sessions.php
##                login.php
##
## Included Files: N/A
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


#
#-----[ OPEN ]------------------------------------------------------------------
#

includes/sessions.php

#
#-----[ FIND ]------------------------------------------------------------------
#
function append_sid($url, $non_html_amp = false)
#
#-----[ REPLACE WITH ]------------------------------------------------------------------
#
function append_sid($url, $non_html_amp = false, $psid = "x")
#
#-----[ FIND ]------------------------------------------------------------------
#
   global $SID, $P_SID;
#
#-----[ AFTER, ADD ]------------------------------------------------------------------
#
   if ($psid != "x")
   {
      $P_SID = "p_sid=".$psid;
   }
#
#-----[ OPEN ]------------------------------------------------------------------
#

login.php

#
#-----[ FIND ]------------------------------------------------------------------
#
   $sid = '';
}
#
#-----[ AFTER, ADD ]------------------------------------------------------------------
#
if (!empty($HTTP_POST_VARS['p_sid']) || !empty($HTTP_GET_VARS['p_sid']))
{
   $p_sid = (!empty($HTTP_POST_VARS['p_sid'])) ? $HTTP_POST_VARS['p_sid'] : $HTTP_GET_VARS['p_sid'];
}
else
{
   $p_sid = '';
}
#
#-----[ FIND ]------------------------------------------------------------------
#
redirect(append_sid($url, true));
#
#-----[ REPLACE WITH ]------------------------------------------------------------------
#
redirect(append_sid($url, true, $p_sid));
#
#-----[ FIND ]------------------------------------------------------------------
#
redirect(append_sid($url, true));
#
#-----[ REPLACE WITH ]------------------------------------------------------------------
#
redirect(append_sid($url, true, $p_sid));
#
#-----[ FIND ]------------------------------------------------------------------
#
redirect(append_sid($url, true));
#
#-----[ REPLACE WITH ]------------------------------------------------------------------
#
redirect(append_sid($url, true, $p_sid));
#
#-----[ FIND ]------------------------------------------------------------------
#
$s_hidden_fields .= (isset($HTTP_GET_VARS['admin'])) ? '<input type="hidden" name="admin" value="1" />' : '';
#
#-----[ AFTER, ADD ]------------------------------------------------------------------
#
      $s_hidden_fields .= '<input type="hidden" name="p_sid" value="'.$p_sid.'" />';
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------------------------
#
#
# EoM



phpbb2 fixes.zip
 Description:

Download
 Filename:  phpbb2 fixes.zip
 Filesize:  17.35 KB
 Downloaded:  1419 Time(s)

Back to top
dondino
Board Member



Joined: 09 Dec 2008

Posts: 144


flag
PostPosted: Tue Feb 12, 2013 3:07 pm 
Post subject: Re: phpBB 2 and php 5.4.9

Thanks so much Téki!
I will test all these snippets as soon as possible over my heavily-modded-board (2.0.24) !
and I just can't wait to upgrade php from 5.3.13 to the most recent version icon_wink.gif
If I apply them even still using this "old" version, it wouldn't harm anyway, right?

Did anyone else try the modifications above yet?!
Back to top
achaab
Board Member



Joined: 06 Dec 2012

Posts: 11



PostPosted: Wed Feb 13, 2013 8:43 am 
Post subject: Re: phpBB 2 and php 5.4.9

let me know if you have any problem to install it ^^


And yes you can apply the modifications on any version of PHP, but you have to use the correct mysql file :
- From PHP 4 to PHP 5.5 => mysql4.php
- For any version of PHP 5 => mysqli.php
Back to top
cpreston
Board Member



Joined: 21 Apr 2013

Posts: 3



PostPosted: Sun Apr 21, 2013 5:43 am 
Post subject: Re: phpBB 2 and php 5.4.9

Wow. I can't wait to try this! phpbb2 is the only thing holding me back at 5.2.17.
Back to top
Display posts from previous:   
Register or Login to Post    Index » General Support  Previous TopicPrint TopicNext Topic
Page 1 of 2 All times are GMT
Goto page 1, 2  Next
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0320 seconds using 17 queries. (SQL 0.0021 Parse 0.0025 Other 0.0274)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo