Changeset 7055
- Timestamp:
- 02/27/08 00:36:33 (9 months ago)
- Files:
-
- trunk/wp-admin/includes/file.php (modified) (3 diffs)
- trunk/wp-includes/formatting.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/includes/file.php
r7054 r7055 41 41 42 42 return $real_file; 43 }44 45 function get_temp_dir() {46 if ( defined('WP_TEMP_DIR') )47 return trailingslashit(WP_TEMP_DIR);48 49 $temp = ABSPATH . 'wp-content/';50 if ( is_dir($temp) && is_writable($temp) )51 return $temp;52 53 if ( function_exists('sys_get_temp_dir') )54 return trailingslashit(sys_get_temp_dir());55 56 return '/tmp/';57 43 } 58 44 … … 197 183 return false; 198 184 199 $tmpfname = tempnam( get_temp_dir(), 'wpupdate');185 $tmpfname = tempnam('/tmp', 'wpupdate'); 200 186 if( ! $tmpfname ) 201 187 return false; … … 303 289 304 290 function get_filesystem_method() { 305 $tempFile = tempnam( get_temp_dir(), 'WPU');291 $tempFile = tempnam('/tmp', 'WPU'); 306 292 307 293 if ( getmyuid() == fileowner($tempFile) ) { trunk/wp-includes/formatting.php
r7054 r7055 84 84 $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 85 85 if ($br) { 86 $pee = preg_replace _callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'str_replace("\n", "<WPPreserveNewline />", $matches[1])'), $pee);86 $pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee); 87 87 $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 88 88 $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
