Code Duplication    Length = 9-9 lines in 2 locations

main/inc/lib/system_announcements.lib.php 2 locations

@@ 350-358 (lines=9) @@
347
            return false;
348
        }
349
350
        if (($date_end_to_compare[1] ||
351
            $date_end_to_compare[2] ||
352
            $date_end_to_compare[0]) &&
353
            !checkdate($date_end_to_compare[1], $date_end_to_compare[2], $date_end_to_compare[0])
354
        ) {
355
            Display::addFlash(Display::return_message(get_lang('InvalidEndDate'), 'warning'));
356
357
            return false;
358
        }
359
360
        if (strlen(trim($title)) == 0) {
361
            Display::addFlash(Display::return_message(get_lang('InvalidTitle'), 'warning'));
@@ 539-547 (lines=9) @@
536
            return false;
537
        }
538
539
        if (($date_end_to_compare[1] ||
540
            $date_end_to_compare[2] ||
541
            $date_end_to_compare[0]) &&
542
            !checkdate($date_end_to_compare[1], $date_end_to_compare[2], $date_end_to_compare[0])
543
        ) {
544
            echo Display::return_message(get_lang('InvalidEndDate'));
545
546
            return false;
547
        }
548
549
        if (strlen(trim($title)) == 0) {
550
            echo Display::return_message(get_lang('InvalidTitle'));