@@ -34,7 +34,8 @@ discard block |
||
34 | 34 | (peut être génant sur un nom de variable dans le cas par exemple de $_POST['coucou'] ou $_POST['cou_cou'] pour l'exemple au-dessus) |
35 | 35 | */ |
36 | 36 | |
37 | - if(is_array($string)) //Au cas où la valeur à vérifier soit un array (peut arriver avec les POST) |
|
37 | + if(is_array($string)) { |
|
38 | + //Au cas où la valeur à vérifier soit un array (peut arriver avec les POST) |
|
38 | 39 | { |
39 | 40 | foreach($string as $key => $val) |
40 | 41 | { |
@@ -42,6 +43,7 @@ discard block |
||
42 | 43 | //la clé non sécurisé existerais toujours et la sécurisation |
43 | 44 | //ne servirais à rien. |
44 | 45 | unset($string[$key]); |
46 | + } |
|
45 | 47 | |
46 | 48 | $key = secure($key, true, $null_cslashe); |
47 | 49 | $val = secure($val, $html, $null_cslashe); |
@@ -192,11 +194,12 @@ discard block |
||
192 | 194 | global $request, $path; |
193 | 195 | |
194 | 196 | //Envoi du status http |
195 | - if(function_exists('http_response_code')) //php >= 5.4 |
|
197 | + if(function_exists('http_response_code')) { |
|
198 | + //php >= 5.4 |
|
196 | 199 | { |
197 | 200 | http_response_code($num); |
198 | 201 | } |
199 | - else //php < 5.4 |
|
202 | + } else //php < 5.4 |
|
200 | 203 | { |
201 | 204 | header(':', true, $num); |
202 | 205 | } |
@@ -204,12 +207,10 @@ discard block |
||
204 | 207 | if(file_exists(path_controllers.'erreurs/'.$num.'.php')) |
205 | 208 | { |
206 | 209 | require_once(path_controllers.'erreurs/'.$num.'.php'); |
207 | - } |
|
208 | - elseif (file_exists(path_controllers.'erreurs.php')) |
|
210 | + } elseif (file_exists(path_controllers.'erreurs.php')) |
|
209 | 211 | { |
210 | 212 | require_once(path_controllers.'erreurs.php'); |
211 | - } |
|
212 | - else |
|
213 | + } else |
|
213 | 214 | { |
214 | 215 | echo 'Erreur '.$num; |
215 | 216 | } |
@@ -243,8 +244,7 @@ discard block |
||
243 | 244 | try |
244 | 245 | { |
245 | 246 | file_put_contents($file, rtrim($txt)."\n", FILE_APPEND); |
246 | - } |
|
247 | - catch(\Exception $e) |
|
247 | + } catch(\Exception $e) |
|
248 | 248 | { |
249 | 249 | echo '<br/>Impossible d\'écrire dans le fichier : '.$file.'<br/>'; |
250 | 250 | } |
@@ -331,11 +331,13 @@ discard block |
||
331 | 331 | return false; |
332 | 332 | } |
333 | 333 | |
334 | - if(PHP_VERSION_ID >= 50400) //PHP >= 5.4.0 |
|
334 | + if(PHP_VERSION_ID >= 50400) { |
|
335 | + //PHP >= 5.4.0 |
|
335 | 336 | { |
336 | 337 | if(session_status() === PHP_SESSION_ACTIVE) |
337 | 338 | { |
338 | 339 | return true; |
340 | + } |
|
339 | 341 | } |
340 | 342 | |
341 | 343 | return false; |
@@ -159,13 +159,11 @@ |
||
159 | 159 | if(file_exists($path.'/module.json')) |
160 | 160 | { |
161 | 161 | $Modules->newFromJson($path); |
162 | - } |
|
163 | - elseif(file_exists($path.'/'.$moduleName.'.php')) |
|
162 | + } elseif(file_exists($path.'/'.$moduleName.'.php')) |
|
164 | 163 | { |
165 | 164 | require_once($path.'/'.$moduleName.'.php'); |
166 | 165 | $Modules->addPath($moduleName, $path); |
167 | - } |
|
168 | - else {continue;} |
|
166 | + } else {continue;} |
|
169 | 167 | |
170 | 168 | $moduleInfos = $Modules->getModuleInfos($moduleName); |
171 | 169 | if(!file_exists($path.'/'.$moduleInfos['runFile'])) |