PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | src/view/two-fa/otp.php +14 -12 5.7.1 → 6.3.0 View file →
@@ -17,9 +17,9 @@
17 17 */
18 18 function login_header_otp( $title = 'Log In', $message = '', $show_logo = true, $wp_error = '' ) {
19 19 global $error, $interim_login, $action;
20 20
21 - if ( empty( $wp_error ) ) {
21 + if ( ! ( $wp_error instanceof WP_Error ) ) {
22 22 $wp_error = new WP_Error();
23 23 }
24 24
25 25 // Shake it!
@@ -195,14 +195,14 @@
195 195 *
196 196 * @since 2.1.0
197 197 */
198 198 $message = apply_filters( 'login_message', $message );
199 - if ( ! empty( $message ) ) {
199 + if ( is_string( $message ) && '' !== trim( $message ) ) {
200 200 echo wp_kses_post( $message );
201 201 }
202 202
203 203 // In case a plugin uses $error rather than the $wp_errors object.
204 - if ( ! empty( $error ) ) {
204 + if ( $error instanceof WP_Error ) {
205 205 $wp_error->add( 'error', $error );
206 206 unset( $error );
207 207 }
208 208
@@ -218,9 +218,9 @@
218 218 $errors .= ' ' . $error_message . "<br />\n";
219 219 }
220 220 }
221 221 }
222 - if ( ! empty( $errors ) ) {
222 + if ( '' !== $errors ) {
223 223 /**
224 224 * Filters the error messages displayed above the login form.
225 225 *
226 226 * @param string $errors Login error message.
@@ -228,9 +228,9 @@
228 228 * @since 2.1.0
229 229 */
230 230 echo wp_kses_post( sprintf( '<div id="login_error" class="notice notice-error">%s</div>', apply_filters( 'login_errors', $errors ) ) );
231 231 }
232 - if ( ! empty( $messages ) ) {
232 + if ( '' !== $messages ) {
233 233 /**
234 234 * Filters instructional messages displayed above the login form.
235 235 *
236 236 * @param string $messages Login messages.
@@ -268,9 +268,9 @@
268 268 );
269 269 } else {
270 270 login_header_otp( '', '', $show_logo, $error );
271 271
272 - if ( ! empty( $providers ) ) {
272 + if ( is_array( $providers ) && array() !== $providers ) {
273 273 $nonce = wp_create_nonce( 'verify_otp' );
274 274 foreach ( $providers as $slug => $provider ) {
275 275 ?>
276 276 <form method="post" class="wpdef-2fa-form" id="wpdef-2fa-form-<?php echo esc_attr( $slug ); ?>" action="
@@ -293,9 +293,9 @@
293 293 <input type="hidden" name="password" value="<?php echo esc_attr( $password ); ?>"/>
294 294 <input type="hidden" name="requested_user" value="<?php echo esc_attr( $user_id ); ?>"/>
295 295 <input type="hidden" id="_wpnonce_<?php echo esc_attr( $slug ); ?>" name="_wpnonce" value="<?php echo esc_attr( $nonce ); ?>" />
296 296 <?php
297 - if ( ! empty( defender_get_data_from_request( 'interim-login', 'r' ) ) ) {
297 + if ( '1' === defender_get_data_from_request( 'interim-login', 'r' ) ) {
298 298 ?>
299 299 <input type="hidden" name="interim-login" value="1"/>
300 300 <?php
301 301 }
@@ -319,16 +319,18 @@
319 319 </ul>
320 320 </div>
321 321 <?php } ?>
322 322 <?php } ?>
323 - <?php if ( $custom_graphic ) { ?>
323 + <?php
324 + if ( $custom_graphic ) {
325 + ?>
324 326 <style type="text/css">
325 327 body.login div#login h1 a {
326 328 background-image: url("<?php echo esc_url_raw( $custom_graphic ); ?>");
327 329 }
328 330 </style>
329 - <?php } ?>
330 - <?php
331 + <?php
332 + }
331 333 $totp_script = <<<END
332 334 <script>
333 335 jQuery(function ($) {
334 336 function two_factor_providers(defaultSlug) {
@@ -423,9 +425,9 @@
423 425 */
424 426 echo $totp_script; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
425 427 }
426 428 );
427 - ?>
429 + ?>
428 430 <?php
429 431 }
430 432 ?>
431 433
@@ -461,9 +463,9 @@
461 463
462 464 </div>
463 465
464 466 <?php
465 - if ( ! empty( $input_id ) ) :
467 + if ( '' !== trim( $input_id ) ) :
466 468 ?>
467 469 <script type="text/javascript">
468 470 try {
469 471 document.getElementById('<?php echo esc_js( $input_id ); ?>').focus();