@@ -481,27 +481,24 @@ protected function column_http_status($item) {
481481
482482 $ classes = ['blc-status ' ];
483483 $ label = (string ) $ raw_status ;
484- $ status_description = __ ('Statut inconnu ou indisponible ' , 'liens-morts-detector-jlg ' );
484+ $ status_category_labels = [
485+ '1xx ' => __ ('Réponse informative (1xx) ' , 'liens-morts-detector-jlg ' ),
486+ '2xx ' => __ ('Disponible (2xx) ' , 'liens-morts-detector-jlg ' ),
487+ '3xx ' => __ ('Redirection (3xx) ' , 'liens-morts-detector-jlg ' ),
488+ '4xx ' => __ ('Erreur client (4xx) ' , 'liens-morts-detector-jlg ' ),
489+ '5xx ' => __ ('Erreur serveur (5xx) ' , 'liens-morts-detector-jlg ' ),
490+ 'unknown ' => __ ('Statut inconnu ou indisponible ' , 'liens-morts-detector-jlg ' ),
491+ ];
492+ $ status_description = $ status_category_labels ['unknown ' ];
485493
486494 if (is_numeric ($ raw_status )) {
487495 $ status_code = (int ) $ raw_status ;
488496 $ label = (string ) $ status_code ;
489497
490- if ($ status_code >= 200 && $ status_code < 300 ) {
491- $ classes [] = 'blc-status--2xx ' ;
492- $ status_description = __ ('Disponible (2xx) ' , 'liens-morts-detector-jlg ' );
493- } elseif ($ status_code >= 300 && $ status_code < 400 ) {
494- $ classes [] = 'blc-status--3xx ' ;
495- $ status_description = __ ('Redirection (3xx) ' , 'liens-morts-detector-jlg ' );
496- } elseif ($ status_code >= 400 && $ status_code < 500 ) {
497- $ classes [] = 'blc-status--4xx ' ;
498- $ status_description = __ ('Erreur client (4xx) ' , 'liens-morts-detector-jlg ' );
499- } elseif ($ status_code >= 500 && $ status_code < 600 ) {
500- $ classes [] = 'blc-status--5xx ' ;
501- $ status_description = __ ('Erreur serveur (5xx) ' , 'liens-morts-detector-jlg ' );
502- } elseif ($ status_code >= 100 && $ status_code < 200 ) {
503- $ classes [] = 'blc-status--1xx ' ;
504- $ status_description = __ ('Réponse informative (1xx) ' , 'liens-morts-detector-jlg ' );
498+ $ range_key = sprintf ('%dxx ' , (int ) floor ($ status_code / 100 ));
499+ if (isset ($ status_category_labels [$ range_key ])) {
500+ $ classes [] = 'blc-status-- ' . $ range_key ;
501+ $ status_description = $ status_category_labels [$ range_key ];
505502 } else {
506503 $ classes [] = 'blc-status--unknown ' ;
507504 }
0 commit comments