Commit 6e96e214 authored by KR Moorhouse's avatar KR Moorhouse Committed by Kenny Hall

Added functionality to scrub unwanted and potentially corrupt characters from...

Added functionality to scrub unwanted and potentially corrupt characters from either end of Form imports. (#3098)
parent 10aa4ee9
......@@ -127,6 +127,14 @@ class NF_Abstracts_ModelFactory
*/
public function import_form( $import, $id = FALSE, $is_conversion = FALSE )
{
/*
* Remove any unwated (corrupted?) characters from either side of our object.
*/
$l_trim = strpos( $import, '{' );
$r_trim = strrpos( $import, '}' ) - $l_trim + 1;
$import = substr( $import, $l_trim, $r_trim );
if( ! is_array( $import ) ){
$data = WPN_Helper::utf8_decode( json_decode( html_entity_decode( $import ), true ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment