WordPress.org

Ready to get started?Download WordPress

Forums

More Fields
Patch to Fix Export (1 post)

  1. Danno040
    Member
    Posted 2 years ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic