Skip to content

Commit

Permalink
Fix script error when output is compressed
Browse files Browse the repository at this point in the history
Fix redirect to /adminpass for Nginx ($_SEVER['PATH_INFO'] is not set in every case)
  • Loading branch information
K-Ko committed Feb 8, 2014
1 parent baead2f commit 95ead51
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
2.4.0
2.4.1
2014-02-08
22 changes: 11 additions & 11 deletions frontend/View/Index/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ var xAxisResolution = {
y: 60 * 60 * 24 * 360
};

var lastChanged = (new Date).getTime() / 1000 / 60
var lastChanged = (new Date).getTime() / 1000 / 60,
inUpdate = false;

/**
Expand Down Expand Up @@ -764,16 +764,6 @@ $(function() {
*/
qs = $.parseQueryString();

view = new View();

view.fetch($('#top-load-view'), function(el) {
el.find('option').clone().appendTo('#loaddeleteview');
$('#top-select').toggle(!!user);
/* Chart slug provided by URL, load and collapse tree */
view.slug = qs.chart;
view.load(true);
});

options.chart.height = qs.ChartHeight || ChartHeight;

$(window).resize(function() {
Expand Down Expand Up @@ -1130,6 +1120,16 @@ $(function() {
shortcut.add('F6', function() { updateChart(); });
shortcut.add('F7', function() { updateChart(true); });

view = new View();

view.fetch($('#top-load-view'), function(el) {
el.find('option').clone().appendTo('#loaddeleteview');
$('#top-select').toggle(!!user);
/* Chart slug provided by URL, load and collapse tree */
view.slug = qs.chart;
view.load(true);
});

});

</script>
2 changes: 1 addition & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function _redirect( $route ) {
}

if ($config->get('Admin.User') == '' AND
isset($_SERVER['PATH_INFO']) AND $_SERVER['PATH_INFO'] != '/adminpass') {
(!isset($_SERVER['REQUEST_URI']) OR strpos($_SERVER['REQUEST_URI'], '/adminpass') === FALSE)) {
_redirect('adminpass');
}

Expand Down

0 comments on commit 95ead51

Please sign in to comment.