Add BUILD_NUMBER to the security check in .htaccess

Change BUILD_NUMBER to be .ini format and add a big "do not edit" comment.
This commit is contained in:
Bharat Mediratta
2011-01-17 17:27:16 -08:00
parent c1c67ecf8d
commit 29be21bb0d
3 changed files with 9 additions and 4 deletions

View File

@@ -29,7 +29,7 @@
# in your Apache2 config file before you uncomment this block or
# you'll get an "Internal Server Error".
#
# <FilesMatch "(\.(class|fla|gitignore|inc|ini|sql|txt)|(README|LICENSE))$">
# <FilesMatch "(\.(class|fla|gitignore|inc|ini|sql|txt)|(README|LICENSE|BUILD_NUMBER))$">
# Order deny,allow
# Deny from all
# </FilesMatch>

View File

@@ -1 +1,6 @@
52
; This file keeps track of the build number for the "master"
; branch of gallery3. It's kept up to date by an automated
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
build_number=52

View File

@@ -205,7 +205,7 @@ class gallery_Core {
* Return the contents of the BUILD_NUMBER file, which should be a single integer.
*/
static function build_number() {
$lines = file(DOCROOT . "BUILD_NUMBER", FILE_IGNORE_NEW_LINES);
return $lines[0];
$result = parse_ini_file(DOCROOT . "BUILD_NUMBER");
return $result["build_number"];
}
}