Skip to content

Commit

Permalink
Updated browser-update.com settings, by default off
Browse files Browse the repository at this point in the history
  • Loading branch information
slackero committed Aug 27, 2021
1 parent 7d40237 commit a30bfef
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/config/dist.conf.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
$phpwcms['im_fix_colorspace'] = 'RGB'; // newer ImageMagick installs tend to have problems with colorspace setting, if colors are look bad try SRGB
$phpwcms['wkhtmltopdf_path'] = ''; // used for generating PDF, use full path including application name '/usr/bin/wkhtmltopdf'
$phpwcms['render_clean_html'] = 0; // clean up HTML source a bit, experimental can have unexpected side effects
$phpwcms['browser_check'] = array('fe'=>false, 'be'=>true, 'vs' => ''); // enable Browser Update check in frontend and/or backend, use "vs" to which browser version, see http://www.browser-update.org/index.html#install
$phpwcms['browser_check'] = array('fe' => false, 'be' => false, 'vs' => '', 'insecure' => true, 'required' => ''); // enable Browser Update check in frontend and/or backend, use "vs" to which browser version, see http://www.browser-update.org/index.html#install
$phpwcms['usergroup_support'] = false; // set true or false to support/disable this feature, is experimental
$phpwcms['force301_id2alias'] = false; // send 301 HTTP Redirect when article/structure has alias but ID is given
$phpwcms['force301_2struct'] = false; // send 301 HTTP Redirect to structure level when only 1 article is inside
Expand Down
10 changes: 7 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,15 @@
$content['page_end'] .= implode(LF, $block['bodyjs']);
}
if(!empty($phpwcms['browser_check']['fe'])) {
$content['page_end'] .= '<script'.SCRIPT_ATTRIBUTE_TYPE.'> var $buoop = {';
$buoop = array('insecure' => isset($phpwcms['browser_check']['insecure']) ? boolval($phpwcms['browser_check']['insecure']) : true);
if(!empty($phpwcms['browser_check']['vs'])) {
$content['page_end'] .= 'vs:' . $phpwcms['browser_check']['vs'];
$buoop['vs'] = $phpwcms['browser_check']['vs'];
}
$content['page_end'] .= '}; </script><script'.SCRIPT_ATTRIBUTE_TYPE.' src="//browser-update.org/update.js"></script>';
if(!empty($phpwcms['browser_check']['required'])) {
$buoop['required'] = '{' . trim($phpwcms['browser_check']['required'], '{}') . '}';
}
$content['page_end'] .= '<script'.SCRIPT_ATTRIBUTE_TYPE.'>var $buoop = ' . json_encode($buoop) . '; </script>';
$content['page_end'] .= '<script'.SCRIPT_ATTRIBUTE_TYPE.' src="https://browser-update.org/update.min.js"></script>';
}
$content['page_end'] .= LF.'</body>'.LF.'</html>';

Expand Down
21 changes: 13 additions & 8 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -409,15 +409,20 @@

$formAll = str_replace( array("'", "\r", "\n", '<'), array("\'", '', " ", "<'+'"), ob_get_clean() );

?><script>
?>
<script>
getObjectById('loginFormArea').innerHTML = '<?php echo $formAll ?>';
getObjectById('form_loginname').focus();
</script>
<?php if(!empty($phpwcms['browser_check']['be'])): ?>
<script>
$buoop = {<?php if(!empty($phpwcms['browser_check']['vs'])) { echo 'vs:'.$phpwcms['browser_check']['vs']; } ?>};
</script>
<script src="https://browser-update.org/update.js"></script>
<?php endif; ?>
<?php if(!empty($phpwcms['browser_check']['be'])):
$buoop = array('insecure' => isset($phpwcms['browser_check']['insecure']) ? boolval($phpwcms['browser_check']['insecure']) : true);
if(!empty($phpwcms['browser_check']['vs'])) {
$buoop['vs'] = $phpwcms['browser_check']['vs'];
}
if(!empty($phpwcms['browser_check']['required'])) {
$buoop['required'] = '{' . trim($phpwcms['browser_check']['required'], '{}') . '}';
}
?>
var $buoop = <?php echo json_encode($buoop); ?>;
</script><script src="https://browser-update.org/update.min.js"><?php endif; ?></script>
</body>
</html>
2 changes: 1 addition & 1 deletion setup/inc/setup.func.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ function write_conf_file($val) {
$conf_file .= "\$phpwcms['im_fix_colorspace'] = 'RGB'; // newer ImageMagick installs tend to have problems with colorspace setting, if colors are look bad try SRGB\n";
$conf_file .= "\$phpwcms['wkhtmltopdf_path'] = ''; // used for generating PDF, use full path including application name '/usr/bin/wkhtmltopdf'\n";
$conf_file .= "\$phpwcms['render_clean_html'] = 0; // clean up HTML source a bit, experimental can have unexpected side effects\n";
$conf_file .= "\$phpwcms['browser_check'] = array('fe'=>false, 'be'=>true, 'vs' => ''); // enable Browser Update check in frontend and/or backend, use 'vs' to which browser version, see http://www.browser-update.org/index.html#install\n";
$conf_file .= "\$phpwcms['browser_check'] = array('fe' => false, 'be' => false, 'vs' => '', 'insecure' => true, 'required' => ''); // enable Browser Update check in frontend and/or backend, use 'vs' to which browser version, see http://www.browser-update.org/index.html#install\n";
$conf_file .= "\$phpwcms['usergroup_support'] = false; // set true or false to support/disable this feature, is experimental\n";
$conf_file .= "\$phpwcms['force301_id2alias'] = false; // send 301 HTTP Redirect when article/structure has alias but ID is given\n";
$conf_file .= "\$phpwcms['force301_2struct'] = false; // send 301 HTTP Redirect to structure level when only 1 article is inside\n";
Expand Down
2 changes: 1 addition & 1 deletion setup/setup.conf.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
$phpwcms['im_fix_colorspace'] = 'RGB'; // newer ImageMagick installs tend to have problems with colorspace setting, if colors are look bad try SRGB
$phpwcms['wkhtmltopdf_path'] = ''; // used for generating PDF, use full path including application name '/usr/bin/wkhtmltopdf'
$phpwcms['render_clean_html'] = 0; // clean up HTML source a bit, experimental can have unexpected side effects
$phpwcms['browser_check'] = array('fe'=>false, 'be'=>true, 'vs' => ''); // enable Browser Update check in frontend and/or backend, use "vs" to which browser version, see http://www.browser-update.org/index.html#install
$phpwcms['browser_check'] = array('fe' => false, 'be' => false, 'vs' => '', 'insecure' => true, 'required' => ''); // enable Browser Update check in frontend and/or backend, use "vs" to which browser version, see http://www.browser-update.org/index.html#install
$phpwcms['usergroup_support'] = false; // set true or false to support/disable this feature, is experimental
$phpwcms['force301_id2alias'] = false; // send 301 HTTP Redirect when article/structure has alias but ID is given
$phpwcms['force301_2struct'] = false; // send 301 HTTP Redirect to structure level when only 1 article is inside
Expand Down

0 comments on commit a30bfef

Please sign in to comment.