Completed
Pull Request — master (#314)
by Thomas
07:14
created
htdocs/src/Oc/SmartyPlugins/function.season.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
     ];
81 81
 
82 82
     $nTimestamp = time();
83
-    for ($nIndex = 0; $nIndex < count($seasons); $nIndex ++) {
83
+    for ($nIndex = 0; $nIndex < count($seasons); $nIndex++) {
84 84
         if (strtotime($seasons[$nIndex][0]) > $nTimestamp) {
85 85
             return $params['winter'];
86 86
         } //'';
Please login to merge, or discard this patch.
htdocs/okapi_settings.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         'DATA_LICENSE_URL' => $opt['page']['absolute_url'] . $opt['logic']['license']['terms'],
34 34
         'DEBUG'            => ($opt['debug'] & DEBUG_DEVELOPER != 0),
35 35
         'DEBUG_PREVENT_SEMAPHORES'
36
-                           => !$opt['php']['semaphores'],  # not available on old developer system
36
+                            => !$opt['php']['semaphores'],  # not available on old developer system
37 37
         'DB_SERVER'        => $opt['db']['servername'],
38 38
         'DB_NAME'          => $opt['db']['placeholder']['db'],
39 39
         'DB_USERNAME'      => $opt['db']['username'],
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
         'OC_NODE_ID'       => $opt['logic']['node']['id'],
55 55
         'OC_COOKIE_NAME'   => $opt['session']['cookiename'] . 'data',
56 56
         'OCDE_HTML_PURIFIER_SETTINGS'
57
-                           => $opt['html_purifier'],
57
+                            => $opt['html_purifier'],
58 58
         'GITHUB_ACCESS_TOKEN' => $opt['okapi']['github_access_token'],
59 59
     );
60 60
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,24 +16,24 @@  discard block
 block discarded – undo
16 16
     # [3] http://code.google.com/p/opencaching-api/issues/detail?id=132
17 17
 
18 18
     $opt['rootpath'] = $GLOBALS['rootpath'];
19
-    require $opt['rootpath'] . 'lib2/const.inc.php';   # (into the *local* scope!)
20
-    require $opt['rootpath'] . 'config2/settings-dist.inc.php';
21
-    require $opt['rootpath'] . 'config2/settings.inc.php';
19
+    require $opt['rootpath'].'lib2/const.inc.php'; # (into the *local* scope!)
20
+    require $opt['rootpath'].'config2/settings-dist.inc.php';
21
+    require $opt['rootpath'].'config2/settings.inc.php';
22 22
     
23 23
     return array(
24 24
 
25 25
         # Settings which ARE NOT present in settings.inc.php:
26 26
 
27
-        'OC_BRANCH' => 'oc.de',  # Tell OKAPI to work in "OCDE mode".
27
+        'OC_BRANCH' => 'oc.de', # Tell OKAPI to work in "OCDE mode".
28 28
 
29 29
         # Settings which ARE present in settings.inc.php:
30 30
 
31 31
         'ADMINS'           => array($opt['db']['warn']['mail'], '[email protected]'),
32 32
         'FROM_FIELD'       => $opt['mail']['contact'],
33
-        'DATA_LICENSE_URL' => $opt['page']['absolute_url'] . $opt['logic']['license']['terms'],
33
+        'DATA_LICENSE_URL' => $opt['page']['absolute_url'].$opt['logic']['license']['terms'],
34 34
         'DEBUG'            => ($opt['debug'] & DEBUG_DEVELOPER != 0),
35 35
         'DEBUG_PREVENT_SEMAPHORES'
36
-                           => !$opt['php']['semaphores'],  # not available on old developer system
36
+                           => !$opt['php']['semaphores'], # not available on old developer system
37 37
         'DB_SERVER'        => $opt['db']['servername'],
38 38
         'DB_NAME'          => $opt['db']['placeholder']['db'],
39 39
         'DB_USERNAME'      => $opt['db']['username'],
@@ -43,16 +43,16 @@  discard block
 block discarded – undo
43 43
         'TIMEZONE'         => $opt['php']['timezone'],
44 44
         'SITE_URL'         => $opt['page']['absolute_url'],
45 45
         'REGISTRATION_URL' => $opt['page']['https']['mode'] != HTTPS_DISABLED
46
-                                  ? 'https://' . $opt['page']['domain'] . '/register.php'
47
-                                  : $opt['page']['absolute_url'] . 'register.php',
46
+                                  ? 'https://'.$opt['page']['domain'].'/register.php'
47
+                                  : $opt['page']['absolute_url'].'register.php',
48 48
         'VAR_DIR'          => $opt['okapi']['var_dir'],
49 49
         'IMAGES_DIR'       => rtrim($opt['logic']['pictures']['dir'], '/'),
50 50
         'IMAGES_URL'       => rtrim($opt['logic']['pictures']['url'], '/').'/',
51 51
         'IMAGE_MAX_UPLOAD_SIZE' => 2 * $opt['logic']['pictures']['maxsize'],
52
-        'IMAGE_MAX_PIXEL_COUNT' => 786432,  # 1024 x 768; TODO: move PICTURE_MAX_LONG_SIDE to settings
53
-        'SITE_LOGO'        => $opt['page']['absolute_url'] . 'resource2/' . $opt['template']['default']['style'] . '/images/oclogo/oc_logo_alpha3.png',
52
+        'IMAGE_MAX_PIXEL_COUNT' => 786432, # 1024 x 768; TODO: move PICTURE_MAX_LONG_SIDE to settings
53
+        'SITE_LOGO'        => $opt['page']['absolute_url'].'resource2/'.$opt['template']['default']['style'].'/images/oclogo/oc_logo_alpha3.png',
54 54
         'OC_NODE_ID'       => $opt['logic']['node']['id'],
55
-        'OC_COOKIE_NAME'   => $opt['session']['cookiename'] . 'data',
55
+        'OC_COOKIE_NAME'   => $opt['session']['cookiename'].'data',
56 56
         'OCDE_HTML_PURIFIER_SETTINGS'
57 57
                            => $opt['html_purifier'],
58 58
         'GITHUB_ACCESS_TOKEN' => $opt['okapi']['github_access_token'],
Please login to merge, or discard this patch.
htdocs/mailto.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@
 block discarded – undo
55 55
 $text = isset($_REQUEST['text']) ? $_REQUEST['text'] : '';
56 56
 if (isset($_REQUEST['emailaddress'])) {
57 57
     $bEmailaddress = ($_REQUEST['emailaddress'] == 1);
58
-}
59
-else {
58
+} else {
60 59
     $own_user = new user($login->userid);
61 60
     $bEmailaddress = $own_user->getUsermailSendAddress();
62 61
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-require __DIR__ . '/lib2/web.inc.php';
8
+require __DIR__.'/lib2/web.inc.php';
9 9
 
10 10
 $tpl->name = 'mailto';
11 11
 $tpl->menuitem = MNU_USER_MAILTO;
12 12
 
13 13
 $login->verify();
14 14
 if ($login->userid == 0) {
15
-    $tpl->redirect('login.php?target=' . urlencode($tpl->target));
15
+    $tpl->redirect('login.php?target='.urlencode($tpl->target));
16 16
 }
17 17
 
18 18
 $userid = isset($_REQUEST['userid']) ? $_REQUEST['userid'] + 0 : 0;
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     $wp = $_REQUEST['wp'];
37 37
     $cachename = trim(sql_value("SELECT `name` FROM `caches` WHERE `wp_oc`='&1'", '', $wp));
38 38
     if ($cachename) {
39
-        $subject = $translate->t('Your geocache', '', 0, 0) . ' "' . $cachename . '" (' . $wp . ')';
39
+        $subject = $translate->t('Your geocache', '', 0, 0).' "'.$cachename.'" ('.$wp.')';
40 40
     }
41 41
 } elseif (isset($_REQUEST['reportid']) && $login->admin) {
42 42
     $rs = sql(
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $_REQUEST['reportid']
48 48
     );
49 49
     if ($r = sql_fetch_assoc($rs)) {
50
-        $subject = $translate->t('Your geocache report for', '', 0, 0) . ' ' . $r['wp_oc'] . ' (' . $r['name'] . ')';
50
+        $subject = $translate->t('Your geocache report for', '', 0, 0).' '.$r['wp_oc'].' ('.$r['name'].')';
51 51
     }
52 52
     sql_free_result($rs);
53 53
 }
Please login to merge, or discard this patch.
htdocs/lib2/logic/logpics.class.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
         global $login;
31 31
 
32 32
         $fields =
33
-          "`pics`.`uuid` AS `pic_uuid`,
33
+            "`pics`.`uuid` AS `pic_uuid`,
34 34
            `pics`.`url` AS `pic_url`,
35 35
            `pics`.`title`,
36 36
            `pics`.`date_created`,
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
     const FOR_STARTPAGE_GALLERY = 1;
18 18
     const FOR_NEWPICS_GALLERY = 2;
19 19
     const FOR_USER_STAT = 3;
20
-    const FOR_USER_GALLERY = 4;   // params: userid
20
+    const FOR_USER_GALLERY = 4; // params: userid
21 21
     const FOR_MYHOME_GALLERY = 5;
22
-    const FOR_CACHE_STAT = 6;     // params: cacheid
23
-    const FOR_CACHE_GALLERY = 7;  // params: cacheid
22
+    const FOR_CACHE_STAT = 6; // params: cacheid
23
+    const FOR_CACHE_GALLERY = 7; // params: cacheid
24 24
 
25
-    const MAX_PICTURES_PER_GALLERY_PAGE = 48;   // must be multiple of 6
25
+    const MAX_PICTURES_PER_GALLERY_PAGE = 48; // must be multiple of 6
26 26
 
27 27
 
28 28
     public static function get($purpose, $userid = 0, $cacheid = 0)
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         $pictures = self::get($purpose, $userid, $cacheid);
233 233
         $tpl->assign('pictures', array_slice($pictures, $startat, self::MAX_PICTURES_PER_GALLERY_PAGE));
234 234
 
235
-        $pager = new pager($url . "&startat={offset}");
235
+        $pager = new pager($url."&startat={offset}");
236 236
         $pager->make_from_offset($startat, count($pictures), self::MAX_PICTURES_PER_GALLERY_PAGE);
237 237
     }
238 238
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                 // only a few percent of caches. We must rely on fast data caching.
64 64
 
65 65
                 $rs = sql_slave(
66
-                    "SELECT
66
+                    "select
67 67
                         $fields,
68 68
                         `user`.`username`,
69 69
                         `pics`.`date_created` AS `picdate`
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
                 // This saves us one grouped subquery.
100 100
 
101 101
                 $rs = sql_slave(
102
-                    "SELECT $fields, `user`.`username`, `pics`.`date_created` AS `picdate`
102
+                    "select $fields, `user`.`username`, `pics`.`date_created` AS `picdate`
103 103
                      FROM
104 104
                         (SELECT `uuid`, `url`, `title`, `date_created`, `object_id`
105 105
                          FROM `pictures`
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 // all pics of one user, except spoilers and invisibles
139 139
 
140 140
                 $rs = sql(
141
-                    "SELECT $fields, `logs`.`date` AS `picdate`
141
+                    "select $fields, `logs`.`date` AS `picdate`
142 142
                      FROM `pictures` `pics`
143 143
                      $join_logs
144 144
                      $join_caches
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 // by an old log deletion (we should remove those ...)
155 155
 
156 156
                 $rs = sql(
157
-                    "SELECT $fields, `logs`.`date` AS `picdate`
157
+                    "select $fields, `logs`.`date` AS `picdate`
158 158
                      FROM `pictures` AS `pics`
159 159
                      $join_logs
160 160
                      WHERE `object_type`=1 AND `logs`.`user_id`='&1'
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                 // in listing view
192 192
 
193 193
                 $rs = sql(
194
-                    "SELECT $fields, `user`.`username`, `logs`.`date` AS `picdate`
194
+                    "select $fields, `user`.`username`, `logs`.`date` AS `picdate`
195 195
                      FROM `pictures` AS `pics`
196 196
                      $join_logs
197 197
                      $join_user
Please login to merge, or discard this patch.
htdocs/lib2/logic/gis.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         // number of points in the polygon
30 30
         $n = count($polygon);
31 31
         $poly1 = $polygon[0];
32
-        for ($i = 1; $i <= $n; $i ++) {
32
+        for ($i = 1; $i <= $n; $i++) {
33 33
             $poly1XY = explode(' ', $poly1);
34 34
             $poly1x = $poly1XY[0];
35 35
             $poly1y = $poly1XY[1];
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
                         if ($poly1y != $poly2y) {
45 45
                             $xinters = ($py - $poly1y) * ($poly2x - $poly1x) / ($poly2y - $poly1y) + $poly1x;
46 46
                             if ($poly1x == $poly2x || $px <= $xinters) {
47
-                                $counter ++;
47
+                                $counter++;
48 48
                             }
49 49
                         }
50 50
                     }
Please login to merge, or discard this patch.
htdocs/lib2/logic/cracklib.inc.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
     // min. 4 different chars
36 36
     $chars = array();
37
-    for ($i = 0; $i < mb_strlen($pw); $i ++) {
37
+    for ($i = 0; $i < mb_strlen($pw); $i++) {
38 38
         $chars[mb_substr($pw, $i, 1)] = true;
39 39
     }
40 40
 
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,8 @@
 block discarded – undo
75 75
 
76 76
     // $pw may not contain one of $addwords[]
77 77
     foreach ($wordlist as $v) {
78
-        if (mb_stripos($pw_lc, $v) !== false) {// mb_stripos needs PHP 5.2
78
+        if (mb_stripos($pw_lc, $v) !== false) {
79
+// mb_stripos needs PHP 5.2
79 80
             return false;
80 81
         }
81 82
     }
Please login to merge, or discard this patch.
htdocs/lib2/error.inc.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -7,34 +7,34 @@
 block discarded – undo
7 7
  *  Common error messages
8 8
  ***************************************************************************/
9 9
 
10
- define('ERROR_UNKNOWN', 1000);
11
- define('ERROR_TEMPLATE_NOT_FOUND', 1001);
12
- define('ERROR_COMPILATION_FAILED', 1002);
13
- define('ERROR_NO_ACCESS', 1003);
14
- define('ERROR_INVALID_OPERATION', 1004);
15
- define('ERROR_LOGIN_REQUIRED', 1005);
16
- define('ERROR_MAIL_TEMPLATE_NOT_FOUND', 1006);
17
- define('ERROR_NO_COOKIES', 1007);
18
- define('ERROR_ALREADY_LOGGEDIN', 1008);
19
- define('ERROR_USER_NOT_ACTIVE', 1009);
20
- define('ERROR_USER_NO_EMAIL', 1010);
21
- define('ERROR_CACHE_NOT_PUBLISHED', 1011);
22
- define('ERROR_CACHE_LOCKED', 1012);
10
+    define('ERROR_UNKNOWN', 1000);
11
+    define('ERROR_TEMPLATE_NOT_FOUND', 1001);
12
+    define('ERROR_COMPILATION_FAILED', 1002);
13
+    define('ERROR_NO_ACCESS', 1003);
14
+    define('ERROR_INVALID_OPERATION', 1004);
15
+    define('ERROR_LOGIN_REQUIRED', 1005);
16
+    define('ERROR_MAIL_TEMPLATE_NOT_FOUND', 1006);
17
+    define('ERROR_NO_COOKIES', 1007);
18
+    define('ERROR_ALREADY_LOGGEDIN', 1008);
19
+    define('ERROR_USER_NOT_ACTIVE', 1009);
20
+    define('ERROR_USER_NO_EMAIL', 1010);
21
+    define('ERROR_CACHE_NOT_PUBLISHED', 1011);
22
+    define('ERROR_CACHE_LOCKED', 1012);
23 23
 
24
- define('ERROR_SEARCHPLUGIN_WAYPOINT_FORMAT', 1013);
25
- define('ERROR_SEARCHPLUGIN_WAYPOINT_MANY', 1014);
26
- define('ERROR_SEARCHPLUGIN_WAYPOINT_NOTFOUND', 1015);
24
+    define('ERROR_SEARCHPLUGIN_WAYPOINT_FORMAT', 1013);
25
+    define('ERROR_SEARCHPLUGIN_WAYPOINT_MANY', 1014);
26
+    define('ERROR_SEARCHPLUGIN_WAYPOINT_NOTFOUND', 1015);
27 27
  
28
- define('ERROR_DB_COULD_NOT_RECONNECT', 1016);
29
- define('ERROR_DB_NO_ROOT', 1017);
28
+    define('ERROR_DB_COULD_NOT_RECONNECT', 1016);
29
+    define('ERROR_DB_NO_ROOT', 1017);
30 30
 
31
- define('ERROR_USER_NOT_EXISTS', 1018);
32
- define('ERROR_CACHE_NOT_EXISTS', 1019);
33
- define('ERROR_CACHELOG_NOT_EXISTS', 1020);
34
- define('ERROR_PICTURE_NOT_EXISTS', 1021);
31
+    define('ERROR_USER_NOT_EXISTS', 1018);
32
+    define('ERROR_CACHE_NOT_EXISTS', 1019);
33
+    define('ERROR_CACHELOG_NOT_EXISTS', 1020);
34
+    define('ERROR_PICTURE_NOT_EXISTS', 1021);
35 35
 
36
- define('ERROR_UPLOAD_ERR_NO_FILE', 1022);
37
- define('ERROR_UPLOAD_ERR_SIZE', 1023);
38
- define('ERROR_UPLOAD_ERR_TYPE', 1024);
39
- define('ERROR_UPLOAD_UNKNOWN', 1025);
40
- define('ERROR_UPLOAD_ERR_BAD_FORMAT', 1026);
36
+    define('ERROR_UPLOAD_ERR_NO_FILE', 1022);
37
+    define('ERROR_UPLOAD_ERR_SIZE', 1023);
38
+    define('ERROR_UPLOAD_ERR_TYPE', 1024);
39
+    define('ERROR_UPLOAD_UNKNOWN', 1025);
40
+    define('ERROR_UPLOAD_ERR_BAD_FORMAT', 1026);
Please login to merge, or discard this patch.
htdocs/lib2/login.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@
 block discarded – undo
20 20
  *
21 21
  ***************************************************************************/
22 22
 
23
-define('LOGIN_UNKNOWN_ERROR', - 1);     // unkown error occured
24
-define('LOGIN_OK', 0);                 // login succeeded
25
-define('LOGIN_BADUSERPW', 1);          // bad username or password
26
-define('LOGIN_TOOMUCHLOGINS', 2);      // too many logins in short time
27
-define('LOGIN_USERNOTACTIVE', 3);      // the useraccount locked
23
+define('LOGIN_UNKNOWN_ERROR', - 1); // unkown error occured
24
+define('LOGIN_OK', 0); // login succeeded
25
+define('LOGIN_BADUSERPW', 1); // bad username or password
26
+define('LOGIN_TOOMUCHLOGINS', 2); // too many logins in short time
27
+define('LOGIN_USERNOTACTIVE', 3); // the useraccount locked
28 28
 define('LOGIN_EMPTY_USERPASSWORD', 4); // given username/password was empty
29
-define('LOGIN_LOGOUT_OK', 5);          // logout was successfull
29
+define('LOGIN_LOGOUT_OK', 5); // logout was successfull
30 30
 
31 31
 // login times in seconds
32 32
 define('LOGIN_TIME', 60 * 60);
Please login to merge, or discard this patch.
htdocs/ignore.php 2 patches
Switch Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@
 block discarded – undo
29 29
 }
30 30
 
31 31
 switch ($action) {
32
-    case 'addignore':
33
-        sql("INSERT IGNORE INTO `cache_ignore` (`cache_id`, `user_id`) VALUES ('&1', '&2')", $cache_id, $login->userid);
34
-        break;
35
-    case 'removeignore':
36
-        sql("DELETE FROM `cache_ignore` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $login->userid);
37
-        break;
32
+        case 'addignore':
33
+            sql("INSERT IGNORE INTO `cache_ignore` (`cache_id`, `user_id`) VALUES ('&1', '&2')", $cache_id, $login->userid);
34
+            break;
35
+        case 'removeignore':
36
+            sql("DELETE FROM `cache_ignore` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $login->userid);
37
+            break;
38 38
 }
39 39
 
40 40
 // clear cached map result, so that the change directly appears on the map
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,11 +5,11 @@  discard block
 block discarded – undo
5 5
  *  Unicode Reminder メモ
6 6
  ***************************************************************************/
7 7
 
8
-require __DIR__ . '/lib2/web.inc.php';
8
+require __DIR__.'/lib2/web.inc.php';
9 9
 
10 10
 $cache_id = isset($_GET['cacheid']) ? $_GET['cacheid'] + 0 : 0;
11 11
 $action = isset($_GET['action']) ? $_GET['action'] : '';
12
-$target = isset($_GET['target']) ? $_GET['target'] : 'viewcache.php?cacheid=' . $cache_id;
12
+$target = isset($_GET['target']) ? $_GET['target'] : 'viewcache.php?cacheid='.$cache_id;
13 13
 
14 14
 $login->verify();
15 15
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $map_result_id = sql_value(
42 42
     "SELECT `result_id`
43 43
      FROM `map2_result`
44
-     WHERE INSTR(sqlquery,\"`user_id`='" . sql_escape($login->userid) . "'\")
44
+     WHERE INSTR(sqlquery,\"`user_id`='" . sql_escape($login->userid)."'\")
45 45
      LIMIT 1",
46 46
     0
47 47
 );
Please login to merge, or discard this patch.