Don't slurp in entire file. Props tellyworth. see #4421
git-svn-id: https://develop.svn.wordpress.org/trunk@5802 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
4c70bb896e
commit
3ea5315ea9
@ -85,13 +85,17 @@ class WP_Import {
|
||||
|
||||
function get_entries() {
|
||||
set_magic_quotes_runtime(0);
|
||||
$importdata = array_map('rtrim', file($this->file)); // Read the file into an array
|
||||
|
||||
$this->posts = array();
|
||||
$this->categories = array();
|
||||
$num = 0;
|
||||
$doing_entry = false;
|
||||
foreach ($importdata as $importline) {
|
||||
|
||||
$fp = fopen($this->file, 'r');
|
||||
if ($fp) {
|
||||
while ( !feof($fp) ) {
|
||||
$importline = rtrim(fgets($fp));
|
||||
|
||||
if ( false !== strpos($importline, '<wp:category>') ) {
|
||||
preg_match('|<wp:category>(.*?)</wp:category>|is', $importline, $category);
|
||||
$this->categories[] = $category[1];
|
||||
@ -119,6 +123,9 @@ class WP_Import {
|
||||
$this->posts_processed[$post_ID][1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
function get_wp_authors() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user