From 0026126cc93748873a271222fba6b84e07b9cf54 Mon Sep 17 00:00:00 2001 From: Takayuki Miyoshi Date: Sun, 16 Jun 2024 16:56:44 +0900 Subject: [PATCH] Rename $args to $options #1369 --- includes/formatting.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/includes/formatting.php b/includes/formatting.php index 3bf78135..92e5d4b7 100644 --- a/includes/formatting.php +++ b/includes/formatting.php @@ -191,19 +191,19 @@ function wpcf7_strip_newline( $text ) { * Canonicalizes text. * * @param string $text Input text. - * @param string|array|object $args Options. + * @param string|array|object $options Options. * @return string Canonicalized text. */ -function wpcf7_canonicalize( $text, $args = '' ) { +function wpcf7_canonicalize( $text, $options = '' ) { // for back-compat - if ( is_string( $args ) and '' !== $args - and false === strpos( $args, '=' ) ) { - $args = array( - 'strto' => $args, + if ( is_string( $options ) and '' !== $options + and false === strpos( $options, '=' ) ) { + $options = array( + 'strto' => $options, ); } - $args = wp_parse_args( $args, array( + $options = wp_parse_args( $options, array( 'strto' => 'lower', 'strip_separators' => false, ) ); @@ -229,19 +229,19 @@ function wpcf7_canonicalize( $text, $args = '' ) { $text = mb_convert_kana( $text, 'asKV', $charset ); } - if ( $args['strip_separators'] ) { + if ( $options['strip_separators'] ) { $text = preg_replace( '/[\r\n\t ]+/', '', $text ); } else { $text = preg_replace( '/[\r\n\t ]+/', ' ', $text ); } - if ( 'lower' == $args['strto'] ) { + if ( 'lower' == $options['strto'] ) { if ( function_exists( 'mb_strtolower' ) ) { $text = mb_strtolower( $text, $charset ); } else { $text = strtolower( $text ); } - } elseif ( 'upper' == $args['strto'] ) { + } elseif ( 'upper' == $options['strto'] ) { if ( function_exists( 'mb_strtoupper' ) ) { $text = mb_strtoupper( $text, $charset ); } else {