Minor - format code, don't show invalid dates

pull/2858/head
Julio Montoya 7 years ago
parent 7d852156bd
commit cacbae5444
  1. 27
      main/survey/surveyUtil.class.php
  2. 2
      main/survey/survey_list.php

@ -3186,14 +3186,25 @@ class SurveyUtil
$array[2] = $survey[2].$session_img;
$array[3] = $survey[3];
$array[4] = $survey[4];
$array[5] = api_convert_and_format_date(
$survey[5],
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
);
$array[6] = api_convert_and_format_date(
$survey[6],
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
);
// Dates
$array[5] = '';
if (!empty($survey[5]) && $survey[5] !== '0000-00-00' && $survey[5] !== '0000-00-00 00:00:00') {
$array[5] = api_convert_and_format_date(
$survey[5],
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
);
}
$array[6] = '';
if (!empty($survey[6]) && $survey[6] !== '0000-00-00' && $survey[6] !== '0000-00-00 00:00:00') {
$array[6] = api_convert_and_format_date(
$survey[6],
$allowSurveyAvailabilityDatetime ? DATE_TIME_FORMAT_LONG : DATE_FORMAT_LONG
);
}
$array[7] =
Display::url(
$survey['answered'],

@ -23,7 +23,7 @@ $current_course_tool = TOOL_SURVEY;
$currentUserId = api_get_user_id();
api_protect_course_script(true);
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : null;
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : '';
// Tracking
Event::event_access_tool(TOOL_SURVEY);

Loading…
Cancel
Save