diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-28 12:19:24 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2005-07-28 12:19:24 +0000 |
commit | 6aef1f41c5a0a8ae2e3ff9a9e60c0ca12702bb42 (patch) | |
tree | bf58798e5b46754ff3ee8be9bef99458e98bfc51 /index.php | |
parent | bcd73bd794e2ab0f6a00b091c71e1a1a5fa5c1f4 (diff) | |
download | wordpress-mu-6aef1f41c5a0a8ae2e3ff9a9e60c0ca12702bb42.tar.gz wordpress-mu-6aef1f41c5a0a8ae2e3ff9a9e60c0ca12702bb42.tar.xz wordpress-mu-6aef1f41c5a0a8ae2e3ff9a9e60c0ca12702bb42.zip |
Change the permissions on .htaccess to 666 before writing to it.
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@85 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -140,12 +140,18 @@ function do_htaccess( $oldfilename, $newfilename, $realpath, $base, $url ) $htaccess = str_replace( "REALPATH", $realpath, $htaccess ); $htaccess = str_replace( "BASE", $base, $htaccess ); $htaccess = str_replace( "HOST", $url, $htaccess ); - $fp = fopen( $newfilename, "w" ); - if( $fp ) { - fwrite( $fp, $htaccess ); - fclose( $fp ); + if( touch( $newfilename ) ) { + chmod( $newfilename, 0666 ); + $fp = fopen( $newfilename, "w" ); + if( $fp ) { + fwrite( $fp, $htaccess ); + fclose( $fp ); + } else { + $err = "could not open $newfilename for writing"; + } + chmod( $newfilename, 0644 ); } else { - $err = "could not open $newfilename for writing"; + $err = "could not open $newfilename for writing"; } } else { $err = "could not open $oldfilename for reading"; |