Plugin Directory

Changeset 1904427


Ignore:
Timestamp:
07/05/2018 09:27:05 AM (8 years ago)
Author:
marisp
Message:
  • Fixed Bulk unsubscribe option on PHP 7.1+
Location:
wpnewsman-newsletters/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wpnewsman-newsletters/trunk/ajaxbackend.php

    r1346617 r1904427  
    11981198
    11991199    private function unsubscribeFromList($tbl, $emailsList) {
     1200       
    12001201        global $wpdb;           
    12011202        $c = 0;
    12021203
     1204/**
     1205* Returns a string with backslashes before characters that need to be escaped.
     1206* As required by MySQL and suitable for multi-byte character sets
     1207* Characters encoded are NUL (ASCII 0), \n, \r, \, ', ", and ctrl-Z.
     1208* In addition, the special control characters % and _ are also escaped,
     1209* suitable for all statements, but especially suitable for `LIKE`.
     1210*
     1211* @param string $string String to add slashes to
     1212* @return $string with `\` prepended to reserved characters
     1213*/
     1214
     1215if (function_exists('mb_ereg_replace'))
     1216{
     1217    function mb_escape(string $string)
     1218    {
     1219        return mb_ereg_replace('[\x00\x0A\x0D\x1A\x22\x25\x27\x5C\x5F]', '\\\0', $string);
     1220    }
     1221} else {
     1222    function mb_escape(string $string)
     1223    {
     1224        return preg_replace('~[\x00\x0A\x0D\x1A\x22\x25\x27\x5C\x5F]~u', '\\\$0', $string);
     1225    }
     1226}
     1227
    12031228        if ( preg_match_all('/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $emailsList, $matches) ) {
    12041229
     
    12081233            foreach ($matches[0] as $email) {
    12091234                $email = strtolower($email);
    1210                 $set .= $del.'"'.mysql_real_escape_string($email).'"';
     1235                $set .= $del.'"'.mb_escape($email).'"';
    12111236                $del = ', ';
    12121237                $c += 1;
  • wpnewsman-newsletters/trunk/readme.txt

    r1757263 r1904427  
    33Donate Link: http://wpnewsman.com/premium-newsletter-plugin-wordpress/
    44Tags: wpnewsman, newsletter, newsletters, newsletter signup, newsletter widget, subscribers, post notification, email subscription, email marketing, email, emailing, subscription
    5 Requires at least: 4.3
     5Requires at least: 4.8
    66Tested up to: 4.9
    7 Stable tag: 1.8.20
     7Stable tag: 1.8.21
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    127127== Changelog ==
    128128
     129= 1.8.21 =
     130* Fixed Bulk unsubscribe option on PHP 7.1+
     131
    129132= 1.8.20 =
    130133* Fixed path to install dir
  • wpnewsman-newsletters/trunk/wpnewsman.php

    r1620951 r1904427  
    44Plugin URI: https://wpnewsman.com
    55Description: You get simple yet powerful newsletter solution for WordPress. Now you can easily add double optin subscription forms in widgets, articles and pages, import and manage your lists, create and send beautiful newsletters directly from your WordPress site. You get complete freedom and a lower cost compared to Email Service Providers. Free yourself from paying for expensive email campaigns. WPNewsman plugin updated regularly with new features.
    6 Version: 1.8.20
    7 Author: Alex Ladyga - G-Lock Software
     6Version: 1.8.21
     7Author: G-Lock Software
    88Author URI: http://www.glocksoft.com
    99*/
    10 /*  Copyright 2012-2013  Alex Ladyga (email : alexladyga@glocksoft.com)
    11     Copyright 2012-2017  G-Lock Software
     10/*  Copyright 2012-2013  Alex Ladyga
     11    Copyright 2012-2018  G-Lock Software
    1212
    1313    This program is free software; you can redistribute it and/or modify
     
    3232
    3333define('NEWSMAN', 'wpnewsman');
    34 define('NEWSMAN_VERSION', '1.8.20');
     34define('NEWSMAN_VERSION', '1.8.21');
    3535
    3636define('NEWSMAN_MU_BUNDLED_VERSION', '1.0.7');
Note: See TracChangeset for help on using the changeset viewer.