Test Setup Failed
Pull Request — master (#190)
by
unknown
15:14
created
lib/midcom/services/auth/frontend/form.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function read_authentication_data()
26 26
     {
27
-        if (   !array_key_exists('midcom_services_auth_frontend_form_submit', $_REQUEST)
27
+        if (!array_key_exists('midcom_services_auth_frontend_form_submit', $_REQUEST)
28 28
             || !array_key_exists('username', $_REQUEST)
29 29
             || !array_key_exists('password', $_REQUEST)) {
30 30
             return null;
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         // Store the submitted form if the session expired, but user wants to save the data
54 54
         if (count($_POST) > 0) {
55
-            $data =& midcom_core_context::get()->get_custom_key('request_data');
55
+            $data = & midcom_core_context::get()->get_custom_key('request_data');
56 56
 
57 57
             $data['restored_form_data'] = array();
58 58
 
Please login to merge, or discard this patch.
lib/midcom/services/auth/sessionmgr.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             $clientip = $_SERVER['REMOTE_ADDR'];
193 193
         }
194 194
 
195
-        if (   midcom::get()->config->get('auth_check_client_ip')
195
+        if (midcom::get()->config->get('auth_check_client_ip')
196 196
             && $session->clientip != $clientip) {
197 197
             debug_add("The session {$session->guid} (#{$session->id}) had mismatching client IP.", MIDCOM_LOG_INFO);
198 198
             debug_add("Expected {$session->clientip}, got {$clientip}.");
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     private function _load_person()
255 255
     {
256 256
         if (!$this->user) {
257
-            debug_add("Failed to authenticate the given user: ". midcom_connection::get_error_string(),
257
+            debug_add("Failed to authenticate the given user: " . midcom_connection::get_error_string(),
258 258
             MIDCOM_LOG_INFO);
259 259
             return false;
260 260
         }
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
         $result = array();
441 441
         $query_result = array_keys($mc->list_keys());
442 442
         foreach ($query_result as $userid) {
443
-            if (   ($user = $this->auth->get_user($userid))
443
+            if (($user = $this->auth->get_user($userid))
444 444
                 && $user->is_online()) {
445 445
                 $result[$user->guid] = $user;
446 446
             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -175,7 +175,8 @@
 block discarded – undo
175 175
     {
176 176
         try {
177 177
             $session = new midcom_core_login_session_db($sessionid);
178
-        } catch (Exception $e) {
178
+        }
179
+        catch (Exception $e) {
179 180
             debug_add('Login session ' . $sessionid . ' failed to load: ' . $e->getMessage(), MIDCOM_LOG_INFO);
180 181
             return false;
181 182
         }
Please login to merge, or discard this patch.
lib/net/nemein/redirector/viewer.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
     public function _on_initialize()
20 20
     {
21 21
         // Match /
22
-        if (   is_null($this->_config->get('redirection_type'))
23
-            || (   $this->_topic->can_do('net.nemein.redirector:noredirect')
22
+        if (is_null($this->_config->get('redirection_type'))
23
+            || ($this->_topic->can_do('net.nemein.redirector:noredirect')
24 24
                 && !$this->_config->get('admin_redirection'))) {
25 25
             $this->_request_switch['redirect'] = array(
26 26
                 'handler' => array('net_nemein_redirector_handler_tinyurl', 'list'),
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
             // Catch first the configuration option for showing editing interface instead
79 79
             // of redirecting administrators
80
-            if (   $this->_topic->can_do('net.nemein.redirector:noredirect')
80
+            if ($this->_topic->can_do('net.nemein.redirector:noredirect')
81 81
                 && !$this->_config->get('admin_redirection')) {
82 82
                 midcom::get()->relocate("{$this->_topic->name}/edit/{$args[0]}/");
83 83
             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,8 @@
 block discarded – undo
152 152
                     try {
153 153
                         $topic = new midcom_db_topic($id);
154 154
                         $id = $topic->id;
155
-                    } catch (midcom_error $e) {
155
+                    }
156
+                    catch (midcom_error $e) {
156 157
                         $e->log();
157 158
                         break;
158 159
                     }
Please login to merge, or discard this patch.
lib/net/nemein/wiki/resolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
          that is populated only once, and even then only the
131 131
          first time we encounter a namespaced wikilink */
132 132
         static $folder_tree = array();
133
-        if (   count($folder_tree) == 0
133
+        if (count($folder_tree) == 0
134 134
             || $force_resolve_folder_tree) {
135 135
             $folder_tree = $this->_resolve_folder_tree($force_as_root);
136 136
         }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             $localpath = $path;
161 161
             $matches['latest_parent'] = $folder_tree['/'];
162 162
             $missing_levels = 0;
163
-            while (   $localpath
163
+            while ($localpath
164 164
                    && $localpath != '/') {
165 165
                 $localpath = dirname($localpath);
166 166
                 $missing_levels++;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
         $root_folder = $folder;
189 189
         $max = 100;
190
-        while (   $folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki'
190
+        while ($folder[MIDCOM_NAV_COMPONENT] == 'net.nemein.wiki'
191 191
                && (($parent = $nap->get_node_uplink($folder[MIDCOM_NAV_ID])) != -1)
192 192
                && $max > 0) {
193 193
             $root_folder = $folder;
Please login to merge, or discard this patch.
lib/net/nemein/wiki/wikipage.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,8 @@
 block discarded – undo
196 196
 
197 197
         try {
198 198
             $diff_fields = $rcs_handler->get_diff($prev_version, $this_version, 'unified');
199
-        } catch (midcom_error $e) {
199
+        }
200
+        catch (midcom_error $e) {
200 201
             $e->log();
201 202
             return '';
202 203
         }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
 
30 30
     public function _on_creating()
31 31
     {
32
-        if (   $this->title == ''
32
+        if ($this->title == ''
33 33
             || !$this->topic) {
34 34
             // We must have wikiword and topic at this stage
35 35
             return false;
Please login to merge, or discard this patch.
lib/net/nemein/wiki/parser.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                 return $this->render_link($parts[1], $parts[2]) . $after;
225 225
 
226 226
             // Macro [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>])
227
-            case (   preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
227
+            case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
228 228
                   && method_exists($this, "_run_macro_{$macro_parts[1]}")):
229 229
                 $method = "_run_macro_{$macro_parts[1]}";
230 230
                 return $this->$method($macro_parts[2], $match[0], $after);
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
                 $folder = $wikipage_match['latest_parent'];
258 258
             }
259 259
 
260
-            if (   isset($folder[MIDCOM_NAV_OBJECT])
260
+            if (isset($folder[MIDCOM_NAV_OBJECT])
261 261
                 && $folder[MIDCOM_NAV_OBJECT]->can_do('midgard:create')) {
262 262
                 $workflow = $this->get_workflow('datamanager2');
263 263
                 return "<a href=\"{$folder[MIDCOM_NAV_ABSOLUTEURL]}create/?wikiword={$wikipage_match['remaining_path']}\" " . $workflow->render_attributes() . " class=\"wiki_missing\" title=\"" . $this->_l10n->get('click to create') . "\">{$text}</a>";
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                     $links[$parts[1]] = $parts[2];
301 301
                     break;
302 302
                 // Ignore macros [something: <data>] (for example [abbr: BOFH - Bastard Operator From Hell] or [photo: <GUID>])
303
-                case (   preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
303
+                case (preg_match('/^(.*?): (.*)/', $fulltext, $macro_parts)
304 304
                       && method_exists($this, "_run_macro_{$macro_parts[1]}")):
305 305
                     continue 2;
306 306
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,8 @@
 block discarded – undo
63 63
 
64 64
         try {
65 65
             $attachment = new midcom_db_attachment($guid);
66
-        } catch (midcom_error $e) {
66
+        }
67
+        catch (midcom_error $e) {
67 68
             $e->log();
68 69
             return "<span class=\"missing_photo\" title=\"{$guid}\">{$fulltag}</span>{$after}";
69 70
         }
Please login to merge, or discard this patch.
lib/net/nemein/wiki/handler/create.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
 
66 66
         if (!$this->_page->create()) {
67 67
             debug_print_r('We operated on this object:', $this->_page);
68
-            throw new midcom_error('Failed to create a new page. Last Midgard error was: '. midcom_connection::get_error_string());
68
+            throw new midcom_error('Failed to create a new page. Last Midgard error was: ' . midcom_connection::get_error_string());
69 69
         }
70 70
 
71 71
         return $this->_page;
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,8 @@
 block discarded – undo
114 114
             } else {
115 115
                 try {
116 116
                     net_nemein_wiki_viewer::initialize_index_article($topic);
117
-                } catch (midcom_error $e) {
117
+                }
118
+                catch (midcom_error $e) {
118 119
                     // Could not create index
119 120
                     $topic->delete();
120 121
                     throw $e;
Please login to merge, or discard this patch.
lib/net/nemein/wiki/handler/view.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
     public function __construct()
38 38
     {
39
-        $this->_request_data['page'] =& $this->_page;
39
+        $this->_request_data['page'] = & $this->_page;
40 40
     }
41 41
 
42 42
     /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         if (midcom::get()->config->get('enable_ajax_editing')) {
48 48
             $this->_controller = midcom_helper_datamanager2_controller::create('ajax');
49
-            $this->_controller->schemadb =& $this->_request_data['schemadb'];
49
+            $this->_controller->schemadb = & $this->_request_data['schemadb'];
50 50
             $this->_controller->set_storage($this->_page);
51 51
             $this->_controller->process_ajax();
52 52
             $this->_datamanager = $this->_controller->datamanager;
@@ -272,9 +272,9 @@  discard block
 block discarded – undo
272 272
         $toc .= "\n<ol class=\"midcom_helper_toc_formatter level_{$current_list_level}\">\n";
273 273
         foreach ($headings[4] as $key => $heading) {
274 274
             $anchor = 'heading-' . md5($heading);
275
-            $tag_level =& $headings[3][$key];
276
-            $heading_code =& $headings[0][$key];
277
-            $heading_tag =& $headings[2][$key];
275
+            $tag_level = & $headings[3][$key];
276
+            $heading_code = & $headings[0][$key];
277
+            $heading_tag = & $headings[2][$key];
278 278
             $heading_new_code = "<a id='{$anchor}'></a>{$heading_code}";
279 279
             $content = str_replace($heading_code, $heading_new_code, $content);
280 280
             if ($current_tag_level === false) {
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                     }
301 301
                 }
302 302
             }
303
-            $toc .= "<li class='{$heading_tag}'><a href='#{$anchor}'>" . strip_tags($heading) .  "</a>";
303
+            $toc .= "<li class='{$heading_tag}'><a href='#{$anchor}'>" . strip_tags($heading) . "</a>";
304 304
         }
305 305
         for ($i = $current_list_level; $i > 0; $i--) {
306 306
             $toc .= "</li>\n</ol>\n";
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
 
368 368
         $user = midcom::get()->auth->user->get_storage();
369 369
 
370
-        if (   array_key_exists('target', $_POST)
370
+        if (array_key_exists('target', $_POST)
371 371
             && $_POST['target'] == 'folder') {
372 372
             // We're subscribing to the whole wiki
373 373
             $object = $this->_topic;
Please login to merge, or discard this patch.
lib/net/nemein/rss/cron/fetchfeeds.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,8 @@
 block discarded – undo
31 31
         foreach ($feeds as $feed) {
32 32
             try {
33 33
                 midcom_db_topic::get_cached($feed->node);
34
-            } catch (midcom_error $e) {
34
+            }
35
+            catch (midcom_error $e) {
35 36
                 debug_add("Node #{$feed->node} does not exist, skipping feed #{$feed->id}", MIDCOM_LOG_ERROR);
36 37
                 continue;
37 38
             }
Please login to merge, or discard this patch.