From bef7c76c4ed45b1f4b7b4ed8f81ace1b964f983d Mon Sep 17 00:00:00 2001 From: Julio Potier Date: Thu, 5 Oct 2023 09:42:20 +0200 Subject: [PATCH] v2.2.4.1 --- defines.php | 2 +- free/admin/functions/admin.php | 52 +++++++ free/admin/functions/ajax-post.php | 51 ------ .../settings/class-secupress-settings.php | 2 +- free/functions/files.php | 2 +- free/functions/ip.php | 2 +- free/modules/antispam/callbacks.php | 1 + free/modules/antispam/plugins/fightspam.php | 147 +++++++++++++++++- free/modules/antispam/settings/antispam.php | 16 ++ free/modules/firewall/tools.php | 2 + .../users-login/settings/blacklist-logins.php | 4 + languages/secupress-fr_FR.mo | Bin 257373 -> 257592 bytes languages/secupress-fr_FR.po | 104 ++++++++----- readme.txt | 25 ++- secupress.php | 6 +- uninstall.php | 2 +- 16 files changed, 306 insertions(+), 112 deletions(-) diff --git a/defines.php b/defines.php index f58c865f..bdbcd173 100644 --- a/defines.php +++ b/defines.php @@ -1,7 +1,7 @@ ` and `
  • ` tags. + * + * @since 1.0 + * + * @param (array) $msgs An array of messages. + * @param (string) $test_name The scanner name. + * + * @return (string) An HTML list of formatted messages. + */ +function secupress_format_message( $msgs, $test_name ) { + $classname = 'SecuPress_Scan_' . $test_name; + $messages = $classname::get_instance()->get_messages(); + + $output = array(); + + if ( empty( $msgs ) ) { + return implode( '
    ', $output ); + } + + foreach ( $msgs as $id => $atts ) { + + if ( ! isset( $messages[ $id ] ) ) { + + $string = __( 'Fix done.', 'secupress' ); + + } elseif ( is_array( $messages[ $id ] ) ) { + + $count = array_shift( $atts ); + $string = translate_nooped_plural( $messages[ $id ], $count ); + + } else { + + $string = $messages[ $id ]; + + } + + if ( $atts ) { + foreach ( $atts as $i => $att ) { + if ( is_array( $att ) ) { + $atts[ $i ] = wp_sprintf_l( '%l', $att ); + } + } + } + + $output[] = ! empty( $atts ) ? vsprintf( $string, $atts ) : $string; + } + + return implode( '
    ', $output ); +} diff --git a/free/admin/functions/ajax-post.php b/free/admin/functions/ajax-post.php index 2c4c66d8..70dedff3 100755 --- a/free/admin/functions/ajax-post.php +++ b/free/admin/functions/ajax-post.php @@ -165,54 +165,3 @@ function secupress_check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) } } - -/** - * Retrieve messages by their ID and format them by wrapping them in `