Skip to content

Commit

Permalink
Mark cdn_enabled as global setting
Browse files Browse the repository at this point in the history
Issue #19932
  • Loading branch information
vboctor committed Aug 19, 2015
1 parent 958d28b commit aa9b4f8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions config_defaults_inc.php
Expand Up @@ -4258,6 +4258,7 @@
'class_path','library_path', 'language_path', 'absolute_path_default_upload_folder',
'ldap_simulation_file_path', 'plugin_path', 'bottom_include_page', 'top_include_page',
'default_home_page', 'logout_redirect_page', 'manual_url', 'logo_url', 'wiki_engine_url',
'cdn_enabled'
);

# Temporary variables should not remain defined in global scope
Expand Down
4 changes: 2 additions & 2 deletions core/html_api.php
Expand Up @@ -366,7 +366,7 @@ function html_css() {
global $g_stylesheets_included;
html_css_link( config_get( 'css_include_file' ) );

if ( config_get( 'cdn_enabled' ) == ON ) {
if ( config_get_global( 'cdn_enabled' ) == ON ) {
echo '<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/' . JQUERY_UI_VERSION . '/themes/smoothness/jquery-ui.css">' . "\n";
} else {
html_css_link( 'jquery-ui-' . JQUERY_UI_VERSION . '.min.css' );
Expand Down Expand Up @@ -446,7 +446,7 @@ function html_head_javascript() {
echo "\t" . '<script type="text/javascript" src="' . helper_mantis_url( 'javascript_config.php' ) . '"></script>' . "\n";
echo "\t" . '<script type="text/javascript" src="' . helper_mantis_url( 'javascript_translations.php' ) . '"></script>' . "\n";

if ( config_get( 'cdn_enabled' ) == ON ) {
if ( config_get_global( 'cdn_enabled' ) == ON ) {
echo "\t" . '<script src="https://ajax.googleapis.com/ajax/libs/jquery/' . JQUERY_VERSION . '/jquery.min.js"></script>' . "\n";
echo "\t" . '<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/' . JQUERY_UI_VERSION . '/jquery-ui.min.js"></script>' . "\n";
} else {
Expand Down
2 changes: 1 addition & 1 deletion core/http_api.php
Expand Up @@ -166,7 +166,7 @@ function http_security_headers() {
$t_script_src = "script-src 'self'";

# White list the CDN urls (if enabled)
if ( config_get( 'cdn_enabled' ) == ON ) {
if ( config_get_global( 'cdn_enabled' ) == ON ) {
$t_cdn_url = 'https://ajax.googleapis.com';
$t_style_src .= " $t_cdn_url";
$t_script_src .= " $t_cdn_url";
Expand Down

0 comments on commit aa9b4f8

Please sign in to comment.