Commit d8d6fb0d by Scott

Merge branch 'bugfix' into dev

parents 4fd88051 c478a0dd
sudo: false os: linux
dist: trusty dist: trusty
language: php language: php
php: php:
- '5.4' - '5.4'
- '5.5'
- '5.6' - '5.6'
- '7.0' - '7.0'
- '7.1' - '7.1'
......
...@@ -254,26 +254,26 @@ function qa_ipv6_expand($ip) ...@@ -254,26 +254,26 @@ function qa_ipv6_expand($ip)
$ipv6_wildcard = true; $ipv6_wildcard = true;
} }
if ($ipv6_wildcard) { if ($ipv6_wildcard) {
$wildcards = explode(":", $ip); $wildcards = explode(':', $ip);
foreach ($wildcards as $index => $value) { foreach ($wildcards as $index => $value) {
if ($value == "*") { if ($value == "*") {
$wildcards_matched[] = count($wildcards) - 1 - $index; $wildcards_matched[] = count($wildcards) - 1 - $index;
$wildcards[$index] = "0"; $wildcards[$index] = "0";
} }
} }
$ip = implode($wildcards, ":"); $ip = implode(':', $wildcards);
} }
$hex = unpack("H*hex", @inet_pton($ip)); $hex = unpack("H*hex", @inet_pton($ip));
$ip = substr(preg_replace("/([0-9A-Fa-f]{4})/", "$1:", $hex['hex']), 0, -1); $ip = substr(preg_replace("/([0-9A-Fa-f]{4})/", "$1:", $hex['hex']), 0, -1);
if ($ipv6_wildcard) { if ($ipv6_wildcard) {
$wildcards = explode(":", $ip); $wildcards = explode(':', $ip);
foreach ($wildcards_matched as $value) { foreach ($wildcards_matched as $value) {
$i = count($wildcards) - 1 - $value; $i = count($wildcards) - 1 - $value;
$wildcards[$i] = "*"; $wildcards[$i] = "*";
} }
$ip = implode($wildcards, ":"); $ip = implode(':', $wildcards);
} }
return $ip; return $ip;
......
...@@ -93,7 +93,7 @@ function qa_question_set_content($oldquestion, $title, $content, $format, $text, ...@@ -93,7 +93,7 @@ function qa_question_set_content($oldquestion, $title, $content, $format, $text,
qa_post_unindex($comment['postid']); qa_post_unindex($comment['postid']);
} }
if (@$closepost['parentid'] == $oldquestion['postid']) if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid'])
qa_post_unindex($closepost['postid']); qa_post_unindex($closepost['postid']);
qa_db_post_set_type($oldquestion['postid'], 'Q_QUEUED'); qa_db_post_set_type($oldquestion['postid'], 'Q_QUEUED');
...@@ -348,7 +348,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie ...@@ -348,7 +348,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie
qa_post_unindex($comment['postid']); qa_post_unindex($comment['postid']);
} }
if (@$closepost['parentid'] == $oldquestion['postid']) if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid'])
qa_post_unindex($closepost['postid']); qa_post_unindex($closepost['postid']);
$setupdated = false; $setupdated = false;
...@@ -426,7 +426,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie ...@@ -426,7 +426,7 @@ function qa_question_set_status($oldquestion, $status, $userid, $handle, $cookie
} }
} }
if ($closepost['parentid'] == $oldquestion['postid']) { if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid']) {
qa_post_index($closepost['postid'], $closepost['type'], $oldquestion['postid'], $closepost['parentid'], null, qa_post_index($closepost['postid'], $closepost['type'], $oldquestion['postid'], $closepost['parentid'], null,
$closepost['content'], $closepost['format'], qa_viewer_text($closepost['content'], $closepost['format']), null, $closepost['categoryid']); $closepost['content'], $closepost['format'], qa_viewer_text($closepost['content'], $closepost['format']), null, $closepost['categoryid']);
} }
...@@ -505,7 +505,7 @@ function qa_question_set_category($oldquestion, $categoryid, $userid, $handle, $ ...@@ -505,7 +505,7 @@ function qa_question_set_category($oldquestion, $categoryid, $userid, $handle, $
$otherpostids[] = $comment['postid']; $otherpostids[] = $comment['postid'];
} }
if (@$closepost['parentid'] == $oldquestion['postid']) if (isset($closepost) && $closepost['parentid'] == $oldquestion['postid'])
$otherpostids[] = $closepost['postid']; $otherpostids[] = $closepost['postid'];
qa_db_posts_set_category_path($otherpostids, $newpath); qa_db_posts_set_category_path($otherpostids, $newpath);
......
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