View Issue Details

IDProjectCategoryView StatusLast Update
0018133phplist applicationOtherpublic14-09-16 20:57
Reporterduncanc 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.2.5 
Target Versionnext patchFixed in Version3.2.6 
Summary0018133: Incorrect parameters to mysqli_connect
DescriptionThe function mysqli_connect does not take exactly the same parameters as mysql_connect. In particular the flags parameter for mysql does not exist for mysqli. Instead a different function needs to be used, mysqli_real_connect.

The code to connect using mysqli in file mysqli.inc is using the fourth and fifth parameters incorrectly, they actually apply to database name and port

  $db = mysqli_connect($host, $user, $password, false, $compress | $secure);

To use ssl or compression, mysqli_init and mysqli_real_connect need to be used, see the procedural style example http://php.net/manual/en/mysqli.real-connect.php
TagsNo tags attached.

Activities

michiel

07-06-16 21:05

manager   ~0057759

Ah, good one. Things are already piling up for a next release. This should be in there.

duncanc

14-09-16 15:41

developer   ~0058239

Last edited: 14-09-16 20:13

View 2 revisions

I've worked on the change to use the correct parameters for the mysqli_* functions. I will issue a PR shortly.
See https://github.com/phpList/phplist3/pull/84

michiel

14-09-16 20:32

manager   ~0058241

great!

michiel

14-09-16 20:37

manager   ~0058242

Hmm, refreshed the code and got this on my local system

Warning: mysqli_real_connect(): (HY000/2006): MySQL server has gone away in ...phpList3/public_html/lists/admin/mysqli.inc on line 25
Sorry, the server is currently too busy, please try again later.

michiel

14-09-16 20:49

manager   ~0058243

I have both compression and secure switched on. It didn't like the secure option. That may be a local config.

michiel

14-09-16 20:57

manager   ~0058244

It works with MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT instead of MYSQLI_CLIENT_SSL