Support » Plugin: More Fields » [Plugin: More Fields] Patch to Fix Export

  • Danno040

    (@danno040)


    I was having issues with single quotes and (possibly) new lines in exported data. I have created the following patch to fix the issue. I wasn’t sure where to post it, so I’m posting it here:

    --- ../tags/2.1/more-plugins/more-plugins-admin.php	2012-03-07 15:51:01.000000000 -0700
    +++ more-plugins/more-plugins-admin.php	2012-03-07 16:16:33.000000000 -0700
    @@ -237,7 +237,8 @@
     			$f = $function . '_saved_' . $a;
     			$j = maybe_serialize($data);
     			$export = "<?php \nadd_filter('$filter', '$f');\n";
    -			$export .= "function $f (\$d) {\$d['$k'] = maybe_unserialize('$j', true); return \$d; }\n?>";
    +			$export .= "\$serialized_data = <<<EOT\n$j\nEOT;\n";
    +			$export .= "function $f (\$d) {\$d['$k'] = maybe_unserialize(\$serialized_data, true); return \$d; }\n?>";
     			$filename = $a . '.php';
     			$dir = $this->dir . 'saved/';

    http://wordpress.org/extend/plugins/more-fields/

  • The topic ‘[Plugin: More Fields] Patch to Fix Export’ is closed to new replies.