Author |
Message |
achaab Board Member
Joined: 06 Dec 2012
Posts: 11
|
Posted: Thu Dec 06, 2012 1:30 pm Post subject: phpBB 2 and php 5.4.9 |
|
|
Hi guys
My webhost upgraded PHP from 5.3 to 5.4.9 and i have few issues :
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".
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).
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
|
Posted: Fri Dec 07, 2012 7: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....
|
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Sat Dec 08, 2012 2: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... 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
|
|
Back to top |
|
|
achaab Board Member
Joined: 06 Dec 2012
Posts: 11
|
Posted: Sat Dec 08, 2012 6:14 am Post subject: Re: phpBB 2 and php 5.4.9 |
|
|
Hi and thanks you for the answer
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
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
|
|
Back to top |
|
|
achaab Board Member
Joined: 06 Dec 2012
Posts: 11
|
Posted: Thu Jan 24, 2013 12: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
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
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
|
|
Back to top |
|
|
Salvatos Board Member
Joined: 19 Feb 2009
Posts: 449 Location: Québec
|
Posted: Thu Jan 24, 2013 1: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: 18 Nov 2008
Posts: 266
|
Posted: Thu Jan 24, 2013 2: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?
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
|
Posted: Sat Feb 02, 2013 6: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 |
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
I'm looking forward to hear you again!! Thanks
|
|
Back to top |
|
|
achaab Board Member
Joined: 06 Dec 2012
Posts: 11
|
Posted: Sun Feb 03, 2013 2: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
|
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Mon Feb 04, 2013 7: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 |
Thanks for the update! Keep up the good work
|
|
Back to top |
|
|
dogs and things Board Member
Joined: 18 Nov 2008
Posts: 628 Location: Spain
|
Posted: Mon Feb 04, 2013 10:02 am 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
|
Posted: Sun Feb 10, 2013 3: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
-----------------------------------------------------------------------------------------------------
For those who are interested, this is the fix for my forum (mods listed in my previous reply) :
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) :
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 |
Description: |
|
Download |
Filename: |
phpbb2 fixes.zip |
Filesize: |
17.35 KB |
Downloaded: |
2681 Time(s) |
|
|
Back to top |
|
|
dondino Board Member
Joined: 09 Dec 2008
Posts: 144
|
Posted: Tue Feb 12, 2013 11:07 am 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
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
|
Posted: Wed Feb 13, 2013 4: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
|
Posted: Sun Apr 21, 2013 1: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 |
|
|
|