Browse Source

Minor - fix php warning, use (int) casting #2843

Julio Montoya 6 years ago
parent
commit
8f3e41e220
1 changed files with 6 additions and 4 deletions
  1. 6 4
      main/lp/lp_update_scorm.php

+ 6 - 4
main/lp/lp_update_scorm.php

@@ -8,13 +8,15 @@
  *
  * @package chamilo.learnpath
  */
-$this_section = SECTION_COURSES;
 
 require_once __DIR__.'/../inc/global.inc.php';
 
+$this_section = SECTION_COURSES;
+
 api_protect_course_script();
+
 $allow = api_is_allowed_to_edit(null, true);
-$lpId = !empty($_GET['lp_id']) ? intval($_GET['lp_id']) : 0;
+$lpId = !empty($_GET['lp_id']) ? (int) $_GET['lp_id'] : 0;
 
 if (!$allow || empty($lpId)) {
     api_not_allowed(true);
@@ -44,8 +46,8 @@ $form = new FormValidator(
     api_get_self().'?'.api_get_cidreq().'&lp_id='.$lpId,
     '',
     [
-        'id' => "upload_form",
-        'enctype' => "multipart/form-data",
+        'id' => 'upload_form',
+        'enctype' => 'multipart/form-data',
     ]
 );
 $form->addHeader(get_lang('UpdateFile'));