Passed
Push — trunk ( 338765...433e05 )
by SuperNova.WS
04:23
created
includes/includes/flt_page3.inc 1 patch
Spacing   +41 added lines, -42 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 use Planet\DBStaticPlanet;
8 8
 use Unit\DBStaticUnit;
9 9
 
10
-if(SN_IN_FLEET !== true) {
10
+if (SN_IN_FLEET !== true) {
11 11
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
12 12
 }
13 13
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     $errorlist .= $lang['fl_limit_galaxy'];
27 27
   if (!$system || $system > $config->game_maxSystem || $system < 1)
28 28
     $errorlist .= $lang['fl_limit_system'];
29
-  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE ))
29
+  if (!$planet || $planet < 1 || ($planet > $config->game_maxPlanet && $target_mission != MT_EXPLORE))
30 30
     $errorlist .= $lang['fl_limit_planet'];
31 31
   if ($planetrow['galaxy'] == $galaxy && $planetrow['system'] == $system && $planetrow['planet'] == $planet && $planetrow['planet_type'] == $planet_type)
32 32
     $errorlist .= $lang['fl_ownpl_err'];
@@ -53,35 +53,35 @@  discard block
 block discarded – undo
53 53
   $planetrow = DBStaticPlanet::db_planet_by_id($planetrow['id'], true);
54 54
 
55 55
   if ($target_mission == MT_EXPLORE) {
56
-    if ($MaxExpeditions == 0 ) {
56
+    if ($MaxExpeditions == 0) {
57 57
       $errorlist .= $lang['fl_expe_notech'];
58
-    } elseif ($FlyingExpeditions >= $MaxExpeditions ) {
58
+    } elseif ($FlyingExpeditions >= $MaxExpeditions) {
59 59
       $errorlist .= $lang['fl_expe_max'];
60 60
     }
61 61
   } else {
62
-    if ($TargetPlanet['id_owner']){
62
+    if ($TargetPlanet['id_owner']) {
63 63
       if ($target_mission == MT_COLONIZE)
64 64
         $errorlist .= $lang['fl_colonized'];
65 65
 
66
-      if ($TargetPlanet['id_owner'] == $planetrow['id_owner']){
66
+      if ($TargetPlanet['id_owner'] == $planetrow['id_owner']) {
67 67
         if ($target_mission == MT_ATTACK)
68 68
           $errorlist .= $lang['fl_no_self_attack'];
69 69
 
70 70
         if ($target_mission == MT_SPY)
71 71
           $errorlist .= $lang['fl_no_self_spy'];
72
-      }else{
72
+      } else {
73 73
         if ($target_mission == MT_RELOCATE)
74 74
           $errorlist .= $lang['fl_only_stay_at_home'];
75 75
       }
76
-    }else{
77
-      if ($target_mission < MT_COLONIZE){
76
+    } else {
77
+      if ($target_mission < MT_COLONIZE) {
78 78
         $errorlist .= $lang['fl_unknow_target'];
79
-      }else{
79
+      } else {
80 80
         if ($target_mission == MT_DESTROY)
81 81
           $errorlist .= $lang['fl_nomoon'];
82 82
 
83
-        if ($target_mission == MT_RECYCLE){
84
-          if($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
83
+        if ($target_mission == MT_RECYCLE) {
84
+          if ($TargetPlanet['debris_metal'] + $TargetPlanet['debris_crystal'] == 0)
85 85
             $errorlist .= $lang['fl_nodebris'];
86 86
         }
87 87
       }
@@ -89,13 +89,13 @@  discard block
 block discarded – undo
89 89
   }
90 90
 
91 91
 
92
-  if(is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) {
92
+  if (is_object($captainModule = moduleCaptain()) && $captain_id = sys_get_param_id('captain_id')) {
93 93
     $captain = $captainModule->unit_captain_get($planetrow['id']);
94 94
 //      mrc_get_level($user, $planetrow, UNIT_CAPTAIN, true);
95
-    if(!$captain) {
95
+    if (!$captain) {
96 96
       $errorlist .= $lang['module_unit_captain_error_no_captain'];
97
-    } elseif($captain['unit_location_type'] == LOC_PLANET) {
98
-      if($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) {
97
+    } elseif ($captain['unit_location_type'] == LOC_PLANET) {
98
+      if ($target_mission == MT_RELOCATE && ($arriving_captain = mrc_get_level($user, $TargetPlanet, UNIT_CAPTAIN, true))) {
99 99
         $errorlist .= $lang['module_unit_captain_error_captain_already_bound'];
100 100
       }
101 101
     } else {
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
 
106 106
   if ($errorlist) {
107 107
     sn_db_transaction_rollback();
108
-    messageBox ("<span class='error'><ul>{$errorlist}</ul></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, false);
108
+    messageBox("<span class='error'><ul>{$errorlist}</ul></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, false);
109 109
   }
110 110
 
111 111
   // On verifie s'il y a assez de vaisseaux sur la planete !
112 112
   foreach ($fleetarray as $Ship => $Count) {
113 113
     if ($Count > mrc_get_level($user, $planetrow, $Ship)) {
114
-      messageBox ("<span class='error'><b>{$lang['fl_fleet_err']}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
114
+      messageBox("<span class='error'><b>{$lang['fl_fleet_err']}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
115 115
     }
116 116
   }
117 117
 
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
   $fleet_group = max(0, intval($_POST['fleet_group']));
120 120
   //But is it acs??
121 121
   //Well all acs fleets must have a fleet code.
122
-  if($fleet_group) {
122
+  if ($fleet_group) {
123 123
     //Also it must be mission type 2
124 124
     $target_mission = MT_AKS;
125 125
 
126 126
     //The co-ords must be the same as where the acs fleet is going.
127 127
     $target = "g{$galaxy}s{$system}p{$planet}t{$planet_type}";
128
-    if($_POST['acs_target_mr'] == $target) {
128
+    if ($_POST['acs_target_mr'] == $target) {
129 129
       //ACS attack must exist (if acs fleet has arrived this will also return false (2 checks in 1!!!)
130 130
       $aks = doquery("SELECT * FROM {{aks}} WHERE id = '{$fleet_group}' LIMIT 1;", true);
131 131
       if (!$aks) {
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
     }
142 142
   }
143 143
   //Check that a failed acs attack isn't being sent, if it is, make it an attack fleet.
144
-  if(!$fleet_group && $target_mission == MT_AKS) {
144
+  if (!$fleet_group && $target_mission == MT_AKS) {
145 145
     $target_mission = MT_ATTACK;
146 146
   }
147 147
 
@@ -151,22 +151,21 @@  discard block
 block discarded – undo
151 151
   $options = array('fleet_speed_percent' => $speed_percent, 'fleet_group' => $fleet_group, 'resources' => $StorageNeeded);
152 152
   $cant_attack = flt_can_attack($planetrow, $TargetPlanet, $fleetarray, $target_mission, $options);
153 153
 
154
-  if($cant_attack !== ATTACK_ALLOWED) {
154
+  if ($cant_attack !== ATTACK_ALLOWED) {
155 155
     messageBox("<span class='error'><b>{$lang['fl_attack_error'][$cant_attack]}</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 99);
156 156
   }
157 157
 
158 158
   $speed_possible = array(10, 9, 8, 7, 6, 5, 4, 3, 2, 1);
159 159
   if (!in_array($speed_percent, $speed_possible)) {
160
-    messageBox ("<span class='error'><b>". $lang['fl_cheat_speed'] ."</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
160
+    messageBox("<span class='error'><b>" . $lang['fl_cheat_speed'] . "</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
161 161
   }
162 162
 
163 163
   $fleet['start_time'] = $duration + SN_TIME_NOW;
164 164
 
165
-  $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) :
166
-    ($target_mission == MT_HOLD ? 12 : 0);
167
-  if($max_duration) {
165
+  $max_duration = $target_mission == MT_EXPLORE ? get_player_max_expedition_duration($user) : ($target_mission == MT_HOLD ? 12 : 0);
166
+  if ($max_duration) {
168 167
     $StayDuration = sys_get_param_id('missiontime');
169
-    if($StayDuration > $max_duration || $StayDuration < 1) {
168
+    if ($StayDuration > $max_duration || $StayDuration < 1) {
170 169
       $debug->warning('Supplying wrong mission time', 'Hack attempt', 302, array('base_dump' => true));
171 170
       die();
172 171
     }
@@ -176,11 +175,11 @@  discard block
 block discarded – undo
176 175
     $StayDuration = 0;
177 176
     $StayTime     = 0;
178 177
   }
179
-  $fleet['end_time']   = $StayDuration + (2 * $duration) + SN_TIME_NOW;
178
+  $fleet['end_time'] = $StayDuration + (2 * $duration) + SN_TIME_NOW;
180 179
 
181
-  if($aks && $target_mission == MT_AKS) {
182
-    if ($fleet['start_time']>$aks['ankunft']) {
183
-      messageBox ($lang['fl_aks_too_slow'] . 'Fleet arrival: ' . date(FMT_DATE_TIME,$fleet['start_time']) . " AKS arrival: " .date(FMT_DATE_TIME,$aks['ankunft']), $lang['fl_error']);
180
+  if ($aks && $target_mission == MT_AKS) {
181
+    if ($fleet['start_time'] > $aks['ankunft']) {
182
+      messageBox($lang['fl_aks_too_slow'] . 'Fleet arrival: ' . date(FMT_DATE_TIME, $fleet['start_time']) . " AKS arrival: " . date(FMT_DATE_TIME, $aks['ankunft']), $lang['fl_error']);
184 183
     }
185 184
     $fleet['start_time'] = $aks['ankunft'];
186 185
     $fleet['end_time'] = $aks['ankunft'] + $duration;
@@ -190,21 +189,21 @@  discard block
 block discarded – undo
190 189
   $FleetShipCount      = 0;
191 190
   $db_changeset = array();
192 191
   foreach ($fleetarray as $Ship => $Count) {
193
-    $FleetStorage    += get_unit_param($Ship, P_CAPACITY) * $Count;
192
+    $FleetStorage += get_unit_param($Ship, P_CAPACITY) * $Count;
194 193
     $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($Ship, -$Count, $user, $planetrow['id']);
195 194
   }
196 195
   $fleet_array = sys_unit_arr2str($fleetarray);
197
-  $FleetShipCount  += array_sum($fleetarray);
198
-  $FleetStorage        -= $consumption;
196
+  $FleetShipCount += array_sum($fleetarray);
197
+  $FleetStorage -= $consumption;
199 198
 
200
-  if ( $StorageNeeded > $FleetStorage) {
201
-    messageBox ("<span class='error'><b>". $lang['fl_nostoragespa'] . HelperString::numberFloorAndFormat($StorageNeeded - $FleetStorage) ."</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
199
+  if ($StorageNeeded > $FleetStorage) {
200
+    messageBox("<span class='error'><b>" . $lang['fl_nostoragespa'] . HelperString::numberFloorAndFormat($StorageNeeded - $FleetStorage) . "</b></span>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
202 201
   }
203 202
   if ($planetrow['deuterium'] < $TransDeuterium + $consumption) {
204
-    messageBox ("<font color=\"red\"><b>". $lang['fl_no_deuterium'] . HelperString::numberFloorAndFormat($TransDeuterium + $consumption - $planetrow['deuterium']) ."</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
203
+    messageBox("<font color=\"red\"><b>" . $lang['fl_no_deuterium'] . HelperString::numberFloorAndFormat($TransDeuterium + $consumption - $planetrow['deuterium']) . "</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
205 204
   }
206 205
   if (($planetrow['metal'] < $TransMetal) || ($planetrow['crystal'] < $TransCrystal)) {
207
-    messageBox ("<font color=\"red\"><b>". $lang['fl_no_resources'] ."</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
206
+    messageBox("<font color=\"red\"><b>" . $lang['fl_no_resources'] . "</b></font>", $lang['fl_error'], 'fleet' . DOT_PHP_EX, 2);
208 207
   }
209 208
 
210 209
   $fleet_set = array(
@@ -246,7 +245,7 @@  discard block
 block discarded – undo
246 245
 //    ));
247 246
 //  }
248 247
 
249
-  if(is_array($captain)) {
248
+  if (is_array($captain)) {
250 249
     DBStaticUnit::db_unit_set_by_id($captain['unit_id'], "`unit_location_type` = " . LOC_FLEET . ", `unit_location_id` = {$fleet_id}");
251 250
   }
252 251
 
@@ -259,7 +258,7 @@  discard block
 block discarded – undo
259 258
     'START_LEFT'         => floor($fleet['end_time'] + 1 - SN_TIME_NOW),
260 259
   );
261 260
 
262
-  if(!empty($TargetPlanet)) {
261
+  if (!empty($TargetPlanet)) {
263 262
     $template_route += array(
264 263
       'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']],
265 264
       'END_COORDS'       => uni_render_coordinates($TargetPlanet),
@@ -272,8 +271,8 @@  discard block
 block discarded – undo
272 271
   $template->assign_block_vars('fleets', $template_route);
273 272
 
274 273
   $sn_groups_fleet = sn_get_groups('fleet');
275
-  foreach($fleetarray as $ship_id => $ship_count) {
276
-    if(in_array($ship_id, $sn_groups_fleet) && $ship_count) {
274
+  foreach ($fleetarray as $ship_id => $ship_count) {
275
+    if (in_array($ship_id, $sn_groups_fleet) && $ship_count) {
277 276
 //      $ship_base_data = get_ship_data($ship_id, $user);
278 277
       $template->assign_block_vars('fleets.ships', array(
279 278
         'ID'          => $ship_id,
Please login to merge, or discard this patch.
includes/includes/market_fleeter.inc 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 use DBAL\OldDbChangeSet;
4 4
 use Planet\DBStaticPlanet;
5 5
 
6
-if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) {
6
+if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) {
7 7
   $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403);
8 8
 }
9 9
 
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
   'rpg_cost' => $rpg_cost,
16 16
 ));
17 17
 
18
-if(is_array($shipList)) {
19
-  if(mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) {
18
+if (is_array($shipList)) {
19
+  if (mrc_get_level($user, null, RES_DARK_MATTER) < $rpg_cost) {
20 20
     $intError = MARKET_NO_DM;
21 21
   }
22 22
 
@@ -33,30 +33,30 @@  discard block
 block discarded – undo
33 33
   $qry = array();
34 34
   $total = array();
35 35
   $db_changeset = array();
36
-  foreach($shipList as $shipID => &$shipCount) {
36
+  foreach ($shipList as $shipID => &$shipCount) {
37 37
     $shipCount = ceil(floatval($shipCount));
38
-    if(!$shipCount) {
38
+    if (!$shipCount) {
39 39
       continue;
40 40
     }
41 41
 
42
-    if($shipCount < 0) {
42
+    if ($shipCount < 0) {
43 43
       $debug->warning('User supplied negative ship count on Black Market page', 'Hack Attempt', 307);
44 44
       $intError = MARKET_NEGATIVE_SHIPS;
45 45
       break;
46 46
     }
47 47
 
48
-    if($mode == MARKET_SCRAPPER) {
48
+    if ($mode == MARKET_SCRAPPER) {
49 49
       $amount = mrc_get_level($user, $planetrow, $shipID, true, true); // $planetrow[get_unit_param($shipID, P_NAME)];
50
-    } elseif($mode == MARKET_STOCKMAN) {
50
+    } elseif ($mode == MARKET_STOCKMAN) {
51 51
       $amount = $stock[$shipID];
52 52
     }
53 53
 
54
-    if($amount < $shipCount) {
54
+    if ($amount < $shipCount) {
55 55
       $intError = $error_no_stock;
56 56
       break;
57 57
     }
58 58
 
59
-    if(!in_array($shipID, sn_get_groups('fleet'))) {
59
+    if (!in_array($shipID, sn_get_groups('fleet'))) {
60 60
       $debug->warning('Hack Attempt', 'User supplied non-ship unit ID on Black Market page', 306);
61 61
       $intError = MARKET_NOT_A_SHIP;
62 62
       break;
@@ -72,16 +72,16 @@  discard block
 block discarded – undo
72 72
     $resTemp[RES_CRYSTAL] = floor($build_data[BUILD_CREATE][RES_CRYSTAL] * $shipCount * $config_rpg_scrape_crystal * (-$multiplier));
73 73
     $resTemp[RES_DEUTERIUM] = floor($build_data[BUILD_CREATE][RES_DEUTERIUM] * $shipCount * $config_rpg_scrape_deuterium * (-$multiplier));
74 74
 
75
-    foreach($resTemp as $resID => $resCount) {
75
+    foreach ($resTemp as $resID => $resCount) {
76 76
       $total[$resID] += $resCount;
77 77
     }
78 78
 
79 79
     $message .= "<li>{$lang['tech'][$shipID]}: " . HelperString::numberFloorAndFormat($shipCount);
80 80
   }
81 81
 
82
-  if($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) {
83
-    foreach($total as $resID => $resCount) {
84
-      if(mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) {
82
+  if ($mode == MARKET_STOCKMAN && $intError == MARKET_DEAL) {
83
+    foreach ($total as $resID => $resCount) {
84
+      if (mrc_get_level($user, $planetrow, $resID, true, true) < -$resCount) {
85 85
         $intError = MARKET_NO_RESOURCES;
86 86
         $debug->warning('Trying to use bug in s/h market', 'S/H Ship Market', 301);
87 87
         break;
@@ -91,10 +91,10 @@  discard block
 block discarded – undo
91 91
 
92 92
   $intError = ($intError == MARKET_DEAL) && (array_sum($total) == 0) ? $error_zero_res : $intError;
93 93
 
94
-  if($intError == MARKET_DEAL) {
94
+  if ($intError == MARKET_DEAL) {
95 95
     $message .= '</ul>' . $lang["eco_mrk_{$submode}_res"] . '<ul>';
96
-    foreach($total as $resID => $resCount) {
97
-      if(!$resCount) {
96
+    foreach ($total as $resID => $resCount) {
97
+      if (!$resCount) {
98 98
         continue;
99 99
       }
100 100
 
@@ -128,38 +128,38 @@  discard block
 block discarded – undo
128 128
       'MESSAGE' => $lang['eco_mrk_errors'][$intError],
129 129
     ));
130 130
 
131
-    foreach($shipList as $shipID => $shipCount) {
131
+    foreach ($shipList as $shipID => $shipCount) {
132 132
       $data['ships'][$shipID] = max(0, intval($shipCount));
133 133
     }
134 134
   }
135 135
 }
136 136
 $message = '';
137 137
 
138
-if(!$config->eco_stockman_fleet && $config->eco_stockman_fleet_populate) {
139
-  $config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item){return mt_rand(1, 1000);}, sn_get_groups('fleet'))));
138
+if (!$config->eco_stockman_fleet && $config->eco_stockman_fleet_populate) {
139
+  $config->db_saveItem('eco_stockman_fleet', sys_unit_arr2str(array_map(function($item) {return mt_rand(1, 1000); }, sn_get_groups('fleet'))));
140 140
 }
141 141
 
142 142
 tpl_set_resource_info($template, $planetrow, array());
143 143
 
144
-if(!$array) {
144
+if (!$array) {
145 145
   $array = array();
146 146
 }
147 147
 
148 148
 $group_fleet = sn_get_groups('fleet');
149
-foreach($array as $key => $value) {
150
-  if($mode == MARKET_SCRAPPER) {
149
+foreach ($array as $key => $value) {
150
+  if ($mode == MARKET_SCRAPPER) {
151 151
     $shipID = $value;
152 152
     $amount = mrc_get_level($user, $planetrow, $shipID, false, true); // $planetrow[get_unit_param($shipID, P_NAME)];
153
-  } elseif($mode == MARKET_STOCKMAN) {
153
+  } elseif ($mode == MARKET_STOCKMAN) {
154 154
     $shipID = $key;
155 155
     $amount = $value;
156 156
   }
157 157
 
158
-  if(!in_array($shipID, $group_fleet)) {
158
+  if (!in_array($shipID, $group_fleet)) {
159 159
     continue;
160 160
   }
161 161
 
162
-  if($amount > 0) {
162
+  if ($amount > 0) {
163 163
     $build_data = eco_get_build_data($user, $planetrow, $shipID);
164 164
     $template->assign_block_vars('ships', array(
165 165
       'ID'        => $shipID,
Please login to merge, or discard this patch.
includes/includes/flt_page4.inc 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -2,18 +2,18 @@  discard block
 block discarded – undo
2 2
 
3 3
 use Planet\DBStaticPlanet;
4 4
 
5
-if(SN_IN_FLEET !== true) {
5
+if (SN_IN_FLEET !== true) {
6 6
   $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403);
7 7
 }
8 8
 
9 9
 $fleetid = sys_get_param_id('fleetid');
10 10
 
11
-if(!is_numeric($fleetid) || empty($fleetid)) {
11
+if (!is_numeric($fleetid) || empty($fleetid)) {
12 12
   sys_redirect("fleet.php");
13 13
 }
14 14
 
15 15
 $fleet = db_fleet_get($fleetid);
16
-if(!$fleet) {
16
+if (!$fleet) {
17 17
   messageBox($lang['fl_fleet_not_exists'], $lang['fl_error']);
18 18
 }
19 19
 //$query = doquery("SELECT * FROM `{{fleets}}` WHERE fleet_id = '{$fleetid}'");
@@ -27,8 +27,8 @@  discard block
 block discarded – undo
27 27
   messageBox($lang['fl_isback'], $lang['fl_error']);
28 28
 }
29 29
 
30
-if($fleet['fleet_owner'] != $user['id']) {
31
-  $debug->warning($lang['fl_aks_hack_wrong_fleet'],'Wrong Fleet Owner',301);
30
+if ($fleet['fleet_owner'] != $user['id']) {
31
+  $debug->warning($lang['fl_aks_hack_wrong_fleet'], 'Wrong Fleet Owner', 301);
32 32
   messageBox($lang['fl_aks_hack_wrong_fleet'], $lang['fl_error']);
33 33
 }
34 34
 
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
 
39 39
 !$aks && !$userToAdd_unsafe ? $userToAdd_unsafe = $user['username'] : false;
40 40
 
41
-if($userToAdd_unsafe) {
41
+if ($userToAdd_unsafe) {
42 42
   $userToAdd = db_escape($userToAdd_unsafe);
43 43
   $userToAddID = db_user_by_username($userToAdd_unsafe, true);
44 44
   $userToAddID = $userToAddID['id'];
45 45
 
46
-  if($fleet['fleet_target_owner'] == $userToAddID) {
46
+  if ($fleet['fleet_target_owner'] == $userToAddID) {
47 47
     messageBox($lang['flt_aks_player_same'], $lang['fl_error']);
48 48
   }
49 49
 
50
-  if($userToAddID) {
51
-    if(!$aks) {
50
+  if ($userToAddID) {
51
+    if (!$aks) {
52 52
       // No AСS exists - making one
53
-      if(!$fleet['fleet_group']) {
53
+      if (!$fleet['fleet_group']) {
54 54
         doquery("INSERT INTO {{aks}} SET
55 55
           `name` = '" . db_escape($lang['flt_acs_prefix'] . $fleetid) . "',
56 56
           `teilnehmer` = '" . $user['id'] . "',
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
           `planet` = '" . $fleet['fleet_end_planet'] . "',
62 62
           `planet_type` = '" . $fleet['fleet_end_type'] . "',
63 63
           `eingeladen` = '" . $user['id'] . "',
64
-          `fleet_end_time` = '" . $fleet['fleet_end_time']. "'");
64
+          `fleet_end_time` = '" . $fleet['fleet_end_time'] . "'");
65 65
 
66 66
         $aks = doquery("SELECT * FROM {{aks}} WHERE `flotten` = {$fleetid} LIMIT 1;", true);
67 67
 
@@ -79,26 +79,26 @@  discard block
 block discarded – undo
79 79
 
80 80
     $isUserExists = false;
81 81
     $invited_ar = explode(",", $aks['eingeladen']);
82
-    foreach($invited_ar as $inv) {
82
+    foreach ($invited_ar as $inv) {
83 83
       if ($userToAddID == $inv) {
84 84
         $isUserExists = true;
85 85
       }
86 86
     }
87 87
 
88
-    if(count($invited_ar) >= 5) {
88
+    if (count($invited_ar) >= 5) {
89 89
       messageBox($lang['flt_aks_error_too_much_players'], $lang['fl_error']);
90 90
     }
91 91
 
92
-    if($isUserExists) {
92
+    if ($isUserExists) {
93 93
       $userToAdd_unsafe != $user['username'] ? $add_user_message_mr = sprintf($lang['fl_aks_player_invited_already'], $userToAdd) : false;
94 94
     } else {
95 95
       $add_user_message_mr = sprintf($lang['fl_aks_player_invited'], $userToAdd);
96 96
       doquery("UPDATE `{{aks}}` SET `eingeladen` = concat(`eingeladen`, ',{$userToAddID}') WHERE `flotten` = {$fleetid};")
97
-        or die(sprintf($lang['fl_aks_adding_error'],db_error()));
97
+        or die(sprintf($lang['fl_aks_adding_error'], db_error()));
98 98
       $aks['eingeladen'] .= ',' . $userToAddID;
99 99
     }
100
-    msg_send_simple_message ( $userToAddID, $user['id'], SN_TIME_NOW, MSG_TYPE_COMBAT, $user['username'],
101
-      $lang['fl_aks_invite_message_header'], sprintf( $lang['fl_aks_invite_message'], $user['username']));
100
+    msg_send_simple_message($userToAddID, $user['id'], SN_TIME_NOW, MSG_TYPE_COMBAT, $user['username'],
101
+      $lang['fl_aks_invite_message_header'], sprintf($lang['fl_aks_invite_message'], $user['username']));
102 102
   } else {
103 103
     $add_user_message_mr = sprintf($lang['fl_aks_player_error'], $userToAdd);
104 104
   }
@@ -112,8 +112,8 @@  discard block
 block discarded – undo
112 112
   'MISSION_NAME' => $lang['type_mission'][MT_AKS],
113 113
 ));
114 114
 
115
-if($aks['eingeladen'] && is_array($members = SN::db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
116
-  foreach($members as $row) {
115
+if ($aks['eingeladen'] && is_array($members = SN::db_get_record_list(LOC_USER, "`id` in ({$aks['eingeladen']})")) && !empty($members)) {
116
+  foreach ($members as $row) {
117 117
     $template->assign_block_vars('invited', array(
118 118
       'NAME' => $row['username'],
119 119
     ));
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 $i++;
124 124
 $fleet_row = db_fleet_get($fleetid);
125 125
 
126
-if(is_array($fleet_row) && !empty($fleet_row)) {
126
+if (is_array($fleet_row) && !empty($fleet_row)) {
127 127
 $planet_start = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_start_planet_id']);
128 128
 $fleet_row['fleet_start_name'] = !empty($planet_start['name']) ? $planet_start['name'] : '';
129 129
 $planet_end = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_end_planet_id']);
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 
132 132
 $fleet_data = tpl_parse_fleet_db($fleet_row, $i, $user);
133 133
 $template->assign_block_vars('fleets', $fleet_data['fleet']);
134
-foreach($fleet_data['ships'] as $ship_data) {
134
+foreach ($fleet_data['ships'] as $ship_data) {
135 135
   $template->assign_block_vars('fleets.ships', $ship_data);
136 136
 }
137 137
 }
Please login to merge, or discard this patch.
admin/settings.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
 
11 11
 use Unit\DBStaticUnit;
12 12
 
13
-define('INSIDE'  , true);
14
-define('INSTALL' , false);
13
+define('INSIDE', true);
14
+define('INSTALL', false);
15 15
 define('IN_ADMIN', true);
16 16
 require('../common.' . substr(strrchr(__FILE__, '.'), 1));
17 17
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 $template = gettemplate('admin/settings', true);
23 23
 
24
-if(sys_get_param('save')) {
24
+if (sys_get_param('save')) {
25 25
   SN::$config->game_name               = sys_get_param_str_unsafe('game_name');
26 26
   SN::$config->game_mode               = sys_get_param_int('game_mode');
27 27
   SN::$config->game_speed              = sys_get_param_float('game_speed', 1);
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
   SN::$config->url_faq                 = sys_get_param_str_unsafe('url_faq');
32 32
   SN::$config->url_forum               = sys_get_param_str_unsafe('url_forum');
33 33
   SN::$config->url_rules               = sys_get_param_str_unsafe('url_rules');
34
-  SN::$config->url_purchase_metamatter         = sys_get_param_str_unsafe('url_purchase_metamatter');
34
+  SN::$config->url_purchase_metamatter = sys_get_param_str_unsafe('url_purchase_metamatter');
35 35
   SN::$config->game_disable            = sys_get_param_int('game_disable');
36 36
   SN::$config->game_disable_reason     = sys_get_param_str_unsafe('game_disable_reason');
37 37
   SN::$config->server_updater_check_auto = sys_get_param_int('server_updater_check_auto');
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
   SN::$config->stats_schedule          = sys_get_param_str('stats_schedule');
102 102
 
103 103
   SN::$config->empire_mercenary_base_period = sys_get_param_int('empire_mercenary_base_period');
104
-  if(SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
105
-    if(SN::$config->empire_mercenary_temporary) {
104
+  if (SN::$config->empire_mercenary_temporary != sys_get_param_int('empire_mercenary_temporary')) {
105
+    if (SN::$config->empire_mercenary_temporary) {
106 106
       DBStaticUnit::db_unit_list_admin_delete_mercenaries_finished();
107 107
     } else {
108 108
       DBStaticUnit::db_unit_list_admin_set_mercenaries_expire_time(SN::$config->empire_mercenary_base_period);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 tpl_assign_select($template, 'ver_response', SN::$lang['adm_opt_ver_response'], 'ID', 'NAME');
153 153
 
154 154
 $lang_list = lng_get_list();
155
-foreach($lang_list as $lang_id => $lang_data) {
155
+foreach ($lang_list as $lang_id => $lang_data) {
156 156
   $template->assign_block_vars('game_languages', array(
157 157
     'ID'   => $lang_id,
158 158
     'NAME' => "{$lang_data['LANG_NAME_NATIVE']} ({$lang_data['LANG_NAME_ENGLISH']})",
Please login to merge, or discard this patch.
classes/General/Helpers/PagingRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
       $this->addFirstLast();
115 115
     }
116 116
 
117
-    if(!empty($this->result)) {
117
+    if (!empty($this->result)) {
118 118
       $template = gettemplate('_paging');
119 119
       $template->assign_recursive([
120 120
         'PAGING_ROOT' => $this->rootUrl,
Please login to merge, or discard this patch.
classes/General/Helpers/URLHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
       }
20 20
     }
21 21
 
22
-    if(!empty($paramList)) {
22
+    if (!empty($paramList)) {
23 23
       $strParams = implode('&', $paramList);
24 24
     }
25 25
 
Please login to merge, or discard this patch.
classes/Common/Pimple/Container.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
 
240 240
         $factory = $this->values[$id];
241 241
 
242
-        $extended = function ($c) use ($callable, $factory) {
242
+        $extended = function($c) use ($callable, $factory) {
243 243
             return $callable($factory($c), $c);
244 244
         };
245 245
 
Please login to merge, or discard this patch.
includes/init.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 use Player\playerTimeDiff;
5 5
 
6 6
 // Защита от двойного инита
7
-if(defined('INIT')) {
7
+if (defined('INIT')) {
8 8
   return;
9 9
 }
10 10
 
@@ -122,47 +122,47 @@  discard block
 block discarded – undo
122 122
 // Но нужно, пока у нас есть не MVC-страницы
123 123
 $sn_page_data = $sn_mvc['pages'][$sn_page_name];
124 124
 $sn_page_name_file = 'includes/pages/' . $sn_page_data['filename'] . DOT_PHP_EX;
125
-if($sn_page_name) {
125
+if ($sn_page_name) {
126 126
   // Merging page options to global option pull
127
-  if(is_array($sn_page_data['options'])) {
127
+  if (is_array($sn_page_data['options'])) {
128 128
     SN::$options = array_merge(SN::$options, $sn_page_data['options']);
129 129
   }
130 130
 
131
-  if(isset($sn_page_data) && file_exists($sn_page_name_file)) {
131
+  if (isset($sn_page_data) && file_exists($sn_page_name_file)) {
132 132
     require_once($sn_page_name_file);
133 133
   }
134 134
 }
135 135
 
136
-if((defined('IN_AJAX') && IN_AJAX === true) || (defined('IN_ADMIN') && IN_ADMIN === true) || (!empty(SN::$options[PAGE_OPTION_ADMIN]))) {
136
+if ((defined('IN_AJAX') && IN_AJAX === true) || (defined('IN_ADMIN') && IN_ADMIN === true) || (!empty(SN::$options[PAGE_OPTION_ADMIN]))) {
137 137
   SN::$options[PAGE_OPTION_FLEET_UPDATE_SKIP] = true;
138 138
 }
139 139
 
140 140
 
141 141
 // А теперь проверяем - поддерживают ли у нас загруженный код такую страницу
142 142
 // TODO - костыль, что бы работали старые модули. Убрать!
143
-if(is_array($sn_data['pages'])) {
143
+if (is_array($sn_data['pages'])) {
144 144
   $sn_mvc['pages'] = array_merge($sn_mvc['pages'], $sn_data['pages']);
145 145
 }
146
-if(!isset($sn_mvc['pages'][$sn_page_name])) {
146
+if (!isset($sn_mvc['pages'][$sn_page_name])) {
147 147
   $sn_page_name = '';
148 148
 }
149 149
 
150 150
 $lang->lng_switch(sys_get_param_str('lang'));
151 151
 
152 152
 
153
-if(SN::$config->server_updater_check_auto && SN::$config->server_updater_check_last + SN::$config->server_updater_check_period <= SN_TIME_NOW) {
153
+if (SN::$config->server_updater_check_auto && SN::$config->server_updater_check_last + SN::$config->server_updater_check_period <= SN_TIME_NOW) {
154 154
   \Common\Tools\VersionCheckerDeprecated::performCheckVersion();
155 155
 }
156 156
 
157
-if(SN::$config->user_birthday_gift && SN_TIME_NOW - SN::$config->user_birthday_celebrate > PERIOD_DAY) {
157
+if (SN::$config->user_birthday_gift && SN_TIME_NOW - SN::$config->user_birthday_celebrate > PERIOD_DAY) {
158 158
   require_once(SN_ROOT_PHYSICAL . 'includes/includes/user_birthday_celebrate.php');
159 159
   sn_user_birthday_celebrate();
160 160
 }
161 161
 
162
-if(!SN::$config->var_online_user_count || SN::$config->var_online_user_time + 30 < SN_TIME_NOW) {
162
+if (!SN::$config->var_online_user_count || SN::$config->var_online_user_time + 30 < SN_TIME_NOW) {
163 163
   SN::$config->db_saveItem('var_online_user_count', db_user_count(true));
164 164
   SN::$config->db_saveItem('var_online_user_time', SN_TIME_NOW);
165
-  if(SN::$config->server_log_online) {
165
+  if (SN::$config->server_log_online) {
166 166
     doquery("INSERT IGNORE INTO `{{log_users_online}}` SET online_count = " . SN::$config->var_online_user_count . ";");
167 167
   }
168 168
 }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
 $template_result[F_ACCOUNT_IS_AUTHORIZED] = $sys_user_logged_in = !empty($user) && isset($user['id']) && $user['id'];
187 187
 
188
-if(!empty($user['id'])) {
188
+if (!empty($user['id'])) {
189 189
   SN::$user_options->user_change($user['id']);
190 190
 }
191 191
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         : false
199 199
       );
200 200
 
201
-if($template_result[F_LOGIN_STATUS] == LOGIN_ERROR_USERNAME_RESTRICTED_CHARACTERS) {
201
+if ($template_result[F_LOGIN_STATUS] == LOGIN_ERROR_USERNAME_RESTRICTED_CHARACTERS) {
202 202
   $prohibited_characters = array_map(function($value) {
203 203
     return "'" . htmlentities($value, ENT_QUOTES, 'UTF-8') . "'";
204 204
   }, str_split(LOGIN_REGISTER_CHARACTERS_PROHIBITED));
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 }
207 207
 
208 208
 
209
-if(defined('DEBUG_AUTH') && DEBUG_AUTH && !defined('IN_AJAX')) {
209
+if (defined('DEBUG_AUTH') && DEBUG_AUTH && !defined('IN_AJAX')) {
210 210
   pdump('Отключи отладку перед продакшном!');
211 211
 }
212 212
 
@@ -220,17 +220,17 @@  discard block
 block discarded – undo
220 220
 
221 221
 StatUpdateLauncher::unlock();
222 222
 
223
-if($template_result[F_GAME_DISABLE] = SN::$config->game_disable) {
223
+if ($template_result[F_GAME_DISABLE] = SN::$config->game_disable) {
224 224
   $template_result[F_GAME_DISABLE_REASON] = HelperString::nl2br(
225 225
     SN::$config->game_disable == GAME_DISABLE_REASON
226 226
       ? SN::$config->game_disable_reason
227 227
       : $lang['sys_game_disable_reason'][SN::$config->game_disable]
228 228
   );
229
-  if(defined('IN_API')) {
229
+  if (defined('IN_API')) {
230 230
     return;
231 231
   }
232 232
 
233
-  if(
233
+  if (
234 234
     ($user['authlevel'] < 1 || !(defined('IN_ADMIN') && IN_ADMIN))
235 235
     &&
236 236
     !(defined('INSTALL_MODE') && defined('LOGIN_LOGOUT'))
@@ -245,8 +245,8 @@  discard block
 block discarded – undo
245 245
 
246 246
 // TODO ban
247 247
 // TODO $skip_ban_check
248
-if($template_result[F_BANNED_STATUS] && !$skip_ban_check) {
249
-  if(defined('IN_API')) {
248
+if ($template_result[F_BANNED_STATUS] && !$skip_ban_check) {
249
+  if (defined('IN_API')) {
250 250
     return;
251 251
   }
252 252
 
@@ -260,10 +260,10 @@  discard block
 block discarded – undo
260 260
 $allow_anonymous = $allow_anonymous || (isset($sn_page_data['allow_anonymous']) && $sn_page_data['allow_anonymous']);
261 261
 
262 262
 
263
-if($sys_user_logged_in && INITIAL_PAGE == 'login') {
263
+if ($sys_user_logged_in && INITIAL_PAGE == 'login') {
264 264
   sys_redirect(SN_ROOT_VIRTUAL . 'overview.php');
265
-} elseif($account_logged_in && !$sys_user_logged_in) { // empty(core_auth::$user['id'])
266
-} elseif(!$allow_anonymous && !$sys_user_logged_in) {
265
+} elseif ($account_logged_in && !$sys_user_logged_in) { // empty(core_auth::$user['id'])
266
+} elseif (!$allow_anonymous && !$sys_user_logged_in) {
267 267
   sys_redirect(SN_ROOT_VIRTUAL . 'login.php');
268 268
 }
269 269
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
   'fleet_update_last',
287 287
   SN::$config->fleet_update_interval,
288 288
   // Promise
289
-  function () {SN::$gc->fleetDispatcher->dispatch();},
289
+  function() {SN::$gc->fleetDispatcher->dispatch(); },
290 290
   WATCHDOG_TIME_SQL,
291 291
   false
292 292
 );
Please login to merge, or discard this patch.
classes/template_compile.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 
142 142
     preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
143 143
     $include_blocks = $matches[1];
144
-    if($include_blocks)
144
+    if ($include_blocks)
145 145
     {
146
-      foreach($include_blocks as &$included_file)
146
+      foreach ($include_blocks as &$included_file)
147 147
       {
148 148
         $included_file .= '.tpl.html';
149 149
       }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
       $varname = $var_val[3];
309 309
       $new = $this->generate_block_varref($namespace, $varname, $var_val[2]);
310 310
 
311
-      if(!empty($var_val[4])) {
311
+      if (!empty($var_val[4])) {
312 312
         $new = \Ptl\PtlVariableDecorator::decorate($var_val[0], $new, $this->template);
313 313
       }
314 314
 
@@ -462,8 +462,8 @@  discard block
 block discarded – undo
462 462
 
463 463
     $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){';
464 464
 //    $tag_template_php .= '$this->_block_counter["'. $tag_args . '"] = $_' . $tag_args . '_i;';
465
-    $tag_template_php .= '$_'. $tag_args . '_val = &' . $varref . '[$_'. $tag_args. '_i];';
466
-    $tag_template_php .= '$this->_block_value["'. $tag_args . '"] = &' . $varref . '[$_'. $tag_args. '_i];';
465
+    $tag_template_php .= '$_' . $tag_args . '_val = &' . $varref . '[$_' . $tag_args . '_i];';
466
+    $tag_template_php .= '$this->_block_value["' . $tag_args . '"] = &' . $varref . '[$_' . $tag_args . '_i];';
467 467
 
468 468
     return $tag_template_php;
469 469
   }
@@ -567,10 +567,10 @@  discard block
 block discarded – undo
567 567
         break;
568 568
 
569 569
         case 'is':
570
-          $is_arg_start = ($tokens[$i-1] == ')') ? array_pop($is_arg_stack) : $i-1;
570
+          $is_arg_start = ($tokens[$i - 1] == ')') ? array_pop($is_arg_stack) : $i - 1;
571 571
           $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start));
572 572
 
573
-          $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1));
573
+          $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i + 1));
574 574
 
575 575
           array_splice($tokens, $is_arg_start, sizeof($tokens), $new_tokens);
576 576
 
@@ -834,11 +834,11 @@  discard block
 block discarded – undo
834 834
     }
835 835
     else if ($include_last_iterator)
836 836
     {
837
-      return '$_'. $blocks[$blockcount] . '_val';
837
+      return '$_' . $blocks[$blockcount] . '_val';
838 838
     }
839 839
     else
840 840
     {
841
-      return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']';
841
+      return '$_' . $blocks[$blockcount - 1] . '_val[\'' . $blocks[$blockcount] . '\']';
842 842
     }
843 843
   }
844 844
 
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
     if ($fp = @fopen($filename, 'wb'))
856 856
     {
857 857
       @flock($fp, LOCK_EX);
858
-      @fwrite ($fp, $data);
858
+      @fwrite($fp, $data);
859 859
       @flock($fp, LOCK_UN);
860 860
       @fclose($fp);
861 861
 
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
   */
874 874
   function minify($html)
875 875
   {
876
-    if(!SN::$config->tpl_minifier)
876
+    if (!SN::$config->tpl_minifier)
877 877
     {
878 878
       return $html;
879 879
     }
@@ -885,14 +885,14 @@  discard block
 block discarded – undo
885 885
     //$html = preg_replace('/[\r\n\t]+/', ' ', $html);
886 886
     $html = preg_replace('/>[\s]*</', '><', $html); // Strip spacechars between tags
887 887
     $html = preg_replace('/[\s]+/', ' ', $html); // Replace several spacechars with one space
888
-    if(!empty($pre[0]))
888
+    if (!empty($pre[0]))
889 889
     {
890
-      foreach($pre[0] as $tag)
890
+      foreach ($pre[0] as $tag)
891 891
       {
892 892
         $tag = preg_replace('/^\ *\/\/[^\<]*?$/m', ' ', $tag); // Strips comments - except those that contains HTML comment inside
893 893
         $tag = preg_replace('/[\ \t]{2,}/', ' ', $tag); // Replace several spaces by one
894 894
         $tag = preg_replace('/\s{2,}/', "\r\n", $tag); // Replace several linefeeds by one
895
-        $html = preg_replace('/#pre#/', $tag, $html,1);
895
+        $html = preg_replace('/#pre#/', $tag, $html, 1);
896 896
       }
897 897
     }
898 898
 
Please login to merge, or discard this patch.