Skip to content

Commit

Permalink
Add BUILD_NUMBER to the security check in .htaccess
Browse files Browse the repository at this point in the history
Change BUILD_NUMBER to be .ini format and add a big "do not edit" comment.
  • Loading branch information
bharat committed Jan 18, 2011
1 parent c1c67ec commit 29be21b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
7 changes: 6 additions & 1 deletion BUILD_NUMBER
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions modules/gallery/helpers/gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static function version_string() {
* 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"];
}
}

0 comments on commit 29be21b

Please sign in to comment.