### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
65 | 65 | * @return bool True on write success, false on failure. |
66 | 66 | */ |
67 | 67 | function insert_with_markers( $filename, $marker, $insertion ) { |
68 | | if (!file_exists( $filename ) || is_writeable( $filename ) ) { |
69 | | if (!file_exists( $filename ) ) { |
| 68 | $file_exists = file_exists( $filename ); |
| 69 | if (!$file_exists || is_writeable( $filename ) ) { |
| 70 | if (!$file_exists ) { |
70 | 71 | $markerdata = ''; |
71 | 72 | } else { |
72 | 73 | $markerdata = explode( "\n", implode( '', file( $filename ) ) ); |
… |
… |
|
105 | 106 | fwrite( $f, "# END {$marker}\n" ); |
106 | 107 | } |
107 | 108 | fclose( $f ); |
| 109 | if (!$file_exists) |
| 110 | chmod( $filename, FS_CHMOD_FILE ); |
108 | 111 | return true; |
109 | 112 | } else { |
110 | 113 | return false; |