Passed
Pull Request — development (#686)
by Thomas
06:49
created
htdocs/config2/locale.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
  *                 $opt['locale']
18 18
  ***************************************************************************/
19 19
 
20
-define('OC_LOCALE_ACTIVE', 2);    // enable language and show language button in header line
21
-define('OC_LOCALE_HIDDEN', 1);    // enable language but hide language button in header line
22
-define('OC_LOCALE_DISABLED', 0);  // disable language
20
+define('OC_LOCALE_ACTIVE', 2); // enable language and show language button in header line
21
+define('OC_LOCALE_HIDDEN', 1); // enable language but hide language button in header line
22
+define('OC_LOCALE_DISABLED', 0); // disable language
23 23
 
24 24
 $opt['template']['locales']['DE']['status'] = OC_LOCALE_ACTIVE;
25 25
 $opt['template']['locales']['DE']['flag'] = 'images/flag/DE.png';
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 $opt['locale']['DE']['page']['license'] = '<a rel="license" href="%1"><img alt="Creative Commons Lizenzvertrag" style="border-width:0" src="resource2/ocstyle/images/media/cc-by-nc-nd-small.png" /></a><div style="text-align:center; margin:8px 0 0 6px;">Die <a href="articles.php?page=impressum#datalicense">Inhalte</a> von {site} stehen unter der Creative-Commons-Lizenz <a rel="license" href="%1">BY-NC-ND 3.0 DE</a>.</div>';
132 132
 $opt['locale']['DE']['helpwiki'] = 'http://wiki.opencaching.de/index.php/';
133 133
 $opt['locale']['DE']['mostly_translated'] = true;
134
-$opt['locale']['DE']['what3words'] = true;  // "beta"
134
+$opt['locale']['DE']['what3words'] = true; // "beta"
135 135
 
136 136
 $opt['locale']['IT']['format']['dateshort'] = '%d/%m/%y';
137 137
 $opt['locale']['IT']['format']['dm'] = '%d/%m';
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 $opt['locale']['SV']['page']['subtitle1'] = 'Geocaching med Opencaching';
234 234
 $opt['locale']['SV']['page']['subtitle2'] = '';
235 235
 $opt['locale']['SV']['mostly_translated'] = false;
236
-$opt['locale']['SV']['what3words'] = true;  // "beta"
236
+$opt['locale']['SV']['what3words'] = true; // "beta"
237 237
 
238 238
 $opt['locale']['NO']['format']['dateshort'] = '%d.%m.%y';
239 239
 $opt['locale']['NO']['format']['dm'] = '%d.%m.';
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 $opt['locale']['RU']['country'] = 'RU';
284 284
 $opt['locale']['RU']['primary_lang_of'] = ['RU'];
285 285
 $opt['locale']['RU']['mostly_translated'] = false;
286
-$opt['locale']['RU']['what3words'] = true;   // "beta"
286
+$opt['locale']['RU']['what3words'] = true; // "beta"
287 287
 
288 288
 $opt['locale']['DA']['format']['dateshort'] = '%d.%m.%y';
289 289
 $opt['locale']['DA']['format']['dm'] = '%d.%m.';
Please login to merge, or discard this patch.
htdocs/lib2/logic/useroptions.class.php 1 patch
Doc Comments   +8 added lines patch added patch discarded remove patch
@@ -113,6 +113,11 @@  discard block
 block discarded – undo
113 113
         return $this->nOptions[$pId]['internal_use'];
114 114
     }
115 115
 
116
+    /**
117
+     * @param integer $pId
118
+     *
119
+     * @return string
120
+     */
116 121
     public function getOptValue($pId)
117 122
     {
118 123
         if ($pId == USR_OPT_SHOWSTATS &&
@@ -129,6 +134,9 @@  discard block
 block discarded – undo
129 134
         return false;
130 135
     }
131 136
 
137
+    /**
138
+     * @param integer $pValue
139
+     */
132 140
     public function setOptVisible($pId, $pValue)
133 141
     {
134 142
         $pId += 0;
Please login to merge, or discard this patch.
htdocs/lib2/menu.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                         'parent' => MNU_MAP
81 81
                     ];
82 82
                     $menuitem[MNU_MAP]['subitems'][] = $menu_map;
83
-                    ++ $menu_map;
83
+                    ++$menu_map;
84 84
                 }
85 85
             }
86 86
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $rsSubmenu = sqlf("SELECT `id` FROM `sys_menu` WHERE `parent`=0 ORDER BY `parent` ASC, `position` ASC");
108 108
         while ($rSubmenu = sql_fetch_assoc($rsSubmenu)) {
109 109
             $aMenu[MNU_ROOT]['subitems'][$nPos] = $rSubmenu['id'];
110
-            $nPos ++;
110
+            $nPos++;
111 111
         }
112 112
         sql_free_result($rsSubmenu);
113 113
         fwrite($f, "\n");
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             );
145 145
             while ($rSubmenu = sql_fetch_assoc($rsSubmenu)) {
146 146
                 $aMenu[$r['id']]['subitems'][$nPos] = $rSubmenu['id'];
147
-                $nPos ++;
147
+                $nPos++;
148 148
             }
149 149
             sql_free_result($rsSubmenu);
150 150
         }
Please login to merge, or discard this patch.
htdocs/src/Oc/Session/SessionDataNative.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                     // TODO fix the following if statement, seems corrupted
51 51
                     if (strtolower(
52 52
                             substr(
53
-                                'http' + strstr($_SERVER['REFERER'], '://'),
53
+                                'http' +strstr($_SERVER['REFERER'], '://'),
54 54
                                 0,
55 55
                                 strlen($opt['page']['absolute_http_url'])
56 56
                             )
Please login to merge, or discard this patch.
htdocs/lib2/logic/picture.class.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -464,9 +464,9 @@
 block discarded – undo
464 464
                 return false;
465 465
             } else {
466 466
                 // restore picture file
467
-                $this->setUrl($original_url);     // set the url, so that we can
467
+                $this->setUrl($original_url); // set the url, so that we can
468 468
                 $filename = $this->getFilename(); // .. retrieve the file path+name
469
-                $this->setFilenames($filename);   // now set url(s) from the new uuid
469
+                $this->setFilenames($filename); // now set url(s) from the new uuid
470 470
                 try {
471 471
                     rename($this->deletedFilename($filename), $this->getFilename());
472 472
                 } catch (Exception $e) {
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
     }
693 693
 
694 694
     /**
695
-     * @return bool|string
695
+     * @return string|false
696 696
      */
697 697
     public function getPageLink()
698 698
     {
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
     /**
725 725
      * @param $tmpFile
726 726
      * @param $longSideSize
727
-     * @return bool
727
+     * @return null|boolean
728 728
      */
729 729
     public function rotate_and_shrink($tmpFile, $longSideSize)
730 730
     {
Please login to merge, or discard this patch.
htdocs/lib2/ss_zip.class.php 2 patches
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,7 @@
 block discarded – undo
34 34
     public $cdir = [];
35 35
 
36 36
     /**    constructor
37
-
38
-*
37
+     *
39 38
 *@param string $zipFile if not empty must contain path to valid zip file, ss_zip will try to open and parse it.
40 39
      *               If this parameter is empty, the new empty zip archive is created. This parameter has no meaning in
41 40
      *               LIGHT verion, please upgrade to PROfessional version.
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -143,9 +143,9 @@  discard block
 block discarded – undo
143 143
         }
144 144
 
145 145
         $fnl = strlen($filename);
146
-        $fh = "\x14\x00";    // ver needed to extract
147
-        $fh .= "\x00\x00";    // gen purpose bit flag
148
-        $fh .= "\x08\x00";    // compression method
146
+        $fh = "\x14\x00"; // ver needed to extract
147
+        $fh .= "\x00\x00"; // gen purpose bit flag
148
+        $fh .= "\x08\x00"; // compression method
149 149
         $fh .= "\x00\x00\x00\x00"; // last mod time and date
150 150
         $fh .=
151 151
             pack(
@@ -172,16 +172,16 @@  discard block
 block discarded – undo
172 172
                 "va*v3V2",
173 173
                 0,
174 174
                 $fh,
175
-                0,        // file comment length
176
-                0,        // disk number start
177
-                0,        // internal file attributes
178
-                $attr,    // external file attributes - 'archive/directory' bit set
175
+                0, // file comment length
176
+                0, // disk number start
177
+                0, // internal file attributes
178
+                $attr, // external file attributes - 'archive/directory' bit set
179 179
                 $this->offset
180 180
             ) . $filename;
181 181
 
182 182
         $this->offset += 42 + $fnl + $gzsize;
183 183
         $this->cdir[] = $cdir;
184
-        $this->cnt ++;
184
+        $this->cnt++;
185 185
         $this->idx = $this->cnt - 1;
186 186
     }
187 187
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                 $cdsl, // size of central dir
231 231
                 $zdsl, // offset to start of central dir
232 232
                 0
233
-            );              // .zip file comment length
233
+            ); // .zip file comment length
234 234
         return $this->zipfile;
235 235
     }
236 236
 
Please login to merge, or discard this patch.
htdocs/lib2/Net/IDNA2.php 1 patch
Spacing   +12 added lines, -14 removed lines patch added patch discarded remove patch
@@ -2322,8 +2322,7 @@  discard block
 block discarded – undo
2322 2322
         // Forcing conversion of input to UCS4 array
2323 2323
         // If one time encoding is given, use this, else the objects property
2324 2324
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
2325
-            case 'utf8':
2326
-                $decoded = $this->_utf8_to_ucs4($decoded);
2325
+            case 'utf8' : $decoded = $this->_utf8_to_ucs4($decoded);
2327 2326
                 break;
2328 2327
             case 'ucs4_string':
2329 2328
                 $decoded = $this->_ucs4_string_to_ucs4($decoded);
@@ -2478,8 +2477,7 @@  discard block
 block discarded – undo
2478 2477
         // The output is UTF-8 by default, other output formats need conversion here
2479 2478
         // If one time encoding is given, use this, else the objects property
2480 2479
         switch (($one_time_encoding) ? $one_time_encoding : $this->_api_encoding) {
2481
-            case 'utf8':
2482
-                return $return;
2480
+            case 'utf8' : return $return;
2483 2481
                 break;
2484 2482
             case 'ucs4_string':
2485 2483
                 return $this->_ucs4_to_ucs4_string($this->_utf8_to_ucs4($return));
@@ -2714,12 +2712,12 @@  discard block
 block discarded – undo
2714 2712
                     break;
2715 2713
                 }
2716 2714
 
2717
-                $w = (int) ($w * ($this->_base - $t));
2715
+                $w = (int)($w * ($this->_base - $t));
2718 2716
             }
2719 2717
 
2720 2718
             $bias = $this->_adapt($idx - $old_idx, $deco_len + 1, $is_first);
2721 2719
             $is_first = false;
2722
-            $char += (int) ($idx / ($deco_len + 1));
2720
+            $char += (int)($idx / ($deco_len + 1));
2723 2721
             $idx %= ($deco_len + 1);
2724 2722
 
2725 2723
             if ($deco_len > 0) {
@@ -2746,14 +2744,14 @@  discard block
 block discarded – undo
2746 2744
      */
2747 2745
     private function _adapt($delta, $npoints, $is_first)
2748 2746
     {
2749
-        $delta = (int) ($is_first ? ($delta / $this->_damp) : ($delta / 2));
2750
-        $delta += (int) ($delta / $npoints);
2747
+        $delta = (int)($is_first ? ($delta / $this->_damp) : ($delta / 2));
2748
+        $delta += (int)($delta / $npoints);
2751 2749
 
2752 2750
         for ($k = 0; $delta > (($this->_base - $this->_tmin) * $this->_tmax) / 2; $k += $this->_base) {
2753
-            $delta = (int) ($delta / ($this->_base - $this->_tmin));
2751
+            $delta = (int)($delta / ($this->_base - $this->_tmin));
2754 2752
         }
2755 2753
 
2756
-        return (int) ($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew));
2754
+        return (int)($k + ($this->_base - $this->_tmin + 1) * $delta / ($delta + $this->_skew));
2757 2755
     }
2758 2756
 
2759 2757
     /**
@@ -2899,8 +2897,8 @@  discard block
 block discarded – undo
2899 2897
 
2900 2898
         $result = [];
2901 2899
         $T = $this->_tbase + $sindex % $this->_tcount;
2902
-        $result[] = (int) ($this->_lbase + $sindex / $this->_ncount);
2903
-        $result[] = (int) ($this->_vbase + ($sindex % $this->_ncount) / $this->_tcount);
2900
+        $result[] = (int)($this->_lbase + $sindex / $this->_ncount);
2901
+        $result[] = (int)($this->_vbase + ($sindex % $this->_ncount) / $this->_tcount);
2904 2902
 
2905 2903
         if ($T != $this->_tbase) {
2906 2904
             $result[] = $T;
@@ -3141,7 +3139,7 @@  discard block
 block discarded – undo
3141 3139
                     throw new UnexpectedValueException('This might be UTF-8, but I don\'t understand it at byte ' . $k);
3142 3140
                 }
3143 3141
                 if ('add' == $mode) {
3144
-                    $output[$out_len] = (int) $v;
3142
+                    $output[$out_len] = (int)$v;
3145 3143
                     ++$out_len;
3146 3144
                     continue;
3147 3145
                 }
@@ -3361,7 +3359,7 @@  discard block
 block discarded – undo
3361 3359
             return mb_strlen($string, '8bit');
3362 3360
         }
3363 3361
 
3364
-        return strlen((binary) $string);
3362
+        return strlen((binary)$string);
3365 3363
     }
3366 3364
 
3367 3365
     // }}}}
Please login to merge, or discard this patch.
htdocs/lib2/search/search.xml.inc.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -205,7 +205,7 @@
 block discarded – undo
205 205
 
206 206
 /**
207 207
  * @param string $str
208
- * @return mixed
208
+ * @return string
209 209
  */
210 210
 function lf2crlf($str)
211 211
 {
Please login to merge, or discard this patch.
htdocs/translate.php 1 patch
Switch Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -86,83 +86,83 @@  discard block
 block discarded – undo
86 86
 }
87 87
 
88 88
 switch ($action) {
89
-    case 'selectlang':
90
-        break;
89
+        case 'selectlang':
90
+            break;
91 91
 
92
-    case 'verify':
93
-        verify();
94
-        break;
92
+        case 'verify':
93
+            verify();
94
+            break;
95 95
 
96
-    case 'resetids':
97
-        resetIds();
98
-        break;
96
+        case 'resetids':
97
+            resetIds();
98
+            break;
99 99
 
100
-    case 'clearcache':
101
-        clearCache();
102
-        break;
100
+        case 'clearcache':
101
+            clearCache();
102
+            break;
103 103
 
104
-    case 'export':
105
-        export();
106
-        break;
104
+        case 'export':
105
+            export();
106
+            break;
107 107
 
108
-    case 'xmlexport':
109
-        xmlexport();
110
-        break;
108
+        case 'xmlexport':
109
+            xmlexport();
110
+            break;
111 111
 
112
-    case 'xmlimport':
113
-        break;
112
+        case 'xmlimport':
113
+            break;
114 114
 
115
-    case 'xmlimport2':
116
-        xmlimport2();
117
-        break;
115
+        case 'xmlimport2':
116
+            xmlimport2();
117
+            break;
118 118
 
119
-    case 'xmlimport3':
120
-        xmlimport3();
121
-        break;
119
+        case 'xmlimport3':
120
+            xmlimport3();
121
+            break;
122 122
 
123
-    case 'textexportnew':
124
-        textexport($translang, false);
125
-        break;
123
+        case 'textexportnew':
124
+            textexport($translang, false);
125
+            break;
126 126
 
127
-    case 'textexportall':
128
-        textexport($translang, true);
129
-        break;
127
+        case 'textexportall':
128
+            textexport($translang, true);
129
+            break;
130 130
 
131
-    case 'textimport':
132
-        break;
131
+        case 'textimport':
132
+            break;
133 133
 
134
-    case 'textimport2':
135
-        textimport($translang);
136
-        break;
134
+        case 'textimport2':
135
+            textimport($translang);
136
+            break;
137 137
 
138
-    case 'edit':
139
-        if (!$access->mayTranslate($translang)) {
140
-            $tpl->error(ERROR_NO_ACCESS);
141
-        }
142
-        edit();
143
-        break;
138
+        case 'edit':
139
+            if (!$access->mayTranslate($translang)) {
140
+                $tpl->error(ERROR_NO_ACCESS);
141
+            }
142
+            edit();
143
+            break;
144 144
 
145
-    case 'copy_en':
146
-        copy_english_texts();
147
-        break;
145
+        case 'copy_en':
146
+            copy_english_texts();
147
+            break;
148 148
 
149
-    case 'listfaults':
150
-        $trans = sql(
151
-            'SELECT `sys_trans`.`id`,
149
+        case 'listfaults':
150
+            $trans = sql(
151
+                'SELECT `sys_trans`.`id`,
152 152
                     `sys_trans`.`text`
153 153
              FROM `sys_trans`
154 154
              LEFT JOIN `sys_trans_ref`
155 155
                 ON `sys_trans`.`id`=`sys_trans_ref`.`trans_id`
156 156
              WHERE ISNULL(`sys_trans_ref`.`trans_id`)
157 157
              ORDER BY `sys_trans`.`id` DESC'
158
-        );
159
-        $tpl->assign_rs('trans', $trans);
160
-        sql_free_result($trans);
161
-        break;
158
+            );
159
+            $tpl->assign_rs('trans', $trans);
160
+            sql_free_result($trans);
161
+            break;
162 162
 
163
-    case 'listall':
164
-        $trans = sql(
165
-            "SELECT `sys_trans`.`id`,
163
+        case 'listall':
164
+            $trans = sql(
165
+                "SELECT `sys_trans`.`id`,
166 166
                     `sys_trans`.`text`,
167 167
                     `sys_trans_text`.`text` AS `trans`
168 168
              FROM `sys_trans`
@@ -170,48 +170,48 @@  discard block
 block discarded – undo
170 170
                ON `sys_trans`.`id`=`sys_trans_text`.`trans_id`
171 171
                AND `sys_trans_text`.`lang`='&1'
172 172
              ORDER BY `sys_trans`.`id` DESC",
173
-            $translang
174
-        );
175
-        $tpl->assign_rs('trans', $trans);
176
-        sql_free_result($trans);
177
-        break;
173
+                $translang
174
+            );
175
+            $tpl->assign_rs('trans', $trans);
176
+            sql_free_result($trans);
177
+            break;
178 178
 
179
-    case 'remove':
180
-        if (!$access->mayTranslate($translang)) {
181
-            $tpl->error(ERROR_NO_ACCESS);
182
-        }
183
-        remove();
184
-        break;
185
-
186
-    case 'scan':
187
-        scan();
188
-        break;
189
-
190
-    case 'scanstart':
191
-        scanStart();
192
-        break;
193
-
194
-    case 'scanfile':
195
-        $filename = isset($_REQUEST['filename']) ? $_REQUEST['filename'] : '';
196
-        scanFile($filename);
197
-        exit;
198
-
199
-    case 'quicknone':
200
-        $cookie->un_set('translate_mode');
201
-        break;
202
-
203
-    case 'quicknew':
204
-        $cookie->set('translate_mode', 'new');
205
-        break;
206
-
207
-    case 'quickall':
208
-        $cookie->set('translate_mode', 'all');
209
-        break;
210
-
211
-    default:
212
-        $action = 'listnew';
213
-        $trans = sql(
214
-            "SELECT DISTINCT `sys_trans`.`id`,
179
+        case 'remove':
180
+            if (!$access->mayTranslate($translang)) {
181
+                $tpl->error(ERROR_NO_ACCESS);
182
+            }
183
+            remove();
184
+            break;
185
+
186
+        case 'scan':
187
+            scan();
188
+            break;
189
+
190
+        case 'scanstart':
191
+            scanStart();
192
+            break;
193
+
194
+        case 'scanfile':
195
+            $filename = isset($_REQUEST['filename']) ? $_REQUEST['filename'] : '';
196
+            scanFile($filename);
197
+            exit;
198
+
199
+        case 'quicknone':
200
+            $cookie->un_set('translate_mode');
201
+            break;
202
+
203
+        case 'quicknew':
204
+            $cookie->set('translate_mode', 'new');
205
+            break;
206
+
207
+        case 'quickall':
208
+            $cookie->set('translate_mode', 'all');
209
+            break;
210
+
211
+        default:
212
+            $action = 'listnew';
213
+            $trans = sql(
214
+                "SELECT DISTINCT `sys_trans`.`id`,
215 215
                              `sys_trans`.`text`
216 216
              FROM `sys_trans`
217 217
              LEFT JOIN `sys_trans_text`
@@ -222,10 +222,10 @@  discard block
 block discarded – undo
222 222
              WHERE ISNULL(`sys_trans_text`.`trans_id`)
223 223
                OR `sys_trans_text`.`text`=''
224 224
              ORDER BY `sys_trans`.`id` DESC",
225
-            $translang
226
-        );
227
-        $tpl->assign_rs('trans', $trans);
228
-        sql_free_result($trans);
225
+                $translang
226
+            );
227
+            $tpl->assign_rs('trans', $trans);
228
+            sql_free_result($trans);
229 229
 }
230 230
 
231 231
 $languages = [];
Please login to merge, or discard this patch.