Code styling: Remove deprecated $charset param for api_htmlentities()

pull/4020/head
Yannick Warnier 4 years ago
parent 1ad423f718
commit 6f484e2e85
  1. 2
      public/main/admin/access_urls.php
  2. 2
      public/main/admin/specific_fields.php
  3. 4
      public/main/exercise/exercise.class.php
  4. 2
      public/main/inc/lib/groupmanager.lib.php
  5. 2
      public/main/lp/learnpathItem.class.php
  6. 2
      public/main/session/session_category_add.php
  7. 4
      public/main/session/session_category_edit.php
  8. 2
      public/main/session/session_category_list.php
  9. 6
      public/main/session/session_course_list.php
  10. 10
      public/main/session/session_course_user_list.php
  11. 2
      public/main/survey/survey.php
  12. 2
      public/main/user/resume_session.php
  13. 2
      src/CourseBundle/Component/CourseCopy/CourseSelectForm.php

@ -172,7 +172,7 @@ foreach ($data as $row) {
"access_url_edit.php?url_id=$url_id"
);
if ('1' != $url_id) {
$actions .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES, $charset))."'".')) return false;">'.
$actions .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES))."'".')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete'), [], ICON_SIZE_SMALL).'</a>';
}
$urls[] = [$url, $description, $status, $createdAt, $actions];

@ -54,7 +54,7 @@ function edit_filter($id, $url_params, $row)
global $charset;
$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.
Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("Please confirm your choice"), ENT_QUOTES, $charset))."'".')) return false;">'.
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("Please confirm your choice"), ENT_QUOTES))."'".')) return false;">'.
Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
return $return;

@ -9063,7 +9063,7 @@ class Exercise
'',
[
'onclick' => "javascript:if(!confirm('".addslashes(
api_htmlentities(get_lang('Are you sure to copy'), ENT_QUOTES, $charset)
api_htmlentities(get_lang('Are you sure to copy'), ENT_QUOTES)
)." ".addslashes($title)."?"."')) return false;",
'href' => 'exercise.php?'.api_get_cidreq(
).'&action=copy_exercise&sec_token='.$token.'&exerciseId='.$exerciseId,
@ -9200,7 +9200,7 @@ class Exercise
'',
[
'onclick' => "javascript:if(!confirm('".addslashes(
api_htmlentities(get_lang('Are you sure to copy'), ENT_QUOTES, $charset)
api_htmlentities(get_lang('Are you sure to copy'), ENT_QUOTES)
)." ".addslashes($title)."?"."')) return false;",
'href' => 'exercise.php?'.api_get_cidreq(
).'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$exerciseId,

@ -2117,7 +2117,7 @@ class GroupManager
$url = api_get_path(WEB_CODE_PATH).'group/';
$confirmMessage = addslashes(
api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES, $charset)
api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES)
);
foreach ($groupList as $group) {

@ -3154,7 +3154,7 @@ class learnpathItem
$new_terms_string = implode(',', $new_terms);
// TODO: Validate csv string.
$terms = Database::escape_string(api_htmlentities($new_terms_string, ENT_QUOTES, $charset));
$terms = Database::escape_string(api_htmlentities($new_terms_string, ENT_QUOTES));
$sql = "UPDATE $lp_item
SET terms = '$terms'
WHERE iid=".$this->get_id();

@ -73,7 +73,7 @@ if (!empty($return)) {
<label class="col-sm-3 control-label"><?php echo get_lang('Category name'); ?></label>
<div class="col-sm-6">
<input type="text" class="form-control" name="name" placeholder="<?php echo get_lang('Category'); ?>" size="50" maxlength="50" value="<?php if ($formSent) {
echo api_htmlentities($name, ENT_QUOTES, $charset);
echo api_htmlentities($name, ENT_QUOTES);
} ?>">
</div>
<div class="col-md-3"></div>

@ -93,9 +93,9 @@ if (!empty($return)) {
<label class="col-sm-3 control-label"><?php echo get_lang('Name'); ?></label>
<div class="col-sm-6">
<input class="form-control" type="text" name="name" size="50" maxlength="50" value="<?php if ($formSent) {
echo api_htmlentities($name, ENT_QUOTES, $charset);
echo api_htmlentities($name, ENT_QUOTES);
} else {
echo api_htmlentities($infos['name'], ENT_QUOTES, $charset);
echo api_htmlentities($infos['name'], ENT_QUOTES);
} ?>">
</div>
<div class="col-sm-3"></div>

@ -190,7 +190,7 @@ if (isset($_GET['search']) && 'advanced' === $_GET['search']) {
<tr class="<?php echo $i ? 'row_odd' : 'row_even'; ?>">
<td><input type="checkbox" id="idChecked_<?php echo $x; ?>" name="idChecked[]"
value="<?php echo $enreg['id']; ?>"></td>
<td><?php echo api_htmlentities($enreg['name'], ENT_QUOTES, $charset); ?></td>
<td><?php echo api_htmlentities($enreg['name'], ENT_QUOTES); ?></td>
<td><?php echo "<a href=\"session_list.php?id_category=".$enreg['id']."\">".$nb_courses
." Session(s) </a>"; ?></td>
<td><?php echo api_format_date($enreg['date_start'], DATE_FORMAT_SHORT); ?></td>

@ -62,7 +62,7 @@ $sql = "SELECT c.id, c.code, c.title, nbr_users
LIMIT $from,".($limit + 1);
$result = Database::query($sql);
$Courses = Database::store_result($result);
$tool_name = api_htmlentities($session_name, ENT_QUOTES, $charset).' : '.get_lang('Courses in this session');
$tool_name = api_htmlentities($session_name, ENT_QUOTES).' : '.get_lang('Courses in this session');
$interbreadcrumb[] = ['url' => "session_list.php", "name" => get_lang('Session list')];
$interbreadcrumb[] = ['url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']), "name" => get_lang('Session overview')];
@ -83,13 +83,13 @@ $tableCourses = [];
foreach ($Courses as $key => $enreg) {
$course = [];
$course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">';
$course[] = api_htmlentities($enreg['title'], ENT_QUOTES, $charset);
$course[] = api_htmlentities($enreg['title'], ENT_QUOTES);
$course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>';
$course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'.
Display::return_icon('course_home.png', get_lang('Course')).'</a>
<a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'.
Display::return_icon('edit.png', get_lang('Edit')).'</a>
<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("Please confirm your choice"), ENT_QUOTES, $charset)).'\')) return false;">'.
<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("Please confirm your choice"), ENT_QUOTES)).'\')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete')).'</a>';
$tableCourses[] = $course;
}

@ -194,16 +194,16 @@ echo Display::page_header($tool_name);
<td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td>
<?php if ($is_western_name_order) {
?>
<td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
<td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
<td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES); ?></td>
<td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES); ?></td>
<?php
} else {
?>
<td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES, $charset); ?></td>
<td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES, $charset); ?></td>
<td><?php echo api_htmlentities($enreg['lastname'], ENT_QUOTES); ?></td>
<td><?php echo api_htmlentities($enreg['firstname'], ENT_QUOTES); ?></td>
<?php
} ?>
<td><?php echo api_htmlentities($enreg['username'], ENT_QUOTES, $charset); ?></td>
<td><?php echo api_htmlentities($enreg['username'], ENT_QUOTES); ?></td>
<td>
<?php if ($enreg['is_subscribed']) {
?>

@ -332,7 +332,7 @@ while ($row = Database::fetch_array($result, 'ASSOC')) {
echo '<a
href="'.api_get_path(WEB_CODE_PATH).'survey/survey.php?'.
api_get_cidreq().'&action=delete&survey_id='.$survey_id.'&question_id='.$questionId.'"
onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?', ENT_QUOTES, $charset)).'\')) return false;">'.
onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("DeleteSurveyQuestion").'?', ENT_QUOTES)).'\')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete')).'</a>';
if (3 != $survey_data['survey_type']) {
if ($question_counter > 1) {

@ -250,7 +250,7 @@ if ('true' === $allowTutors) {
if (!empty($user['user_id'])) {
$user_link = '<a
href="'.api_get_path(WEB_CODE_PATH).'admin/user_information.php?user_id='.intval($user['user_id']).'">'.
api_htmlentities(api_get_person_name($user['firstname'], $user['lastname']), ENT_QUOTES, $charset).' ('.$user['username'].')</a>';
api_htmlentities(api_get_person_name($user['firstname'], $user['lastname']), ENT_QUOTES).' ('.$user['username'].')</a>';
}
$link_to_add_user_in_url = '';

@ -292,7 +292,7 @@ class CourseSelectForm
<button
class="save"
type="submit"
onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES, $charset))."'".')) return false;" >'.
onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('Please confirm your choice'), ENT_QUOTES))."'".')) return false;" >'.
get_lang('Validate').'</button>';
} else {
if ($recycleOption) {

Loading…
Cancel
Save