@@ -42,7 +42,7 @@ |
||
42 | 42 | // if user's lastname is part of the email address, check to see if the difference is only in the domain part |
43 | 43 | $email1 = preg_replace('/@.+/', '', $person1['email']); |
44 | 44 | $email2 = preg_replace('/@.+/', '', $person2['email']); |
45 | - if ( str_contains($email1, $person1['lastname']) |
|
45 | + if (str_contains($email1, $person1['lastname']) |
|
46 | 46 | && $email1 == $email2) { |
47 | 47 | $p += 0.5; |
48 | 48 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | private function load_next() |
61 | 61 | { |
62 | - $i =& $this->_request_data['loop_i']; |
|
62 | + $i = & $this->_request_data['loop_i']; |
|
63 | 63 | while ($i < 100) { |
64 | 64 | debug_add("Loop iteration {$i}"); |
65 | 65 | $qb = new midgard_query_builder('midgard_parameter'); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | // Make sure we actually have enough rights to do this |
90 | - if ( !$object1->can_do('midgard:update') |
|
90 | + if (!$object1->can_do('midgard:update') |
|
91 | 91 | || !$object1->can_do('midgard:delete') |
92 | 92 | || !$object2->can_do('midgard:update') |
93 | 93 | || !$object2->can_do('midgard:delete')) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | continue; |
97 | 97 | } |
98 | 98 | // Extra sanity check (in case of semi-successful not-duplicate mark) |
99 | - if ( $object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
99 | + if ($object1->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object2->guid) |
|
100 | 100 | || $object2->get_parameter('org.openpsa.contacts.duplicates:not_duplicate', $object1->guid)) { |
101 | 101 | debug_add("It seems these two (#{$object1->id} and #{$object2->id}) have also marked as not duplicates, some cleanup might be a good thing", MIDCOM_LOG_WARN); |
102 | 102 | $i++; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | if ($keep == 'both') { |
129 | 129 | $option1->require_do('midgard:update'); |
130 | 130 | $option2->require_do('midgard:update'); |
131 | - if ( $option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
131 | + if ($option1->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option2->guid, time()) |
|
132 | 132 | && $option2->set_parameter('org.openpsa.contacts.duplicates:not_duplicate', $option1->guid, time())) { |
133 | 133 | // Clear the possible duplicate parameters |
134 | 134 | $option1->delete_parameter('org.openpsa.contacts.duplicates:possible_duplicate', $option2->guid); |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | } |
147 | 147 | } else { |
148 | 148 | if ($keep == $option1->guid) { |
149 | - $object1 =& $option1; |
|
150 | - $object2 =& $option2; |
|
149 | + $object1 = & $option1; |
|
150 | + $object2 = & $option2; |
|
151 | 151 | } elseif ($keep == $option2->guid) { |
152 | - $object1 =& $option2; |
|
153 | - $object2 =& $option1; |
|
152 | + $object1 = & $option2; |
|
153 | + $object2 = & $option1; |
|
154 | 154 | } else { |
155 | 155 | throw new midcom_error('Something weird happened (basically we got bogus data)'); |
156 | 156 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | if ($path === '') { |
66 | 66 | // Infinite loop, set an UI message and stop executing |
67 | - if ( !isset($schema['extends']['name']) |
|
67 | + if (!isset($schema['extends']['name']) |
|
68 | 68 | || $schema['extends']['name'] === $schema_name) { |
69 | 69 | throw new midcom_error('schema ' . $schema_name . ' extends itself'); |
70 | 70 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | |
76 | 76 | private function _process_category_constraint(org_openpsa_qbpager $qb) |
77 | 77 | { |
78 | - if ( !in_array($this->category, $this->_request_data['categories']) |
|
78 | + if (!in_array($this->category, $this->_request_data['categories']) |
|
79 | 79 | && !$this->_config->get('categories_custom_enable')) { |
80 | 80 | throw new midcom_error('Custom categories are not allowed'); |
81 | 81 | // TODO: Check here if there are actually items in this cat? |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | midcom::get()->head->set_pagetitle($this->_request_data['page_title']); |
89 | 89 | |
90 | 90 | // Activate correct leaf |
91 | - if ( $this->_config->get('show_navigation_pseudo_leaves') |
|
91 | + if ($this->_config->get('show_navigation_pseudo_leaves') |
|
92 | 92 | && in_array($this->category, $this->_request_data['categories'])) { |
93 | 93 | $this->set_active_leaf($this->_topic->id . '_CAT_' . $this->category); |
94 | 94 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | |
52 | 52 | if ($handler_id == 'feed-category-rss2') { |
53 | 53 | // This is not a predefined category from configuration, check if site maintainer allows us to show it |
54 | - if ( !in_array($args[0], $data['categories']) |
|
54 | + if (!in_array($args[0], $data['categories']) |
|
55 | 55 | && !$this->_config->get('categories_custom_enable')) { |
56 | 56 | throw new midcom_error('Custom category support is disabled'); |
57 | 57 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | while ($parent = $object->get_parent()) { |
337 | 337 | // Verify that this topic is within the current sites tree, if it is not, |
338 | 338 | // we ignore it. |
339 | - if ( is_a($parent, midcom_db_topic::class) |
|
339 | + if (is_a($parent, midcom_db_topic::class) |
|
340 | 340 | && $this->is_node_in_tree($parent->id, $this->get_root_node())) { |
341 | 341 | return $parent; |
342 | 342 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $entry = "<span class=\"{$current_class}\">{$entry}</span>"; |
391 | 391 | } |
392 | 392 | } else { |
393 | - if ( !empty($data['napobject'][MIDCOM_NAV_GUID]) |
|
393 | + if (!empty($data['napobject'][MIDCOM_NAV_GUID]) |
|
394 | 394 | && in_array($data['napobject'][MIDCOM_NAV_GUID], $skip_guids)) { |
395 | 395 | continue; |
396 | 396 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $id = "custom-{$key}"; |
505 | 505 | |
506 | 506 | $url = "{$prefix}{$entry[MIDCOM_NAV_URL]}"; |
507 | - if ( str_starts_with($entry[MIDCOM_NAV_URL], '/') |
|
507 | + if (str_starts_with($entry[MIDCOM_NAV_URL], '/') |
|
508 | 508 | || preg_match('|^https?://|', $entry[MIDCOM_NAV_URL])) { |
509 | 509 | $url = $entry[MIDCOM_NAV_URL]; |
510 | 510 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $temp = array_shift($_FILES); |
21 | 21 | |
22 | 22 | // Verify file extension |
23 | - if ( is_uploaded_file($temp['tmp_name']) |
|
23 | + if (is_uploaded_file($temp['tmp_name']) |
|
24 | 24 | && !in_array(strtolower(pathinfo($temp['name'], PATHINFO_EXTENSION)), ["gif", "jpg", "png"])) { |
25 | 25 | throw new midcom_error('Invalid extension.'); |
26 | 26 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function _on_creating() : bool |
27 | 27 | { |
28 | - if ( !$this->referrer |
|
28 | + if (!$this->referrer |
|
29 | 29 | && !empty($_SERVER['HTTP_REFERER'])) { |
30 | 30 | $this->referrer = $_SERVER['HTTP_REFERER']; |
31 | 31 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } |
120 | 120 | } |
121 | 121 | $profit = $value - $cost; |
122 | - if ( $this->value != $value |
|
122 | + if ($this->value != $value |
|
123 | 123 | || $this->profit != $profit) { |
124 | 124 | $this->value = $value; |
125 | 125 | $this->profit = $value - $cost; |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | |
185 | 185 | public function _on_updating() : bool |
186 | 186 | { |
187 | - if ( $this->state != self::STATE_ACTIVE |
|
187 | + if ($this->state != self::STATE_ACTIVE |
|
188 | 188 | && !$this->end) { |
189 | 189 | //Not active anymore and end not set, set it to now |
190 | 190 | $this->end = time(); |
191 | 191 | } |
192 | - if ( $this->end |
|
192 | + if ($this->end |
|
193 | 193 | && $this->state == self::STATE_ACTIVE) { |
194 | 194 | //Returned to active state, clear the end marker. |
195 | 195 | $this->end = 0; |