Fix author not seeing self priv questions

This commit is contained in:
posweg 2020-09-01 12:14:34 +00:00
parent b0a0698c06
commit b2c13d22d0
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
<?php <?php
session_start(); session_start();
include("../include/settings.php"); include("../include/settings.php");
include("../include/functions.php");
if(!isset($_GET["q"])){ if(!isset($_GET["q"])){
echo("Question not specified."); echo("Question not specified.");

View File

@ -60,7 +60,7 @@ if(isset($_GET["p"])){
$h_user = $db->query("SELECT * FROM users WHERE id = " . $h_question["by"] . ";")->fetchArray(SQLITE3_ASSOC); $h_user = $db->query("SELECT * FROM users WHERE id = " . $h_question["by"] . ";")->fetchArray(SQLITE3_ASSOC);
$q_key = md5($h_question["question"]); $q_key = md5($h_question["question"]);
if($p_user["id"] == $h_question["user"] and ($h_question["private"] != 1 or $q_md5 != $_GET["key"])){ // Only show question that are for this user if($p_user["id"] == $h_question["user"] and ($h_question["private"] != 1 or $q_md5 != $_GET["key"] or $is_current_user)){ // Only show question that are for this user
echo('<div class="highlighted-post">'); echo('<div class="highlighted-post">');