diff --git a/main/survey/surveyUtil.class.php b/main/survey/surveyUtil.class.php index 8d2123ef3a..3d5fa236b5 100755 --- a/main/survey/surveyUtil.class.php +++ b/main/survey/surveyUtil.class.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'], diff --git a/main/survey/survey_list.php b/main/survey/survey_list.php index 92c85026ab..b9ba3255ab 100755 --- a/main/survey/survey_list.php +++ b/main/survey/survey_list.php @@ -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);