Plugin Directory

Changeset 2970311


Ignore:
Timestamp:
09/22/2023 04:55:02 PM (18 months ago)
Author:
ironikus
Message:

introduce v3.1.4

Location:
wp-mailto-links
Files:
50 added
5 edited

Legend:

Unmodified
Added
Removed
  • wp-mailto-links/trunk/core/includes/classes/class-wp-mailto-links-helpers.php

    r2159924 r2970311  
    237237        return ( rand(0,1) == 1 ) ? true : false;
    238238    }
     239
     240    /**
     241     * Sanitize classes
     242     *
     243     * @param string $classes
     244     * @param string $sep
     245     * @return string
     246     */
     247    public function sanitize_html_classes( $classes, $sep = " " ){
     248        $return = "";
     249
     250        if( ! is_array( $classes ) ) {
     251            $classes = explode( $sep, $classes );
     252        }
     253
     254        if( ! empty( $classes ) ){
     255            foreach( $classes as $class ){
     256                $return .= sanitize_html_class( $class ) . " ";
     257            }
     258        }
     259
     260        return $return;
     261    }
    239262   
    240263}
  • wp-mailto-links/trunk/core/includes/classes/class-wp-mailto-links-run.php

    r2970166 r2970311  
    469469            $display = $email;
    470470        } else {
    471             $atts['href'] = 'mailto:'.$email;
     471            $atts['href'] = 'mailto:'. sanitize_email( $email );
    472472        }
    473473
  • wp-mailto-links/trunk/core/includes/classes/class-wp-mailto-links-validate.php

    r2236360 r2970311  
    542542     */
    543543    public function create_protected_mailto( $display, $attrs = array(), $protection_method = null ){
     544
     545        //Escape classes
     546        if( isset( $attrs['class'] ) ){
     547            $attrs['class'] = WPMT()->helpers->sanitize_html_classes( $attrs['class'] );
     548        }
     549
     550        //Escape titles
     551        if( isset( $attrs['title'] ) ){
     552            $attrs['title'] = esc_html( $attrs['title'] );
     553        }
     554
    544555        $email     = '';
    545556        $class_ori = ( empty( $attrs['class'] ) ) ? '' : $attrs['class'];
     
    570581                } else {
    571582                    // get email from href
    572                     $email = substr($value, 7);
     583                    $email = sanitize_email( substr($value, 7) );
    573584
    574585                    $encoded_email = $this->get_encoded_email( $email );
     
    580591               
    581592            } else {
    582                 $link .= $key . '="' . $value . '" ';
     593                $link .= $key . '="' . esc_js( $value ) . '" ';
    583594            }
    584595        }
  • wp-mailto-links/trunk/readme.txt

    r2970166 r2970311  
    44Requires at least: 4.7
    55Tested up to: 6.2
    6 Stable tag: 3.1.3
     6Stable tag: 3.1.4
    77Requires PHP: 5.3.2
    88License: GPLv2 or later
     
    109109
    110110== Changelog ==
     111
     112= 3.1.4: September 22, 2023 =
     113* Security Patch for XSS vulnerability within the create_protected_mailto() function (Thanks to Wordfence)
    111114
    112115= 3.1.3: September 22, 2023 =
  • wp-mailto-links/trunk/wp-mailto-links.php

    r2970166 r2970311  
    22 /**
    33 * Plugin Name:    WP Mailto Links - Hide & Protect Emails
    4  * Version:        3.1.3
     4 * Version:        3.1.4
    55 * Plugin URI:     https://wordpress.org/plugins/wp-mailto-links/
    66 * Description:    Protect & encode email addresses and mailto links from spambots & spamming. Easy to use - encodes emails out-of-the-box.
     
    2323
    2424// Plugin version.
    25 define( 'WPMT_VERSION',        '3.1.3' );
     25define( 'WPMT_VERSION',        '3.1.4' );
    2626
    2727// Determines if the plugin is loaded
Note: See TracChangeset for help on using the changeset viewer.