Skip to content

Commit b7a7f83

Browse files
Removed deprecated get_magic_quotes_runtime() method
1 parent bca80b7 commit b7a7f83

File tree

4 files changed

+12
-21
lines changed

4 files changed

+12
-21
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ You can sign up for a free account here https://www.socketlabs.com/signup_form/?
4545
Visit our Support System if you have any questions, the SocketLabs Support Team is happy to help — https://support.socketlabs.com/
4646

4747
## Changelog
48+
* 1.1.0 Removed deprecated get_magic_quotes_runtime().
4849
* 1.0.14 Confirmed functionality in WP v6.3.1.
4950
* 1.0.13 Fixed: Corrected a typo on connection status admin page.
5051
* 1.0.12 Fixed: Added recipient email verification check.

README.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: email, injection, smtp, mailer, wp_mail, mailing, deliverability
44
Requires at least: 3.0.1
55
Tested up to: 6.3.1
66
Requires PHP: 3.0.1
7-
Stable tag: 1.0.14
7+
Stable tag: 1.1.0
88
License: GPLv2 or later
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010
Donate link: https://socketlabs.com/

includes/class-socketlabs-io.php

+8-18
Original file line numberDiff line numberDiff line change
@@ -208,26 +208,16 @@ public static function encodeFile($path)
208208
if (!is_readable($path)) {
209209
throw new Exception("Cannot open file: " . $path);
210210
}
211-
$magic_quotes = get_magic_quotes_runtime();
212-
if ($magic_quotes) {
213-
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
214-
set_magic_quotes_runtime(false);
215-
} else {
216-
//Doesn't exist in PHP 5.4, but we don't need to check because
217-
//get_magic_quotes_runtime always returns false in 5.4+
218-
//so it will never get here
219-
ini_set('magic_quotes_runtime', false);
220-
}
221-
}
211+
//PHP versions greater than 5.3.0 should always have magic_quotes_runtime disabled.
212+
//Magic quotes have been deprecated in PHP and removed as of PHP 5.4. So there is
213+
//no reason to diable the feature.
214+
//get_magic_quotes_runtime() deprecated and removed in PHP 7.4
215+
//https://www.php.net/manual/en/function.get-magic-quotes-runtime.php
216+
ini_set('magic_quotes_runtime', false);
217+
222218
$file_buffer = file_get_contents($path);
223219
$file_buffer = base64_encode($file_buffer);
224-
if ($magic_quotes) {
225-
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
226-
set_magic_quotes_runtime($magic_quotes);
227-
} else {
228-
ini_set('magic_quotes_runtime', $magic_quotes);
229-
}
230-
}
220+
231221
return $file_buffer;
232222
} catch (Exception $exc) {
233223
return '';

socketlabs.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* Plugin Name: SocketLabs
1717
* Plugin URI: https://github.com/socketlabs/wordpress
1818
* Description: Send emails using your SocketLabs account.
19-
* Version: 1.0.14
19+
* Version: 1.1.0
2020
* Author: SocketLabs
2121
* Author URI: https://socketlabs.com/
2222
* License: GPL-2.0+
@@ -52,7 +52,7 @@
5252
* Start at version 1.0.0 and use SemVer - https://semver.org
5353
* Rename this for your plugin and update it as you release new versions.
5454
*/
55-
define('SOCKETLABS_VERSION', '1.0.14');
55+
define('SOCKETLABS_VERSION', '1.1.0');
5656
define("SOCKETLABS_OPTION_GROUP", 'socketlabs');
5757
define("SOCKETLABS_API_KEY", 'socketlabs_api_key');
5858
define("SOCKETLABS_SERVER_ID", 'socketlabs_server_id');

0 commit comments

Comments
 (0)