diff --git a/pinc/project_quick_check.inc b/pinc/project_quick_check.inc index 75c970f65..5c7a319bf 100644 --- a/pinc/project_quick_check.inc +++ b/pinc/project_quick_check.inc @@ -643,23 +643,38 @@ function tds_for_invalid_chars(string $raw): string function _test_project_for_word_lists(string $projectid): PQCResult { - $num_good_words = count(load_project_good_words($projectid)); - $num_bad_words = count(load_project_bad_words($projectid)); + $good_words = load_project_good_words($projectid); + $bad_words = load_project_bad_words($projectid); $test_name = _("Good/Bad Wordlists"); $test_desc = _("This test checks if the project good and bad word lists are populated."); - $details = "

"; - - if ($num_good_words || $num_bad_words) { - $status = _("Success"); - $summary = _("At least one of the good and bad word lists have entries."); + if (is_string($good_words) || is_string($bad_words)) { + $details = "

"; + $summary = _("Error loading word lists."); + $status = _("Error"); } else { - $status = _("Warning"); - $summary = _("Both of the word lists are empty."); + $num_good_words = count($good_words); + $num_bad_words = count($bad_words); + $details = "

"; + + if ($num_good_words || $num_bad_words) { + $status = _("Success"); + $summary = _("At least one of the good and bad word lists have entries."); + } else { + $status = _("Warning"); + $summary = _("Both of the word lists are empty."); + } } return new PQCResult($test_name, $test_desc, $status, $summary, $details);