@@ -143,7 +143,8 @@ |
||
143 | 143 | |
144 | 144 | try { |
145 | 145 | $data = file_get_contents($filename); |
146 | - } catch (Exception $e) { |
|
146 | + } |
|
147 | + catch (Exception $e) { |
|
147 | 148 | return false; |
148 | 149 | } |
149 | 150 |
@@ -4,7 +4,8 @@ |
||
4 | 4 | try { |
5 | 5 | $person = new midcom_db_person($metadata->locker); |
6 | 6 | $name = $person->name; |
7 | -} catch (midcom_error $e) { |
|
7 | +} |
|
8 | +catch (midcom_error $e) { |
|
8 | 9 | $name = $this->data['handler']->_l10n_midcom->get('unknown user'); |
9 | 10 | $e->log(); |
10 | 11 | } |
@@ -16,7 +16,8 @@ |
||
16 | 16 | foreach ($atts as $att) { |
17 | 17 | try { |
18 | 18 | $att->file_to_cache(); |
19 | - } catch (midcom_error $e) { |
|
19 | + } |
|
20 | + catch (midcom_error $e) { |
|
20 | 21 | echo 'Error: ' . $e->getMessage() . "\n"; |
21 | 22 | } |
22 | 23 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | $http_client = new org_openpsa_httplib(); |
57 | 57 | $http_client->set_param('timeout', 300); |
58 | -if ( !empty($_SERVER['PHP_AUTH_USER']) |
|
58 | +if (!empty($_SERVER['PHP_AUTH_USER']) |
|
59 | 59 | && !empty($_SERVER['PHP_AUTH_PW'])) { |
60 | 60 | $http_client->basicauth['user'] = $_SERVER['PHP_AUTH_USER']; |
61 | 61 | $http_client->basicauth['password'] = $_SERVER['PHP_AUTH_PW']; |
@@ -86,7 +86,7 @@ |
||
86 | 86 | return; |
87 | 87 | } |
88 | 88 | $initialized = true; |
89 | - if ( !midcom::get()->auth->user |
|
89 | + if (!midcom::get()->auth->user |
|
90 | 90 | || !midcom::get()->config->get('toolbars_enable_centralized') |
91 | 91 | || !midcom::get()->auth->can_user_do('midcom:centralized_toolbar', null, $this)) { |
92 | 92 | return; |
@@ -153,7 +153,8 @@ |
||
153 | 153 | $job['component'] = $component; |
154 | 154 | $this->_jobs[] = $job; |
155 | 155 | } |
156 | - } catch (midcom_error $e) { |
|
156 | + } |
|
157 | + catch (midcom_error $e) { |
|
157 | 158 | $e->log(MIDCOM_LOG_ERROR); |
158 | 159 | debug_print_r('Got this job declaration:', $job); |
159 | 160 | echo "ERROR: Failed to register a job for {$component}: " . $e->getMessage() . "\n"; |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | { |
464 | 464 | // Complete fields |
465 | 465 | $this->indexed = time(); |
466 | - if ( $this->author == '' |
|
466 | + if ($this->author == '' |
|
467 | 467 | && isset($this->creator->name)) { |
468 | 468 | $this->author = $this->creator->name; |
469 | 469 | } |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | public function read_metadata_from_object($object) |
607 | 607 | { |
608 | 608 | // Published is set to non-empty value, use it as creation data |
609 | - if ( !empty($object->metadata->published) |
|
609 | + if (!empty($object->metadata->published) |
|
610 | 610 | && !preg_match('/0{1,4}-0{1,2}0{1,2}\s+0{1,2}:0{1,2}:0{1,2}/', $object->metadata->published)) { |
611 | 611 | $this->created = $this->read_unixtime($object->metadata->published); |
612 | 612 | } elseif (isset($object->metadata->created)) { |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | return @strtotime($stamp); |
646 | 646 | } |
647 | 647 | // Unix timestamp |
648 | - return (int)$stamp; |
|
648 | + return (int) $stamp; |
|
649 | 649 | } |
650 | 650 | |
651 | 651 | /** |
@@ -680,7 +680,8 @@ |
||
680 | 680 | { |
681 | 681 | try { |
682 | 682 | return midcom_db_person::get_cached($id); |
683 | - } catch (midcom_error $e) { |
|
683 | + } |
|
684 | + catch (midcom_error $e) { |
|
684 | 685 | return false; |
685 | 686 | } |
686 | 687 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | private function process_attachment() |
95 | 95 | { |
96 | - if ( !isset($this->attachment->metadata) |
|
96 | + if (!isset($this->attachment->metadata) |
|
97 | 97 | || !is_object($this->attachment->metadata)) { |
98 | 98 | return; |
99 | 99 | } |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | if (strlen(trim($this->attachment->title)) > 0) { |
145 | - $this->title = "{$this->attachment->title} ({$this->attachment->name})"; |
|
145 | + $this->title = "{$this->attachment->title} ({$this->attachment->name})"; |
|
146 | 146 | $this->content .= "\n{$this->attachment->title}\n{$this->attachment->name}"; |
147 | 147 | } else { |
148 | - $this->title = $this->attachment->name; |
|
148 | + $this->title = $this->attachment->name; |
|
149 | 149 | $this->content .= "\n{$this->attachment->name}"; |
150 | 150 | } |
151 | 151 |
@@ -196,7 +196,8 @@ |
||
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 | } |
@@ -29,7 +29,7 @@ |
||
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; |