PHP7 Compatability

chown

Aspirant
Joined
Feb 14, 2017
Messages
25
PHP Warning: get_headers(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/forum/public_html/includes/class_upload.php on line 174
PHP Warning: get_headers(http://www.): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/forum/public_html/includes/class_upload.php
"POST /profile.php?do=updatesignature HTTP/1.1"
Save or preview your signature and it'll say "Invalid File" and log the get_headers() error.
2. Ah, the default of "http ://www." should have been removed from everywhere (http v https). Looks like I missed it in some templates.
(Ignore the space after http, stupid XF tries to make it into a url, I see no way to disable that)
The problem is actually with get_headers() because if a host is unreachable then the warning is logged every time.

The default profile picture and signature picture URLs contain "http://www.", which is obviously an invalid address.

To prevent the warning just change line 174 of class_upload.php to the following.
PHP:
$headers = @get_headers($upload, TRUE);
 
Last edited:

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,850
I tend to agree, the warnings in this case should be suppressed with @.
I also noticed that according to the PHP docs, the second param should be an integer.
Rather bizarre as its treated as a true/false option, but I updated it to be correct.

The line will be this in Beta 4 (whenever that gets released).
PHP:
$headers = @get_headers($upload, 1);
 

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,850
Well the good news for these versions is that I have about 2 to 3 months before I leave.
That should allow me to iron out remaining issues and release a final version that will be as compatible as I can make it.
 

Danielx64

Developer
Joined
Nov 8, 2009
Messages
3,330
Well the good news for these versions is that I have about 2 to 3 months before I leave.
That should allow me to iron out remaining issues and release a final version that will be as compatible as I can make it.
That's good to hear :)
 

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,850
I finish at IB on Friday 26th May.

The Final Releases of 4.2.5 & 3.8.11 are scheduled for Wednesday 17th May.
The next release is Beta 4, in 1 or 2 weeks time, there will be at least 1 RC around April time.
Other than that, there will probably be a couple of other releases (depends on what bugs get logged really).

If you find bugs related to PHP 7, please log them, or they may not get fixed.
It will be too late once I'm gone, I dont expect anyone else to do anything on them.
There will almost certainly be no more 3x or 4x releases, except necessary patches [e.g. security issues].
 

Ramses

Adherent
Joined
Nov 22, 2005
Messages
320
I finish at IB on Friday 26th May.

The Final Releases of 4.2.5 & 3.8.11 are scheduled for Wednesday 17th May.
The next release is Beta 4, in 1 or 2 weeks time, there will be at least 1 RC around April time.
Other than that, there will probably be a couple of other releases (depends on what bugs get logged really).

If you find bugs related to PHP 7, please log them, or they may not get fixed.
It will be too late once I'm gone, I dont expect anyone else to do anything on them.
There will almost certainly be no more 3x or 4x releases, except necessary patches [e.g. security issues].
Very, very sad news. :sick:
Thank you Paul for all the hard work, I will miss you.
 

eva2000

Habitué
Joined
Jan 11, 2004
Messages
1,752
I finish at IB on Friday 26th May.

The Final Releases of 4.2.5 & 3.8.11 are scheduled for Wednesday 17th May.
The next release is Beta 4, in 1 or 2 weeks time, there will be at least 1 RC around April time.
Other than that, there will probably be a couple of other releases (depends on what bugs get logged really).

If you find bugs related to PHP 7, please log them, or they may not get fixed.
It will be too late once I'm gone, I dont expect anyone else to do anything on them.
There will almost certainly be no more 3x or 4x releases, except necessary patches [e.g. security issues].
Thanks for all the hard work and effort you put into keeping vB3/vB4 up to date all this time ! :tup:
 

mysiteguy

Devotee
Joined
Feb 20, 2007
Messages
2,981
Paul,

I assume VB 4.x will leave off with a 4.2.6 final release based on updates to 4.2.5 beta updates?
 

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,850
Nope, 4.2.5 will be the final version, once its out of beta and released, there will not be any 4.2.6 (at least not from me anyway).
 

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,850
JFYI, both the Forumrunner and vbulletin.org forums will be running 3.8.11 Beta 3 as of Thursday (but on PHP 5.6).
My own Cable Forum site was switched to PHP 7 and 3.8.11 Beta 3 over the weekend, no issues with the core code noted or reported so far.

(However, it did break my own unread posts mod :( so I'll have to put out an update for that at some point).
 

chown

Aspirant
Joined
Feb 14, 2017
Messages
25
Are attachments a little broken for anyone else? I enabled attachments, uploaded 1 and then went to the admincp to move attachments to a directory. It counted 35 attachments even though I've only got 1 against my name. Next I selected to move attachments back into the database and briefly seen a few "Error Upload of file failed" messages.
 

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,850
Attachments are working just fine on my test installations of 4.2.5 (and the various live 3.8.11 installs).
 

chown

Aspirant
Joined
Feb 14, 2017
Messages
25
You understand it moves attachments for the entire board, not just one user?
Yes, but attachments were originally disabled for everyone. When I then enabled attachments, uploaded 1 and changed the storage type it said that my account owns 35 attachments. I've figured out why it thought that though.

Attachments are working just fine on my test installations of 4.2.5 (and the various live 3.8.11 installs).
If you move the attachments to the file system and then back to the database you'll get the "Error Upload of file failed" message. This occurs even if you optimize the tables because the data already exists.

In attachment.php it says that the error message should be changed.
PHP:
               if (!($result = $attachdata->save()))
               {
                   if (empty($attachdata->errors[0]))
                   {
                       $attacherror = fetch_error('upload_file_failed'); // change this error
                   }
                   else
                   {
                       $attacherror =& $attachdata->errors[0];
                   }
               }
So it would be better to say that the file already exists?
 
Last edited:

Paul M

Limeade Addict
Joined
Jun 26, 2006
Messages
3,850
Like I said, it all works fine for me, including switching between storage types.

That code (and comment) dates from 12 years ago, I'm not about to go changing it now. :)
 

BirdOPrey5

#Awesome
Joined
Aug 14, 2008
Messages
4,217
This occurs even if you optimize the tables because the data already exists.
Thed data should be deleted from the table once you press "Finalize" on the moving files from the database to the file system. If the data still exists when you try to move it back, the issue is with the finalize step. Make sure the user has delete permission on the database (though I imagine there would have been other problems first.)

Are you using any kind of master/slave database? Maybe they need time to synchronize.
 
Top