Skip to content

Commit

Permalink
Merge branch 'master-1.3.x'
Browse files Browse the repository at this point in the history
Conflicts:
	core/html_api.php (resolved with change in layout_api.php)
	css/admin.css (deleted)
  • Loading branch information
dregad committed Aug 12, 2016
2 parents 4665ccc + 7abcf3c commit 0f93b5e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
10 changes: 10 additions & 0 deletions admin/check/check_api.php
Expand Up @@ -269,3 +269,13 @@ function check_print_test_warn_row( $p_description, $p_pass, $p_info = null ) {
function check_is_collation_utf8( $p_collation ) {
return substr( $p_collation, 0, 4 ) === 'utf8';
}

/**
* Formats a number with thousand separators and an optional unit
* @param float $p_number Number to print
* @param string $p_unit Printed after number
* @return string
*/
function check_format_number( $p_number, $p_unit = 'bytes' ) {
return number_format( (float)$p_number ) . ' ' . $p_unit;
}
8 changes: 6 additions & 2 deletions admin/check/check_attachments_inc.php
Expand Up @@ -58,13 +58,17 @@

check_print_info_row(
'Maximum file upload size (per file)',
config_get_global( 'max_file_size' ) . ' bytes'
check_format_number( config_get_global( 'max_file_size' ) )
);

check_print_test_row(
'max_file_size MantisBT option is less than or equal to the upload_max_filesize directive in php.ini',
config_get_global( 'max_file_size' ) <= ini_get_number( 'upload_max_filesize' ),
array( false => 'max_file_size is currently ' . htmlentities( config_get_global( 'max_file_size' ) ) . ' bytes which is greater than the limit of ' . htmlentities( ini_get_number( 'upload_max_filesize' ) ) . ' bytes imposed by the php.ini directive upload_max_filesize.' )
array( false => 'max_file_size is currently '
. check_format_number( config_get_global( 'max_file_size' ) )
. ' which is greater than the limit of '
. check_format_number( ini_get_number( 'upload_max_filesize' ) )
. ' imposed by the php.ini directive upload_max_filesize.' )
);

$t_use_xsendfile = config_get_global( 'file_download_xsendfile_enabled' );
Expand Down
17 changes: 17 additions & 0 deletions admin/check/check_display_inc.php
Expand Up @@ -36,6 +36,23 @@

check_print_section_header_row( 'Display' );

# Test length of OpenSearch ShortNames
$t_prefix = config_get( 'search_title' );
$t_shortname_text = sprintf( lang_get( 'opensearch_text_short' ), $t_prefix );
$t_shortname_id = sprintf( lang_get( 'opensearch_id_short' ), $t_prefix );
$t_shortname_length = max( strlen( $t_shortname_text ), strlen( $t_shortname_id ) );

check_print_test_warn_row(
"Browser Search engine names must be 16 chars or less",
$t_shortname_length <= 16,
array( false => 'Either shorten the "search_title" configuration option to '
. 'a maximum of ' . ( 16 - $t_shortname_length + strlen( $t_prefix ) )
. ' characters, or alter the "opensearch_XXX_short" language strings '
. 'as appropriate to meet the <a href="http://www.opensearch.org/">'
. 'OpenSearch 1.1</a> specification for the ShortName element.'
)
);

check_print_test_row(
'bug_link_tag is not blank/null',
config_get_global( 'bug_link_tag' ),
Expand Down
6 changes: 3 additions & 3 deletions admin/check/check_php_inc.php
Expand Up @@ -133,12 +133,12 @@

check_print_info_row(
'php.ini directive: memory_limit',
htmlentities( ini_get_number( 'memory_limit' ) ) . ' bytes'
check_format_number( ini_get_number( 'memory_limit' ) )
);

check_print_info_row(
'php.ini directive: post_max_size',
htmlentities( ini_get_number( 'post_max_size' ) ) . ' bytes'
check_format_number( ini_get_number( 'post_max_size' ) )
);

check_print_test_row(
Expand All @@ -154,7 +154,7 @@

check_print_info_row(
'php.ini directive: upload_max_filesize',
htmlentities( ini_get_number( 'upload_max_filesize' ) ) . ' bytes'
check_format_number( ini_get_number( 'upload_max_filesize' ) )
);

check_print_test_row(
Expand Down
2 changes: 1 addition & 1 deletion core/layout_api.php
Expand Up @@ -86,7 +86,7 @@ function layout_page_header_begin( $p_page_title = null ) {
}

# Advertise the availability of the browser search plug-ins.
$t_title = config_get_global( 'search_title' );
$t_title = config_get( 'search_title' );
$t_searches = array( 'text', 'id' );
foreach( $t_searches as $t_type ) {
echo "\t",
Expand Down

0 comments on commit 0f93b5e

Please sign in to comment.