Fix deprecated constant MYSQL_ASSOC + session_write notices #26

Merged
MrPetovan merged 4 commits from master into master 2017-08-04 03:38:21 +02:00
8 changed files with 47 additions and 8 deletions

View file

@ -1,5 +1,7 @@
<?php
require_once 'include/session.php';
require_once 'vendor/autoload.php';
set_time_limit(0);

View file

@ -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();

View file

@ -15,7 +15,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
require_once 'session.php';
require_once 'datetime.php';
if ($argc < 3) {

View file

@ -15,7 +15,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data);
unset($db_host, $db_user, $db_pass, $db_data);
require_once 'session.php';
require_once 'datetime.php';
require_once 'simplepie/simplepie.inc';
require_once 'include/items.php';

View file

@ -14,7 +14,6 @@ $db = new dba($db_host, $db_user, $db_pass, $db_data, $install);
unset($db_host, $db_user, $db_pass, $db_data);
require_once 'session.php';
require_once 'datetime.php';
$a->set_baseurl(get_config('system', 'url'));

View file

@ -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;

View file

@ -24,8 +24,6 @@ unset($db_host, $db_user, $db_pass, $db_data);
$a->init_pagehead();
$a->page['aside'] = '<div id="logo"><img src="images/friendica-32.png" alt="friendica logo" /> <a href="http://friendica.com">Friendica</a></div><div id="slogan">Your friends. Your web.</div>';
require_once 'session.php';
session_start();
if ((x($_SESSION, 'authenticated')) || (x($_POST, 'auth-params')) || ($a->module === 'login')) {

38
maintenance.html Normal file
View file

@ -0,0 +1,38 @@
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1">
<link rel="search" type="application/opensearchdescription+xml" title="Friendica Directory" href="/opensearch" />
<title>Friendica Directory</title>
<link rel="shortcut icon" href="/images/friendica-32.png" />
<link rel="apple-touch-icon" href="/images/friendica-128.png"/>
<link href="/assets/css/style.css" rel="stylesheet" type="text/css" />
<link href="/assets/css/awesome/font-awesome.min.css?v=4.3.0" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/assets/js/jquery/jquery.min.js?v=1.11.2"></script>
<script type="text/javascript" src="/assets/js/main.js"></script>
</head>
<body>
<a class="hamburger mobile"><i class="fa fa-bars"></i></a>
<nav id="links">
<div class="viewport">
</div>
</nav>
<div class="homepage-wrapper">
<h1 class="header">
Friendica &nbsp; &nbsp;<br>&nbsp; &nbsp; Directory
</h1>
<h2>
Directory under maintenance
</h2>
<p class="about">
The Friendica Directory is unavailable at this time, please connect with <a href="https://friendica.mrpetovan.com/profile/hypolite">hypolite@friendica.mrpetovan.com</a> for updates about its status.
annando commented 2017-08-02 20:13:19 +02:00 (Migrated from github.com)
Review

I guess your other PRs are based upon this one? There is this issue with the mail address that @tobiasd had addressed.

I guess your other PRs are based upon this one? There is this issue with the mail address that @tobiasd had addressed.
MrPetovan commented 2017-08-02 20:16:07 +02:00 (Migrated from github.com)
Review

You're right, I committed directly to my master and then I built the two other issues branches on my master as well, which means that the commits with the maintenance page appears everywhere, both in this PR as well as in the branches' PR.

I'm not sure I can make it a setting as it is supposed to be a static page that should work even if nothing else does.

You're right, I committed directly to my master and then I built the two other issues branches on my master as well, which means that the commits with the maintenance page appears everywhere, both in this PR as well as in the branches' PR. I'm not sure I can make it a setting as it is supposed to be a static page that should work even if nothing else does.
annando commented 2017-08-02 20:30:54 +02:00 (Migrated from github.com)
Review

You could maybe include a simple config file for that purpose?

You could maybe include a simple config file for that purpose?
tobiasd commented 2017-08-03 07:11:33 +02:00 (Migrated from github.com)
Review

Does the directory not have a .htconfig.php file? I simple assumed so ;-)

Does the directory not have a `.htconfig.php` file? I simple assumed so ;-)
MrPetovan commented 2017-08-04 03:39:57 +02:00 (Migrated from github.com)
Review

I will change it in a further PR.

I will change it in a further PR.
</p>
</div>
</body>
</html>