Skip to content

Commit

Permalink
Merge pull request #213 from fritzmg/fix-184
Browse files Browse the repository at this point in the history
fix version information leak (#184)
  • Loading branch information
davidmaack authored Oct 17, 2016
2 parents a4bc1d8 + ac135f9 commit 959d7cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 12 additions & 2 deletions system/modules/multicolumnwizard/MultiColumnWizardHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@ public function __construct()
parent::__construct();
}

public function addVersionToClass(&$objTemplate)
public function addScriptsAndStyles(&$objTemplate)
{
$objTemplate->ua .= ' version_' . str_replace('.', '-', VERSION) . '-' . str_replace('.', '-', BUILD);
//do not allow version information to be leaked in the backend login and install tool (#184)
if ($objTemplate->getName() != 'be_login' && $objTemplate->getName() != 'be_install')
{
$GLOBALS['TL_JAVASCRIPT']['mcw'] = $GLOBALS['TL_CONFIG']['debugMode']
? 'system/modules/multicolumnwizard/html/js/multicolumnwizard_be_src.js'
: 'system/modules/multicolumnwizard/html/js/multicolumnwizard_be.js';
$GLOBALS['TL_CSS']['mcw'] = $GLOBALS['TL_CONFIG']['debugMode']
? 'system/modules/multicolumnwizard/html/css/multicolumnwizard_src.css'
: 'system/modules/multicolumnwizard/html/css/multicolumnwizard.css';
$objTemplate->ua .= ' version_' . str_replace('.', '-', VERSION) . '-' . str_replace('.', '-', BUILD);
}
}

public function supportModalSelector($strTable)
Expand Down
10 changes: 2 additions & 8 deletions system/modules/multicolumnwizard/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,5 @@

if (TL_MODE == 'BE')
{
$GLOBALS['TL_JAVASCRIPT']['mcw'] = $GLOBALS['TL_CONFIG']['debugMode']
? 'system/modules/multicolumnwizard/html/js/multicolumnwizard_be_src.js'
: 'system/modules/multicolumnwizard/html/js/multicolumnwizard_be.js';
$GLOBALS['TL_CSS']['mcw'] = $GLOBALS['TL_CONFIG']['debugMode']
? 'system/modules/multicolumnwizard/html/css/multicolumnwizard_src.css'
: 'system/modules/multicolumnwizard/html/css/multicolumnwizard.css';
$GLOBALS['TL_HOOKS']['parseTemplate'][] = array('MultiColumnWizardHelper', 'addVersionToClass');
}
$GLOBALS['TL_HOOKS']['parseTemplate'][] = array('MultiColumnWizardHelper', 'addScriptsAndStyles');
}

0 comments on commit 959d7cc

Please sign in to comment.