git.shiar.nl
/
minimedit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b3aec6c
)
page: silence object warnings on missing pages
author
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 28 Oct 2019 04:02:49 +0000
(
05:02
+0100)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Sat, 9 Nov 2019 06:08:13 +0000
(07:08 +0100)
page.inc.php
patch
|
blob
|
history
page.php
patch
|
blob
|
history
diff --git
a/page.inc.php
b/page.inc.php
index b7a7e77ab2e01764c4ba1ce43faf3364d26ecc2d..7a54bf7424b59603c98509a65ae83da5962bcf1b 100644
(file)
--- a/
page.inc.php
+++ b/
page.inc.php
@@
-7,7
+7,7
@@
print "<header>\n";
ob_start();
include 'menu.inc.html';
ob_start();
ob_start();
include 'menu.inc.html';
ob_start();
-if (
$User
) {
+if (
!empty($User)
) {
print '<div class="login"><p>';
printf('<span>Ingelogd: <b><a href="%s">%s</a></b></span>', '/login', $User->login);
if ($User->admin("edit $Page$Args")) {
print '<div class="login"><p>';
printf('<span>Ingelogd: <b><a href="%s">%s</a></b></span>', '/login', $User->login);
if ($User->admin("edit $Page$Args")) {
@@
-44,7
+44,7
@@
register_shutdown_function(function () {
print "</footer>\n";
global $User, $Page, $Args;
print "</footer>\n";
global $User, $Page, $Args;
- if (
$User
and $User->admin("edit $Page$Args")) {
+ if (
!empty($User)
and $User->admin("edit $Page$Args")) {
$ckesrc = '/lib/ckeditor'; # local install
if (!file_exists(DOCROOT . $ckesrc)) {
$ckesrc = '//cdn.ckeditor.com/4.7.3/full-all'; # remote fallback
$ckesrc = '/lib/ckeditor'; # local install
if (!file_exists(DOCROOT . $ckesrc)) {
$ckesrc = '//cdn.ckeditor.com/4.7.3/full-all'; # remote fallback
diff --git
a/page.php
b/page.php
index f02544bd0b06dbd7add643d19a17e02bbdca69c2..1488f1c5904f7a637208305037bfd73bb02e7861 100644
(file)
--- a/
page.php
+++ b/
page.php
@@
-84,6
+84,10
@@
set_include_path(implode(PATH_SEPARATOR, [ DOCROOT, __DIR__ ]));
function fail($error)
{
http_response_code(500);
function fail($error)
{
http_response_code(500);
+ if (!isset($Article)) {
+ $Article = new ArchiveArticle(NULL);
+ $Article->title = 'Fout';
+ }
include_once 'page.inc.php';
ob_start();
require_once '500.inc.html';
include_once 'page.inc.php';
ob_start();
require_once '500.inc.html';