From 40fcfeb30fc6e327d53f4cd4ed74c44b2fbca847 Mon Sep 17 00:00:00 2001 From: saxmatt Date: Sat, 12 Feb 2005 07:50:13 +0000 Subject: [PATCH] Be nicer to memory git-svn-id: http://svn.automattic.com/wordpress/trunk@2286 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/import-mt.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/wp-admin/import-mt.php b/wp-admin/import-mt.php index 06aea7cfaf..90449f2d15 100644 --- a/wp-admin/import-mt.php +++ b/wp-admin/import-mt.php @@ -65,13 +65,14 @@ if ('' != MTEXPORT && !file_exists(MTEXPORT)) die("The file you specified does n if ('' == MTEXPORT) die("You must edit the MTEXPORT line as described on the previous page to continue."); // Bring in the data set_magic_quotes_runtime(0); -$datalines = file(MTEXPORT); // Read the file into an array -$importdata = implode('', $datalines); // squish it +$importdata = file(MTEXPORT); // Read the file into an array +$importdata = implode('', $importdata); // squish it $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata); $importdata = preg_replace("/--------\nAUTHOR/", "--MT-ENTRY--\nAUTHOR", $importdata); $authors = array(); $temp = array(); $posts = explode("--MT-ENTRY--", $importdata); +unset( $importdata ); // Free up memory function users_form($n) { global $wpdb, $testing; @@ -174,12 +175,16 @@ for ($x = 1; $x < $y; $x++) { }//function checkauthor ends here //bring in the posts now - set_magic_quotes_runtime(0); -$datalines = file(MTEXPORT); // Read the file into an array -$importdata = implode('', $datalines); // squish it +set_magic_quotes_runtime(0); +$importdata = file(MTEXPORT); // Read the file into an array +$importdata = implode('', $importdata); // squish it $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata); $importdata = preg_replace("/--------\nAUTHOR/", "--MT-ENTRY--\nAUTHOR", $importdata); +$authors = array(); +$temp = array(); $posts = explode("--MT-ENTRY--", $importdata); +unset( $importdata ); // Free up memory + $i = -1; echo "
    "; foreach ($posts as $post) { if ('' != trim($post)) {