Skip to content

Commit

Permalink
Fix #12607: Improve admin directory check on login_page
Browse files Browse the repository at this point in the history
The warning on login_page.php for the /admin/ directory would sometimes
not appear even if files within the /admin/ directory were accessible.

This check has been improved to be more pedantic and better suited to
cross-platform environments.
  • Loading branch information
davidhicks committed Dec 15, 2010
1 parent 065c99c commit 970630a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions login_page.php
Expand Up @@ -221,11 +221,12 @@

# Check if the admin directory is available and is readable.
$t_admin_dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'admin' . DIRECTORY_SEPARATOR;
if ( is_dir( $t_admin_dir ) && is_executable( $t_admin_dir ) ) {
if ( is_dir( $t_admin_dir ) ) {
echo '<div class="warning" align="center">', "\n";
echo '<p><font color="red">', lang_get( 'warning_admin_directory_present' ), '</font></p>', "\n";
echo '</div>', "\n";

}
if ( is_dir( $t_admin_dir ) && is_readable( $t_admin_dir ) && is_executable( $t_admin_dir ) && @file_exists( "$t_admin_dir/." ) ) {
# since admin directory and db_upgrade lists are available check for missing db upgrades
# Check for db upgrade for versions < 1.0.0 using old upgrader
$t_db_version = config_get( 'database_version' , 0 );
Expand Down

0 comments on commit 970630a

Please sign in to comment.