From 0eab5b3777ddaac2543615a04e9be0e052186ee8 Mon Sep 17 00:00:00 2001 From: Marco Dickert Date: Mon, 24 Jul 2017 15:26:05 +0200 Subject: [PATCH] fix missing encoding for initial chdir --- build/libifm.php | 6 ++++-- ifm.php | 6 ++++-- src/ifm.js | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/build/libifm.php b/build/libifm.php index abdafd8..59cb5a9 100644 --- a/build/libifm.php +++ b/build/libifm.php @@ -1772,7 +1772,9 @@ function IFM( params ) { */ this.historyPopstateHandler = function(event) { var dir = ""; - if( event.state && event.state.dir ) dir = decodeURIComponent( event.state.dir ); + if( event.state && event.state.dir ) { + dir = event.state.dir; + } self.changeDirectory( dir, { pushState: false, absolute: true } ); }; @@ -2048,7 +2050,7 @@ function IFM( params ) { window.onpopstate = self.historyPopstateHandler; // load initial file table if( window.location.hash ) { - self.changeDirectory( window.location.hash.substring( 1 ) ); + self.changeDirectory( decodeURIComponent( window.location.hash.substring( 1 ) ) ); } else { this.refreshFileTable(); } diff --git a/ifm.php b/ifm.php index a1ec207..425e5aa 100644 --- a/ifm.php +++ b/ifm.php @@ -1772,7 +1772,9 @@ function IFM( params ) { */ this.historyPopstateHandler = function(event) { var dir = ""; - if( event.state && event.state.dir ) dir = decodeURIComponent( event.state.dir ); + if( event.state && event.state.dir ) { + dir = event.state.dir; + } self.changeDirectory( dir, { pushState: false, absolute: true } ); }; @@ -2048,7 +2050,7 @@ function IFM( params ) { window.onpopstate = self.historyPopstateHandler; // load initial file table if( window.location.hash ) { - self.changeDirectory( window.location.hash.substring( 1 ) ); + self.changeDirectory( decodeURIComponent( window.location.hash.substring( 1 ) ) ); } else { this.refreshFileTable(); } diff --git a/src/ifm.js b/src/ifm.js index 9a2e2e1..b8a7b17 100644 --- a/src/ifm.js +++ b/src/ifm.js @@ -1034,7 +1034,9 @@ function IFM( params ) { */ this.historyPopstateHandler = function(event) { var dir = ""; - if( event.state && event.state.dir ) dir = decodeURIComponent( event.state.dir ); + if( event.state && event.state.dir ) { + dir = event.state.dir; + } self.changeDirectory( dir, { pushState: false, absolute: true } ); }; @@ -1310,7 +1312,7 @@ function IFM( params ) { window.onpopstate = self.historyPopstateHandler; // load initial file table if( window.location.hash ) { - self.changeDirectory( window.location.hash.substring( 1 ) ); + self.changeDirectory( decodeURIComponent( window.location.hash.substring( 1 ) ) ); } else { this.refreshFileTable(); }