-
-
Save Pross/1955e54d6161bc20264f03569c91ebc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/classes/plugins/beaverbuilder.php b/classes/plugins/beaverbuilder.php | |
index af36c82..7f300e9 100644 | |
--- a/classes/plugins/beaverbuilder.php | |
+++ b/classes/plugins/beaverbuilder.php | |
@@ -7,6 +7,13 @@ | |
function mfrh_beaver_builder( $post, $orig_image_url, $new_image_url ) { | |
global $wpdb; | |
+ /** | |
+ * Validate urls before ommiting to the database! | |
+ */ | |
+ if ( '' === $orig_image_url || '' === $new_image_url ) { | |
+ return false; | |
+ } | |
+ | |
$query = $wpdb->prepare( "UPDATE $wpdb->postmeta | |
SET meta_value = REPLACE(meta_value, 's:%d:\"$orig_image_url', 's:%d:\"$new_image_url') | |
WHERE meta_key = '_fl_builder_data' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment