From 98406dfcaff61971615b314c521821ee0f6b9141 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 25 Jun 2017 10:17:26 -0400 Subject: [PATCH 1/3] Fix deprecated constant MYSQL_ASSOC - Add maintenance HTML file --- include/dba.php | 2 +- maintenance.html | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 maintenance.html diff --git a/include/dba.php b/include/dba.php index 89f141d8..b0f2c5d7 100644 --- a/include/dba.php +++ b/include/dba.php @@ -70,7 +70,7 @@ class dba $r = array(); if ($result->num_rows) { - while ($x = $result->fetch_array(MYSQL_ASSOC)) { + while ($x = $result->fetch_array(MYSQLI_ASSOC)) { $r[] = $x; } $result->free_result(); diff --git a/maintenance.html b/maintenance.html new file mode 100644 index 00000000..5757d32d --- /dev/null +++ b/maintenance.html @@ -0,0 +1,38 @@ + + + + + + + + + Friendica Directory + + + + + + + + + + + + +
+

+ Friendica    
    Directory +

+

+ Directory under maintenance +

+ +

+ The Friendica Directory is unavailable at this time, please connect with hypolite@friendica.mrpetovan.com for updates about its status. +

+
+ + -- 2.45.2 From e5416b002330fabdf9b13f0821a9456f6a968870 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 25 Jun 2017 10:17:26 -0400 Subject: [PATCH 2/3] Fix deprecated constant MYSQL_ASSOC - Add maintenance HTML file --- include/dba.php | 2 +- maintenance.html | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 maintenance.html diff --git a/include/dba.php b/include/dba.php index 89f141d8..b0f2c5d7 100644 --- a/include/dba.php +++ b/include/dba.php @@ -70,7 +70,7 @@ class dba $r = array(); if ($result->num_rows) { - while ($x = $result->fetch_array(MYSQL_ASSOC)) { + while ($x = $result->fetch_array(MYSQLI_ASSOC)) { $r[] = $x; } $result->free_result(); diff --git a/maintenance.html b/maintenance.html new file mode 100644 index 00000000..5757d32d --- /dev/null +++ b/maintenance.html @@ -0,0 +1,38 @@ + + + + + + + + + Friendica Directory + + + + + + + + + + + + +
+

+ Friendica    
    Directory +

+

+ Directory under maintenance +

+ +

+ The Friendica Directory is unavailable at this time, please connect with hypolite@friendica.mrpetovan.com for updates about its status. +

+
+ + -- 2.45.2 From 4601c4bd8a8e242987bd0aa6209e7aac67f962ee Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Tue, 1 Aug 2017 21:02:24 -0400 Subject: [PATCH 3/3] Fix "PHP Warning: session_write_close(): Failed to write session data (user)" errors - Changed returning true when there's a session ID but no session data in ref_session_write() - Moved session.php requires around --- boot.php | 2 ++ include/notifier.php | 1 - include/poller.php | 1 - include/rockstar.php | 1 - include/session.php | 8 ++++++-- index.php | 2 -- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/boot.php b/boot.php index d2f8634e..0f4f36a4 100644 --- a/boot.php +++ b/boot.php @@ -1,5 +1,7 @@ set_baseurl(get_config('system', 'url')); diff --git a/include/session.php b/include/session.php index e51dbc1b..a125679f 100644 --- a/include/session.php +++ b/include/session.php @@ -30,10 +30,14 @@ function ref_session_write($id, $data) { global $session_exists, $session_expire; - if (!$id || !$data) { + if (!$id) { return false; } + if (!$data) { + return true; + } + $expire = time() + $session_expire; $default_expire = time() + 300; @@ -65,7 +69,7 @@ function ref_session_gc($expire) { q("DELETE FROM `session` WHERE `expire` < %d", dbesc(time())); q("OPTIMIZE TABLE `sess_data`"); - + return true; } diff --git a/index.php b/index.php index 082f0c0e..07ddb75a 100644 --- a/index.php +++ b/index.php @@ -24,8 +24,6 @@ unset($db_host, $db_user, $db_pass, $db_data); $a->init_pagehead(); $a->page['aside'] = '
Your friends. Your web.
'; -require_once 'session.php'; - session_start(); if ((x($_SESSION, 'authenticated')) || (x($_POST, 'auth-params')) || ($a->module === 'login')) { -- 2.45.2