Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#10836 closed defect (bug) (fixed)

Several Importers call create_function() multiple times per imported post

Reported by: mdawaffe Owned by:
Priority: normal Milestone: 2.9
Component: Import Version: 2.8.4
Severity: normal Keywords: has-patch needs-testing
Cc: Focuses:

Description

The WordPress, Blogger, Blogware, LiveJournal, and RSS importers all call create_function() one or more times per post.

Importing a lot of posts means creating a lot of functions, all of which do the same thing. This can lead to fatal memory allocation errors.

Attached replaces each create_function() call with a hardcoded function.

Patch in UNTESTED.

Attachments (1)

10836.diff (7.9 KB ) - added by mdawaffe 17 years ago.

Download all attachments as: .zip

Change History (6)

@mdawaffe
17 years ago

#1 @ryan
17 years ago

  • Resolutionfixed
  • Status newclosed

(In [11964]) Use hard-coded functions instead of create_function() in importers. Props mdawaffe. fixes #10836

#2 @hakre
17 years ago

  • Resolution fixed
  • Status closedreopened

ryan, please see the parameter is called $matches but you use $match later on. this is a minor bug I assume by copy/paste. please fix it.

 	532	    function _normalize_tag( $matches ) { 
 	533	        return '<' . strtolower( $match[1] ); 
 	534	    } 

#3 @hakre
17 years ago

okay it's mdawaffe code, don't want to give false credits here.

#4 @hakre
17 years ago

  • Status reopenedreviewing

the problem is in the patch mulitple times. just change the _normalize_tag() function.

idea: what about having one parent import class that provides functions for all the importers which do only extend from that class.

#5 @nacin
17 years ago

  • Resolutionfixed
  • Status reviewingclosed

Has been fixed in [12104].

Note: See TracTickets for help on using tickets.