mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-12 14:40:09 +01:00
Make 404 work again :^)
This commit is contained in:
parent
aa3b629c01
commit
248cc0fb10
1 changed files with 6 additions and 2 deletions
|
@ -57,9 +57,13 @@ $row = $conn->querySelectOne(
|
||||||
// This is used in the theme files.
|
// This is used in the theme files.
|
||||||
$totalpastes = getSiteTotalPastes($conn);
|
$totalpastes = getSiteTotalPastes($conn);
|
||||||
|
|
||||||
if (!$row) {
|
$notfound = null;
|
||||||
|
$is_private = false;
|
||||||
|
|
||||||
|
if ($row === null) {
|
||||||
header('HTTP/1.1 404 Not Found');
|
header('HTTP/1.1 404 Not Found');
|
||||||
$notfound = $lang['notfound']; // "Not found";
|
$notfound = $lang['notfound']; // "Not found";
|
||||||
|
goto Not_Valid_Paste;
|
||||||
} else {
|
} else {
|
||||||
$paste_owner_id = (int) $row['user_id'];
|
$paste_owner_id = (int) $row['user_id'];
|
||||||
$paste_title = $row['title'];
|
$paste_title = $row['title'];
|
||||||
|
@ -257,7 +261,7 @@ if ($p_password == "NONE" || $p_password === null) {
|
||||||
|
|
||||||
Not_Valid_Paste:
|
Not_Valid_Paste:
|
||||||
// Private paste not valid
|
// Private paste not valid
|
||||||
if ($is_private == '1') {
|
if ($is_private || $notfound) {
|
||||||
// Display errors
|
// Display errors
|
||||||
require_once('theme/' . $default_theme . '/header.php');
|
require_once('theme/' . $default_theme . '/header.php');
|
||||||
require_once('theme/' . $default_theme . '/errors.php');
|
require_once('theme/' . $default_theme . '/errors.php');
|
||||||
|
|
Loading…
Add table
Reference in a new issue