예제 #1
0
     }
     break;
 case 'update_lp':
     if (!$is_allowed_to_edit) {
         api_not_allowed(true);
     }
     if ($debug > 0) {
         error_log('New LP - update_lp action triggered', 0);
     }
     if (!$lp_found) {
         error_log('New LP - No learnpath given for edit', 0);
         require 'lp_list.php';
     } else {
         Session::write('refresh', 1);
         $lp_name = Security::remove_XSS($_REQUEST['lp_name']);
         $learnPath->set_name($lp_name);
         $author = $_REQUEST['lp_author'];
         // Fixing the author name (no body or html tags).
         $auth_init = stripos($author, '<p>');
         if ($auth_init === false) {
             $auth_init = stripos($author, '<body>');
             $auth_end = $auth_init + stripos(substr($author, $auth_init + 6), '</body>') + 7;
             $len = $auth_end - $auth_init + 6;
         } else {
             $auth_end = strripos($author, '</p>');
             $len = $auth_end - $auth_init + 4;
         }
         $author_fixed = substr($author, $auth_init, $len);
         //$author_fixed = $author;
         $learnPath->set_author($author_fixed);
         // TODO (as of Chamilo 1.8.8): Check in the future whether this field is needed.