Changeset 7054
- Timestamp:
- 02/27/08 00:25:08 (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
r6892 r7054 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/'; 43 57 } 44 58 … … 183 197 return false; 184 198 185 $tmpfname = tempnam( '/tmp', 'wpupdate');199 $tmpfname = tempnam(get_temp_dir(), 'wpupdate'); 186 200 if( ! $tmpfname ) 187 201 return false; … … 289 303 290 304 function get_filesystem_method() { 291 $tempFile = tempnam( '/tmp', 'WPU');305 $tempFile = tempnam(get_temp_dir(), 'WPU'); 292 306 293 307 if ( getmyuid() == fileowner($tempFile) ) { trunk/wp-includes/formatting.php
r6974 r7054 84 84 $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee); 85 85 if ($br) { 86 $pee = preg_replace ('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "<WPPreserveNewline />", "\\0")', $pee);86 $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', create_function('$matches', 'str_replace("\n", "<WPPreserveNewline />", $matches[1])'), $pee); 87 87 $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); // optionally make line breaks 88 88 $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
