Changeset 2344285
- Timestamp:
- 07/21/2020 06:56:27 PM (6 years ago)
- Location:
- find-and-replace-all/trunk
- Files:
-
- 3 edited
-
frform.php (modified) (2 diffs)
-
functions.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
find-and-replace-all/trunk/frform.php
r1771708 r2344285 3 3 die; 4 4 } 5 5 6 $findstr = isset($_POST['findstr']) ? stripslashes_deep($_POST['findstr']) : ''; 6 7 $replacestr = isset($_POST['replacestr']) ? stripslashes_deep($_POST['replacestr']) : ''; … … 33 34 $unserialized = array_value_replace($unserialized, $findstr, $replacestr); 34 35 $updatesql = $wpdb->prepare("UPDATE $table SET `$field` = %s WHERE `$primary_column`='$primary_id'", array(serialize($unserialized))); 36 $wpdb->get_results($updatesql); 37 } 38 } else if (fra_is_JSON($cresult->$field)) { 39 $jsondata = @json_decode($cresult->$field); 40 if (is_array($jsondata)) { 41 $jsondata = array_value_replace($jsondata, $findstr, $replacestr); 42 $updatesql = $wpdb->prepare("UPDATE $table SET `$field` = %s WHERE `$primary_column`='$primary_id'", array(json_encode($jsondata))); 35 43 $wpdb->get_results($updatesql); 36 44 } -
find-and-replace-all/trunk/functions.php
r1771715 r2344285 58 58 59 59 } 60 61 if (!function_exists('fra_is_JSON')) { 62 63 function fra_is_JSON($string) { 64 return is_string($string) && is_array(json_decode($string, true)) && (json_last_error() == JSON_ERROR_NONE) ? true : false; 65 } 66 67 } -
find-and-replace-all/trunk/readme.txt
r2182871 r2344285 1 1 === Plugin Name === 2 2 Contributors: swain.tara 3 Donate link: http s://www.taraprasad.com3 Donate link: http://taraprasad.com 4 4 Tags: find and replace, replace all, all tables, all fields, string replace, URL replace 5 Requires at least: 4.66 Tested up to: 5. 25 Requires at least: 5.4 6 Tested up to: 5.4.2 7 7 Stable tag: 1.2 8 8 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.