PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.74
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.74
1.2.74 1.2.73 1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 All 174 releases
← All changes | includes/helpers/pages.php +12 -3 1.2.681.2.74 View file →
@@ -380,12 +380,18 @@
380 380 // badge text
381 381 if ( empty( $badge ) && empty($args['icon_class']) ) {
382 382 $badge = isset($field->site_title) ? $field->site_title : '';
383 383 }
384 - if( !empty( $badge ) && $badge = str_replace("%%input%%", $match_value,$badge) ){
384 + // Decode entities in the admin-authored template text now, before any
385 + // untrusted user values are substituted in below. Decoding after
386 + // substitution would undo the escaping applied to those values.
387 + if ( ! empty( $badge ) ) {
388 + $badge = wp_specialchars_decode( $badge, ENT_QUOTES );
389 + }
390 + if( !empty( $badge ) && $badge = str_replace("%%input%%", esc_html( (string) $match_value ), $badge) ){
385 391 // will be replace in condition check
386 392 }
387 - if( !empty( $badge ) && $user_id && $badge = str_replace("%%profile_url%%", uwp_build_profile_tab_url($user_id),$badge) ){
393 + if( !empty( $badge ) && $user_id && $badge = str_replace("%%profile_url%%", esc_url( uwp_build_profile_tab_url($user_id) ),$badge) ){
388 394 // will be replace in condition check
389 395 }
390 396
391 397 // link url, replace vars
@@ -428,9 +434,9 @@
428 434 if ( ! empty( $args['new_window'] ) ) {
429 435 $new_window = ' target="_blank" ';
430 436 }
431 437
432 - $badge = ! empty( $badge ) ? __( wp_specialchars_decode( $badge, ENT_QUOTES ), 'userswp' ) : '';
438 + $badge = ! empty( $badge ) ? __( $badge, 'userswp' ) : '';
433 439
434 440 // phone & email link
435 441 if ( ! empty( $field ) && ! empty( $field->field_type ) && ! empty( $args['link'] ) && strpos( $args['link'], 'http' ) !== 0 ) {
436 442 if ( $field->field_type == 'phone' ) {
@@ -595,8 +601,11 @@
595 601 if(isset($user_data)){
596 602 foreach($user_data as $key => $val) {
597 603 if ( ! in_array( $key, $excluded_fields ) ) {
598 604 $val = apply_filters( 'uwp_replace_variables_' . $key, $val, $text );
605 + if ( is_scalar( $val ) ) {
606 + $val = esc_html( (string) $val );
607 + }
599 608 $text = str_replace( '%%' . $key . '%%', $val, $text );
600 609 }
601 610 }
602 611 }