@@ -2896,10 +2896,11 @@ |
||
2896 | 2896 | c_id = $courseId AND |
2897 | 2897 | user_id = $user_id "; |
2898 | 2898 | $result = Database::query($sql); |
2899 | - if (Database::affected_rows($result) > 0) |
|
2900 | - return true; |
|
2901 | - else |
|
2902 | - return false; |
|
2899 | + if (Database::affected_rows($result) > 0) { |
|
2900 | + return true; |
|
2901 | + } else { |
|
2902 | + return false; |
|
2903 | + } |
|
2903 | 2904 | } else { |
2904 | 2905 | // The user is not subscribed to the session, so make sure |
2905 | 2906 | // he isn't subscribed to a course in this session either |
@@ -108,7 +108,9 @@ discard block |
||
108 | 108 | //Check if the user is registered in the session otherwise we will add it |
109 | 109 | $result = SessionManager::get_users_by_session($new_session_id); |
110 | 110 | if (empty($result) || !in_array($user_id, array_keys($result))) { |
111 | - if ($debug) echo 'User added to the session'; |
|
111 | + if ($debug) { |
|
112 | + echo 'User added to the session'; |
|
113 | + } |
|
112 | 114 | //Registering user to the new session |
113 | 115 | SessionManager::subscribe_users_to_session($new_session_id,array($user_id),false); |
114 | 116 | } |
@@ -143,10 +145,11 @@ discard block |
||
143 | 145 | $list[$row['exe_id']]= $row; |
144 | 146 | } |
145 | 147 | |
146 | - if (!empty($list)) |
|
147 | - foreach ($list as $exe_id =>$data) { |
|
148 | + if (!empty($list)) { |
|
149 | + foreach ($list as $exe_id =>$data) { |
|
148 | 150 | if ($update_database) { |
149 | 151 | $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id"; |
152 | + } |
|
150 | 153 | $res = Database::query($sql); |
151 | 154 | $result_message[$TABLETRACK_EXERCICES]++; |
152 | 155 | } else { |
@@ -170,10 +173,11 @@ discard block |
||
170 | 173 | $list[$row['exe_id']]= $row; |
171 | 174 | } |
172 | 175 | |
173 | - if (!empty($list)) |
|
174 | - foreach ($list as $exe_id =>$data) { |
|
176 | + if (!empty($list)) { |
|
177 | + foreach ($list as $exe_id =>$data) { |
|
175 | 178 | if ($update_database) { |
176 | 179 | $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id"; |
180 | + } |
|
177 | 181 | $res = Database::query($sql); |
178 | 182 | $result_message[$TABLETRACK_EXERCICES]++; |
179 | 183 | } else { |
@@ -198,10 +202,11 @@ discard block |
||
198 | 202 | $list[$row['course_access_id']] = $row; |
199 | 203 | } |
200 | 204 | |
201 | - if (!empty($list)) |
|
202 | - foreach ($list as $id => $data) { |
|
205 | + if (!empty($list)) { |
|
206 | + foreach ($list as $id => $data) { |
|
203 | 207 | if ($update_database) { |
204 | 208 | $sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = $new_session_id WHERE course_access_id = $id"; |
209 | + } |
|
205 | 210 | if ($debug) { |
206 | 211 | echo $sql; |
207 | 212 | } |
@@ -220,13 +225,18 @@ discard block |
||
220 | 225 | while($row = Database::fetch_array($res,'ASSOC')) { |
221 | 226 | $list[] = $row['access_id']; |
222 | 227 | } |
223 | - if (!empty($list)) |
|
224 | - foreach ($list as $id) { |
|
228 | + if (!empty($list)) { |
|
229 | + foreach ($list as $id) { |
|
225 | 230 | if ($update_database) { |
226 | 231 | $sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = $new_session_id WHERE access_id = $id"; |
227 | - if ($debug) echo $sql; |
|
232 | + } |
|
233 | + if ($debug) { |
|
234 | + echo $sql; |
|
235 | + } |
|
228 | 236 | $res = Database::query($sql); |
229 | - if ($debug) var_dump($res); |
|
237 | + if ($debug) { |
|
238 | + var_dump($res); |
|
239 | + } |
|
230 | 240 | $result_message[$TBL_TRACK_E_LAST_ACCESS]++; |
231 | 241 | } |
232 | 242 | } |
@@ -250,13 +260,18 @@ discard block |
||
250 | 260 | } |
251 | 261 | } |
252 | 262 | |
253 | - if (!empty($list)) |
|
254 | - foreach ($list as $id=>$data) { |
|
263 | + if (!empty($list)) { |
|
264 | + foreach ($list as $id=>$data) { |
|
255 | 265 | if ($update_database) { |
256 | 266 | $sql = "UPDATE $TBL_LP_VIEW SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
257 | - if ($debug) var_dump($sql); |
|
267 | + } |
|
268 | + if ($debug) { |
|
269 | + var_dump($sql); |
|
270 | + } |
|
258 | 271 | $res = Database::query($sql); |
259 | - if ($debug) var_dump($res); |
|
272 | + if ($debug) { |
|
273 | + var_dump($res); |
|
274 | + } |
|
260 | 275 | $result_message[$TBL_LP_VIEW]++; |
261 | 276 | } else { |
262 | 277 | //Getting all information of that lp_item_id |
@@ -283,10 +298,11 @@ discard block |
||
283 | 298 | $list[$row['id']] = $row; |
284 | 299 | } |
285 | 300 | } |
286 | - if (!empty($list)) |
|
287 | - foreach ($list as $id=>$data) { |
|
301 | + if (!empty($list)) { |
|
302 | + foreach ($list as $id=>$data) { |
|
288 | 303 | //Getting all information of that lp_item_id |
289 | 304 | $score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
305 | + } |
|
290 | 306 | $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
291 | 307 | $result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress); |
292 | 308 | } |
@@ -302,9 +318,13 @@ discard block |
||
302 | 318 | $id = $row['ref']; |
303 | 319 | if ($update_database) { |
304 | 320 | $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
305 | - if ($debug) var_dump($sql); |
|
321 | + if ($debug) { |
|
322 | + var_dump($sql); |
|
323 | + } |
|
306 | 324 | $res_update = Database::query($sql); |
307 | - if ($debug) var_dump($res_update); |
|
325 | + if ($debug) { |
|
326 | + var_dump($res_update); |
|
327 | + } |
|
308 | 328 | $result_message['agenda']++; |
309 | 329 | } |
310 | 330 | } |
@@ -316,22 +336,30 @@ discard block |
||
316 | 336 | //echo '<h1>Student publication</h1>'; |
317 | 337 | |
318 | 338 | $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'work' AND insert_user_id = $user_id AND c_id = $course_id"; |
319 | - if ($debug) echo $sql; |
|
339 | + if ($debug) { |
|
340 | + echo $sql; |
|
341 | + } |
|
320 | 342 | $res = Database::query($sql); |
321 | 343 | while($row = Database::fetch_array($res,'ASSOC')) { |
322 | 344 | $id = $row['ref']; |
323 | 345 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $id AND session_id = $origin_session_id AND c_id = $course_id"; |
324 | - if ($debug) var_dump($sql); |
|
346 | + if ($debug) { |
|
347 | + var_dump($sql); |
|
348 | + } |
|
325 | 349 | $sub_res = Database::query($sql); |
326 | 350 | if (Database::num_rows($sub_res) > 0 ) { |
327 | 351 | $data = Database::fetch_array($sub_res,'ASSOC'); |
328 | - if ($debug) var_dump($data); |
|
352 | + if ($debug) { |
|
353 | + var_dump($data); |
|
354 | + } |
|
329 | 355 | $parent_id = $data['parent_id']; |
330 | 356 | if (isset($data['parent_id']) && !empty($data['parent_id'])) { |
331 | 357 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $parent_id AND c_id = $course_id"; |
332 | 358 | $select_res = Database::query($sql); |
333 | 359 | $parent_data = Database::fetch_array($select_res,'ASSOC'); |
334 | - if ($debug) var_dump($parent_data); |
|
360 | + if ($debug) { |
|
361 | + var_dump($parent_data); |
|
362 | + } |
|
335 | 363 | |
336 | 364 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
337 | 365 | $course_dir = $sys_course_path . $course_info['path']; |
@@ -346,7 +374,9 @@ discard block |
||
346 | 374 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION |
347 | 375 | WHERE description like '%$search_this%' AND url LIKE '%$search_this2%' AND session_id = $new_session_id AND c_id = $course_id |
348 | 376 | ORDER BY id desc LIMIT 1"; |
349 | - if ($debug) echo $sql; |
|
377 | + if ($debug) { |
|
378 | + echo $sql; |
|
379 | + } |
|
350 | 380 | $sub_res = Database::query($sql); |
351 | 381 | $num_rows = Database::num_rows($sub_res); |
352 | 382 | |
@@ -390,7 +420,9 @@ discard block |
||
390 | 420 | |
391 | 421 | //Creating student_publication_assignment if exists |
392 | 422 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION_ASSIGNMENT WHERE publication_id = $parent_id AND c_id = $course_id"; |
393 | - if ($debug) var_dump($sql); |
|
423 | + if ($debug) { |
|
424 | + var_dump($sql); |
|
425 | + } |
|
394 | 426 | $rest_select = Database::query($sql); |
395 | 427 | if (Database::num_rows($rest_select) > 0 ) { |
396 | 428 | if ($update_database) { |
@@ -402,7 +434,9 @@ discard block |
||
402 | 434 | add_to_calendar = '".$assignment_data['add_to_calendar']."', |
403 | 435 | enable_qualification = '".$assignment_data['enable_qualification']."', |
404 | 436 | publication_id = '".$new_parent_id."'"; |
405 | - if ($debug) echo $sql_add_publication; |
|
437 | + if ($debug) { |
|
438 | + echo $sql_add_publication; |
|
439 | + } |
|
406 | 440 | $rest_select = Database::query($sql_add_publication); |
407 | 441 | $id = Database::insert_id(); |
408 | 442 | |
@@ -410,11 +444,15 @@ discard block |
||
410 | 444 | "has_properties = '".$id."', |
411 | 445 | view_properties = '1' |
412 | 446 | WHERE id = ".$new_parent_id; |
413 | - if ($debug) echo $sql_update; |
|
447 | + if ($debug) { |
|
448 | + echo $sql_update; |
|
449 | + } |
|
414 | 450 | $rest_update = Database::query($sql_update); |
415 | 451 | |
416 | 452 | |
417 | - if ($debug) var_dump($sql_update); |
|
453 | + if ($debug) { |
|
454 | + var_dump($sql_update); |
|
455 | + } |
|
418 | 456 | $result_message[$TBL_STUDENT_PUBLICATION_ASSIGNMENT]++; |
419 | 457 | } |
420 | 458 | } |
@@ -455,7 +493,9 @@ discard block |
||
455 | 493 | if ($result) { |
456 | 494 | unlink($full_file_name); |
457 | 495 | $sql = "DELETE FROM $TBL_STUDENT_PUBLICATION WHERE id= ".$data['id']; |
458 | - if ($debug) var_dump($sql); |
|
496 | + if ($debug) { |
|
497 | + var_dump($sql); |
|
498 | + } |
|
459 | 499 | $result_delete = Database::query($sql); |
460 | 500 | api_item_property_update($course_info, 'work', $data['id'], 'DocumentDeleted', api_get_user_id()); |
461 | 501 | } |
@@ -471,22 +511,30 @@ discard block |
||
471 | 511 | //10. Dropbox - not neccesary to move categories (no presence of session_id) |
472 | 512 | |
473 | 513 | $sql = "SELECT id FROM $TBL_DROPBOX_FILE WHERE uploader_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id"; |
474 | - if ($debug) var_dump($sql); |
|
514 | + if ($debug) { |
|
515 | + var_dump($sql); |
|
516 | + } |
|
475 | 517 | $res = Database::query($sql); |
476 | 518 | while($row = Database::fetch_array($res,'ASSOC')) { |
477 | 519 | $id = $row['id']; |
478 | 520 | if ($update_database) { |
479 | 521 | $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id"; |
480 | - if ($debug) var_dump($sql); |
|
522 | + if ($debug) { |
|
523 | + var_dump($sql); |
|
524 | + } |
|
481 | 525 | $res = Database::query($sql); |
482 | - if ($debug) var_dump($res); |
|
526 | + if ($debug) { |
|
527 | + var_dump($res); |
|
528 | + } |
|
483 | 529 | |
484 | 530 | $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id"; |
485 | - if ($debug) |
|
486 | - var_dump($sql); |
|
531 | + if ($debug) { |
|
532 | + var_dump($sql); |
|
533 | + } |
|
487 | 534 | $res = Database::query($sql); |
488 | - if ($debug) |
|
489 | - var_dump($res); |
|
535 | + if ($debug) { |
|
536 | + var_dump($res); |
|
537 | + } |
|
490 | 538 | $result_message[$TBL_DROPBOX_FILE]++; |
491 | 539 | } |
492 | 540 | } |
@@ -495,23 +543,30 @@ discard block |
||
495 | 543 | |
496 | 544 | $sql = "SELECT notebook_id FROM $TBL_NOTEBOOK |
497 | 545 | WHERE user_id = $user_id AND session_id = $origin_session_id AND course = '$origin_course_code' AND c_id = $course_id"; |
498 | - if ($debug) var_dump($sql); |
|
546 | + if ($debug) { |
|
547 | + var_dump($sql); |
|
548 | + } |
|
499 | 549 | $res = Database::query($sql); |
500 | 550 | while($row = Database::fetch_array($res,'ASSOC')) { |
501 | 551 | $id = $row['notebook_id']; |
502 | 552 | if ($update_database) { |
503 | 553 | $sql = "UPDATE $TBL_NOTEBOOK SET session_id = $new_session_id WHERE c_id = $course_id AND notebook_id = $id"; |
504 | - if ($debug) var_dump($sql); |
|
554 | + if ($debug) { |
|
555 | + var_dump($sql); |
|
556 | + } |
|
505 | 557 | $res = Database::query($sql); |
506 | - if ($debug) var_dump($res); |
|
558 | + if ($debug) { |
|
559 | + var_dump($res); |
|
560 | + } |
|
507 | 561 | } |
508 | 562 | } |
509 | 563 | |
510 | 564 | if ($update_database) { |
511 | 565 | echo '<h2>'.get_lang('StatsMoved').'</h2>'; |
512 | - if (is_array($result_message)) |
|
513 | - foreach ($result_message as $table=>$times) { |
|
566 | + if (is_array($result_message)) { |
|
567 | + foreach ($result_message as $table=>$times) { |
|
514 | 568 | echo 'Table '.$table.' - '.$times.' records updated <br />'; |
569 | + } |
|
515 | 570 | } |
516 | 571 | } else { |
517 | 572 | echo '<h2>'.get_lang('UserInformationOfThisCourse').'</h2>'; |
@@ -626,10 +681,11 @@ discard block |
||
626 | 681 | } |
627 | 682 | $navigation .= ' '; |
628 | 683 | $page ++; |
629 | -if ($page < $nro_pages) |
|
684 | +if ($page < $nro_pages) { |
|
630 | 685 | $navigation .= '<a href="'.api_get_self().'?page='.$page.'">'.get_lang('Next').'</a>'; |
631 | -else |
|
686 | +} else { |
|
632 | 687 | $navigation .= get_lang('Next'); |
688 | +} |
|
633 | 689 | |
634 | 690 | echo $navigation; |
635 | 691 | $user_list = UserManager::get_user_list(array(), array(), $begin, $default); |
@@ -3416,7 +3416,7 @@ discard block |
||
3416 | 3416 | $html .= '<a class="thumbnail" href="'.$params['link'].'">'; |
3417 | 3417 | $html .= $params['icon']; |
3418 | 3418 | $html .= '</a>'; |
3419 | - }else{ |
|
3419 | + } else{ |
|
3420 | 3420 | $html .= $params['icon']; |
3421 | 3421 | } |
3422 | 3422 | $html .= '</div>'; |
@@ -3675,7 +3675,7 @@ discard block |
||
3675 | 3675 | if ($showCustomIcon === 'true' && $iconName != 'course.png') { |
3676 | 3676 | $thumbnails = $course_info['course_image']; |
3677 | 3677 | $image = $course_info['course_image_large']; |
3678 | - }else{ |
|
3678 | + } else{ |
|
3679 | 3679 | $image = Display::return_icon('session_default.png', null, null, null,null, true); |
3680 | 3680 | } |
3681 | 3681 | |
@@ -3803,7 +3803,7 @@ discard block |
||
3803 | 3803 | if ($showCustomIcon === 'true' && $iconName != 'course.png') { |
3804 | 3804 | $thumbnails = $course_info['course_image']; |
3805 | 3805 | $image = $course_info['course_image_large']; |
3806 | - }else{ |
|
3806 | + } else{ |
|
3807 | 3807 | $image = Display::return_icon('session_default.png', null, null, null,null, true); |
3808 | 3808 | } |
3809 | 3809 |
@@ -662,8 +662,9 @@ discard block |
||
662 | 662 | */ |
663 | 663 | public static function update_message($user_id, $message_id) |
664 | 664 | { |
665 | - if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) |
|
666 | - return false; |
|
665 | + if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) { |
|
666 | + return false; |
|
667 | + } |
|
667 | 668 | |
668 | 669 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
669 | 670 | $sql = "UPDATE $table_message SET msg_status = '0' |
@@ -703,8 +704,9 @@ discard block |
||
703 | 704 | */ |
704 | 705 | public static function get_message_by_user($user_id, $message_id) |
705 | 706 | { |
706 | - if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) |
|
707 | - return false; |
|
707 | + if ($message_id != strval(intval($message_id)) || $user_id != strval(intval($user_id))) { |
|
708 | + return false; |
|
709 | + } |
|
708 | 710 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
709 | 711 | $query = "SELECT * FROM $table_message |
710 | 712 | WHERE user_receiver_id=" . intval($user_id) . " AND id='" . intval($message_id) . "'"; |
@@ -829,8 +831,9 @@ discard block |
||
829 | 831 | */ |
830 | 832 | public static function exist_message($user_id, $id) |
831 | 833 | { |
832 | - if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) |
|
833 | - return false; |
|
834 | + if ($id != strval(intval($id)) || $user_id != strval(intval($user_id))) { |
|
835 | + return false; |
|
836 | + } |
|
834 | 837 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
835 | 838 | $query = "SELECT id FROM $table_message |
836 | 839 | WHERE |
@@ -861,8 +864,9 @@ discard block |
||
861 | 864 | $direction = 'DESC'; |
862 | 865 | } else { |
863 | 866 | $column = intval($column); |
864 | - if (!in_array($direction, array('ASC', 'DESC'))) |
|
865 | - $direction = 'ASC'; |
|
867 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
868 | + $direction = 'ASC'; |
|
869 | + } |
|
866 | 870 | } |
867 | 871 | $table_message = Database::get_main_table(TABLE_MESSAGE); |
868 | 872 | $request = api_is_xml_http_request(); |
@@ -57,16 +57,13 @@ |
||
57 | 57 | public function __construct($args = null) { |
58 | 58 | if (is_string($args)) { |
59 | 59 | $this->proxy = $args; |
60 | - } |
|
61 | - elseif (is_array($args)) { |
|
60 | + } elseif (is_array($args)) { |
|
62 | 61 | if (count($args) == 1) { |
63 | 62 | list($this->proxy) = $args; |
64 | - } |
|
65 | - elseif (count($args) == 3) { |
|
63 | + } elseif (count($args) == 3) { |
|
66 | 64 | list($this->proxy, $this->user, $this->pass) = $args; |
67 | 65 | $this->use_authentication = true; |
68 | - } |
|
69 | - else { |
|
66 | + } else { |
|
70 | 67 | throw new Requests_Exception('Invalid number of arguments', 'proxyhttpbadargs'); |
71 | 68 | } |
72 | 69 | } |
@@ -291,11 +291,9 @@ |
||
291 | 291 | # tmax if k >= bias + tmax, or k - bias otherwise |
292 | 292 | if ($k <= ($bias + self::BOOTSTRAP_TMIN)) { |
293 | 293 | $t = self::BOOTSTRAP_TMIN; |
294 | - } |
|
295 | - elseif ($k >= ($bias + self::BOOTSTRAP_TMAX)) { |
|
294 | + } elseif ($k >= ($bias + self::BOOTSTRAP_TMAX)) { |
|
296 | 295 | $t = self::BOOTSTRAP_TMAX; |
297 | - } |
|
298 | - else { |
|
296 | + } else { |
|
299 | 297 | $t = $k - $bias; |
300 | 298 | } |
301 | 299 | # if q < t then break |
@@ -112,8 +112,7 @@ |
||
112 | 112 | if (!$allow_redirects) { |
113 | 113 | throw new Requests_Exception('Redirection not allowed', 'response.no_redirects', $this); |
114 | 114 | } |
115 | - } |
|
116 | - elseif (!$this->success) { |
|
115 | + } elseif (!$this->success) { |
|
117 | 116 | $exception = Requests_Exception_HTTP::get_class($this->status_code); |
118 | 117 | throw new $exception(null, $this); |
119 | 118 | } |
@@ -249,8 +249,7 @@ |
||
249 | 249 | if (is_array($this->data)) { |
250 | 250 | $request['data'] = $this->data; |
251 | 251 | } |
252 | - } |
|
253 | - elseif (is_array($request['data']) && is_array($this->data)) { |
|
252 | + } elseif (is_array($request['data']) && is_array($this->data)) { |
|
254 | 253 | $request['data'] = array_merge($this->data, $request['data']); |
255 | 254 | } |
256 | 255 |
@@ -280,8 +280,7 @@ discard block |
||
280 | 280 | $delta_seconds = (int) $value; |
281 | 281 | if ($delta_seconds <= 0) { |
282 | 282 | $expiry_time = 0; |
283 | - } |
|
284 | - else { |
|
283 | + } else { |
|
285 | 284 | $expiry_time = $this->reference_time + $delta_seconds; |
286 | 285 | } |
287 | 286 | |
@@ -338,8 +337,7 @@ discard block |
||
338 | 337 | // Ignore non-associative attributes |
339 | 338 | if (is_numeric($key)) { |
340 | 339 | $parts[] = $value; |
341 | - } |
|
342 | - else { |
|
340 | + } else { |
|
343 | 341 | $parts[] = sprintf('%s=%s', $key, $value); |
344 | 342 | } |
345 | 343 | } |
@@ -385,8 +383,7 @@ discard block |
||
385 | 383 | |
386 | 384 | if (!empty($name)) { |
387 | 385 | $value = $string; |
388 | - } |
|
389 | - elseif (strpos($kvparts, '=') === false) { |
|
386 | + } elseif (strpos($kvparts, '=') === false) { |
|
390 | 387 | // Some sites might only have a value without the equals separator. |
391 | 388 | // Deviate from RFC 6265 and pretend it was actually a blank name |
392 | 389 | // (`=foo`) |
@@ -394,8 +391,7 @@ discard block |
||
394 | 391 | // https://bugzilla.mozilla.org/show_bug.cgi?id=169091 |
395 | 392 | $name = ''; |
396 | 393 | $value = $kvparts; |
397 | - } |
|
398 | - else { |
|
394 | + } else { |
|
399 | 395 | list($name, $value) = explode('=', $kvparts, 2); |
400 | 396 | } |
401 | 397 | $name = trim($name); |
@@ -409,8 +405,7 @@ discard block |
||
409 | 405 | if (strpos($part, '=') === false) { |
410 | 406 | $part_key = $part; |
411 | 407 | $part_value = true; |
412 | - } |
|
413 | - else { |
|
408 | + } else { |
|
414 | 409 | list($part_key, $part_value) = explode('=', $part, 2); |
415 | 410 | $part_value = trim($part_value); |
416 | 411 | } |
@@ -445,8 +440,7 @@ discard block |
||
445 | 440 | if (empty($parsed->attributes['domain']) && !empty($origin)) { |
446 | 441 | $parsed->attributes['domain'] = $origin->host; |
447 | 442 | $parsed->flags['host-only'] = true; |
448 | - } |
|
449 | - else { |
|
443 | + } else { |
|
450 | 444 | $parsed->flags['host-only'] = false; |
451 | 445 | } |
452 | 446 | |
@@ -460,14 +454,12 @@ discard block |
||
460 | 454 | // the uri-path is not a %x2F ("/") character, output |
461 | 455 | // %x2F ("/") and skip the remaining steps. |
462 | 456 | $path = '/'; |
463 | - } |
|
464 | - elseif (substr_count($path, '/') === 1) { |
|
457 | + } elseif (substr_count($path, '/') === 1) { |
|
465 | 458 | // If the uri-path contains no more than one %x2F ("/") |
466 | 459 | // character, output %x2F ("/") and skip the remaining |
467 | 460 | // step. |
468 | 461 | $path = '/'; |
469 | - } |
|
470 | - else { |
|
462 | + } else { |
|
471 | 463 | // Output the characters of the uri-path from the first |
472 | 464 | // character up to, but not including, the right-most |
473 | 465 | // %x2F ("/"). |