Commit d1d2e98f authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-905 Assign intersect result to variables before checking it with

empty().

Released under the Affero GNU General Public License (AGPL) version 3.
parent 0449fa9e
......@@ -127,11 +127,10 @@ class SyncNote extends SyncObject {
// is a color other than yellow set
if (isset($this->Color) && $this->Color != 3 && $this->Color > -1 && $this->Color < 5) {
// check existing categories - do not rewrite category if the category is already a supported or unsupported color
if (!empty($this->categories) &&
(!empty(array_intersect($this->categories, array_values(self::$unsupportedColors))) ||
!empty(array_intersect($this->categories, array_values(self::$colors))) )) {
return false;
$insecUnsupp = array_intersect($this->categories, array_values(self::$unsupportedColors));
$insecColors = array_intersect($this->categories, array_values(self::$colors));
if (!empty($this->categories) && (!empty($insecUnsupp) || !empty($insecColors))) {
return false;
}
if(!isset($this->categories)) {
$this->categories = array();
......
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