Skip to content

Commit

Permalink
fix: remove replacement on POST requests
Browse files Browse the repository at this point in the history
  • Loading branch information
selul committed Jul 4, 2019
1 parent 00b68fd commit f4637ba
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions inc/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function should_replace() {
if ( array_key_exists( 'context', $_GET ) && $_GET['context'] == 'edit' ) {
return false; // @codeCoverageIgnore
}
if ( array_key_exists( 'tve', $_GET ) && $_GET['tve'] == 'true' ) {
if ( ! empty( $_POST ) && isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD'] === 'POST' ) {
return false; // @codeCoverageIgnore
}
if ( class_exists( 'FLBuilderModel', false ) ) {
Expand Down Expand Up @@ -216,10 +216,10 @@ public function register_hooks() {
/**
* Replace urls in post meta values.
*
* @param mixed $metadata Metadata.
* @param int $object_id Post id.
* @param mixed $metadata Metadata.
* @param int $object_id Post id.
* @param string $meta_key Meta key.
* @param bool $single Is single.
* @param bool $single Is single.
*
* @return mixed Altered meta.
*/
Expand Down Expand Up @@ -300,7 +300,7 @@ function ( $value ) {
* Process string content and replace possible urls.
*
* @param string $html String content.
* @param array $extracted_urls Urls to check.
* @param array $extracted_urls Urls to check.
*
* @return string Processed html.
*/
Expand Down Expand Up @@ -437,7 +437,7 @@ public static function parse_images_from_html( $content ) {
}
if ( $is_no_script ) {
$images['in_header'][ $url_key ] = true;
$is_no_script = strpos( $images[0][ $url_key ], '</noscript' ) !== false ? false : true;
$is_no_script = strpos( $images[0][ $url_key ], '</noscript' ) !== false ? false : true;
}
}
}
Expand Down

0 comments on commit f4637ba

Please sign in to comment.