Commit 5843b2db by Scott

Merge branch 'bugfix' into dev

parents 842abb91 b5bb3f37
1.8.2
\ No newline at end of file
1.8.3
\ No newline at end of file
......@@ -191,7 +191,7 @@ function qa_question_set_selchildid($userid, $handle, $cookieid, $oldquestion, $
'answer' => $answers[$selchildid],
));
if (empty($oldquestion['closed'])) {
if (empty($oldquestion['closed']) && qa_opt('do_close_on_select')) {
qa_db_post_set_closed($oldquestion['postid'], null, $userid, $lastip);
qa_report_event('q_close', $userid, $handle, $cookieid, array(
......@@ -431,6 +431,8 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie
}
}
qa_question_uncache($oldquestion['postid']); // remove hidden posts immediately
$eventparams = array(
'postid' => $oldquestion['postid'],
'parentid' => $oldquestion['parentid'],
......@@ -623,6 +625,18 @@ function qa_post_unindex($postid)
/**
* Delete the cache for a question. Used after it or its answers/comments are hidden, to prevent them remaining visible to visitors/search engines.
* @param int $questionId Post ID to delete.
* @return bool
*/
function qa_question_uncache($questionId)
{
$cacheDriver = Q2A_Storage_CacheFactory::getCacheDriver();
return $cacheDriver->delete("question:$questionId");
}
/**
* Change the fields of an answer (application level) to $content, $format, $notify and $name, then reindex based on
* $text. For backwards compatibility if $name is null then the name will not be changed. Pass the answer's database
* record before changes in $oldanswer, the question's in $question, and details of the user doing this in $userid,
......@@ -810,6 +824,8 @@ function qa_answer_set_status($oldanswer, $status, $userid, $handle, $cookieid,
}
}
qa_question_uncache($question['postid']); // remove hidden posts immediately
$eventparams = array(
'postid' => $oldanswer['postid'],
'parentid' => $oldanswer['parentid'],
......@@ -1196,6 +1212,8 @@ function qa_comment_set_status($oldcomment, $status, $userid, $handle, $cookieid
$oldcomment['format'], qa_viewer_text($oldcomment['content'], $oldcomment['format']), null, $oldcomment['categoryid']);
}
qa_question_uncache($question['postid']); // remove hidden posts immediately
$eventparams = array(
'postid' => $oldcomment['postid'],
'parentid' => $oldcomment['parentid'],
......
......@@ -66,7 +66,6 @@ class qa_filter_basic
$question['title'] = isset($question['title']) ? $question['title'] : '';
$question['content'] = isset($question['content']) ? $question['content'] : '';
$question['text'] = isset($question['text']) ? $question['text'] : '';
$question['tags'] = isset($question['tags']) ? $question['tags'] : array();
}
$qminlength = qa_opt('min_len_q_title');
......
......@@ -20,8 +20,8 @@
*/
define('QA_VERSION', '1.8.2'); // also used as suffix for .js and .css requests
define('QA_BUILD_DATE', '2018-12-20');
define('QA_VERSION', '1.8.3'); // also used as suffix for .js and .css requests
define('QA_BUILD_DATE', '2019-01-12');
/**
......
......@@ -548,8 +548,9 @@ function qa_db_single_select($selectspec)
$query = 'SELECT ';
foreach ($selectspec['columns'] as $columnas => $columnfrom)
$query .= $columnfrom . (is_int($columnas) ? '' : (' AS ' . $columnas)) . ', ';
foreach ($selectspec['columns'] as $columnas => $columnfrom) {
$query .= is_int($columnas) ? "$columnfrom, " : "$columnfrom AS `$columnas`, ";
}
$results = qa_db_read_all_assoc(qa_db_query_raw(qa_db_apply_sub(
substr($query, 0, -2) . (strlen(@$selectspec['source']) ? (' FROM ' . $selectspec['source']) : ''),
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -167,9 +167,10 @@ class FileCacheDriver implements CacheDriver
if ($expiredOnly) {
if (is_readable($file)) {
$fp = fopen($file, 'r');
$skipLine = fgets($fp);
$key = fgets($fp);
$expiry = (int) trim(fgets($fp));
if (is_numeric($expiry) && time() > $expiry) {
if (time() > $expiry) {
$wasDeleted = $this->deleteFile($file);
}
}
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -118,6 +118,7 @@ h1 {
margin: 0;
font-size: 1.4em;
line-height: 1.35em;
word-wrap: break-word;
}
h1 a {
color: #fff;
......@@ -1188,6 +1189,7 @@ blockquote p {
font-size: 1.125em;
line-height: 1.35em;
display: block;
word-wrap: break-word;
}
.qa-q-item-title a {
color: #1a6a9b;
......
File mode changed from 100755 to 100644
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment