Simple Machines Community Forum

SMF Development => Bug Reports => Fixed or Bogus Bugs => Topic started by: Douglas on August 04, 2017, 07:37:12 PM

Title: [2.0.14] Bug report for SMF (SSI.php integration; update from 2.0.13)
Post by: Douglas on August 04, 2017, 07:37:12 PM
Wow, can't believe I'm actually filing a bug report.

As you know, I make heavy use of SSI.php on Hogville and Fearless... I updated Fearless yesterday and Hogville this AM. (Both were on 2.0.13)

After getting the update situated and whatnot... it was brought to my attention that there were error messages on the home screen of both sites:
Code: [Select]
Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /hogville/includes/lib.phtml on line 3

Warning: mysql_select_db(): A link to the server could not be established in /hogville/includes/lib.phtml on line 3

Warning: mysql_query(): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /hogville/index.php on line 1

Warning: mysql_query(): A link to the server could not be established in /hogville/index.php on line 1

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /hogville/index.php on line 1

Just because I know you're going to ask, here's the first few lines of lib.ptml:
Code: [Select]
<?php
require "/hogville/yabbse/SSI.php";
mysql_select_db("XX_hogville");
global 
$_SERVER$username$user_info;
$ID_MEMBER=$user_info['id'];
$username=$user_info['name'];
$group=$user_info['groups'][0];

I reverted the forum's index.php~ back up file to simply index.php and re-uploaded the entire Sources folder and SSI.php from a fresh 2.0.13 zip file, and the error went away.

there is something wonky with 2.0.14, when utilizing SSI.php externally of the forums. :)
Title: Re: [2.0.14] Bug report for SMF (SSI.php integration; update from 2.0.13)
Post by: Kindred on August 04, 2017, 11:06:18 PM
Hi Douglas...

We know that SSI didn't get the login security update for 2.0.14 -- there might be other issues.

Thanks for the report. We'll look into it
Title: Re: [2.0.14] Bug report for SMF (SSI.php integration; update from 2.0.13)
Post by: Arantor on August 05, 2017, 04:02:21 AM
Actually this one isn't entirely SSI at fault. SMF no longer uses any of the bare mysql_* functions, seeing that they've been removed from PHP in PHP 7.

Convert all the calls to use $smcFunc as they probably should have been for the last ~5 years and the problem goes away.