digestTest: don't display empty digest when not logged in

This commit is contained in:
Andrew Dolgov 2019-03-04 07:00:20 +03:00
parent c68ac04020
commit 6ec602e1a4
1 changed files with 10 additions and 6 deletions

View File

@ -7,14 +7,18 @@ class Backend extends Handler {
}
function digestTest() {
header("Content-type: text/html");
if (isset($_SESSION['uid'])) {
header("Content-type: text/html");
$rv = Digest::prepare_headlines_digest($_SESSION['uid'], 1, 1000);
$rv = Digest::prepare_headlines_digest($_SESSION['uid'], 1, 1000);
print "<h1>HTML</h1>";
print $rv[0];
print "<h1>Plain text</h1>";
print "<pre>".$rv[3]."</pre>";
print "<h1>HTML</h1>";
print $rv[0];
print "<h1>Plain text</h1>";
print "<pre>".$rv[3]."</pre>";
} else {
print error_json(6);
}
}
private function display_main_help() {