Skip to content

Commit 2fb669c

Browse files
committed
all DIRECTORY_SEPARATPR changed to forward slash
1 parent efc855d commit 2fb669c

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/controllers/LfmController.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct()
4848
*/
4949
public function show()
5050
{
51-
$working_dir = DIRECTORY_SEPARATOR;
51+
$working_dir = '/';
5252
$working_dir .= (Config::get('lfm.allow_multi_user')) ? \Auth::user()->user_field : Config::get('lfm.shared_folder_name');
5353

5454
return view('laravel-filemanager::index')
@@ -87,23 +87,23 @@ private function formatLocation($location, $type = null, $get_thumb = false)
8787
$working_dir = Input::get('working_dir');
8888

8989
// remove first slash
90-
if (substr($working_dir, 0, 1) === DIRECTORY_SEPARATOR) {
90+
if (substr($working_dir, 0, 1) === '/') {
9191
$working_dir = substr($working_dir, 1);
9292
}
9393

9494

9595
$location .= $working_dir;
9696

9797
if ($type === 'directory' || $type === 'thumb') {
98-
$location .= DIRECTORY_SEPARATOR;
98+
$location .= '/';
9999
}
100100

101101
//if user is inside thumbs folder there is no need
102102
// to add thumbs substring to the end of $location
103103
$in_thumb_folder = preg_match('/'.Config::get('lfm.thumb_folder_name').'$/i',$working_dir);
104104

105105
if ($type === 'thumb' && !$in_thumb_folder) {
106-
$location .= Config::get('lfm.thumb_folder_name') . DIRECTORY_SEPARATOR;
106+
$location .= Config::get('lfm.thumb_folder_name') . '/';
107107
}
108108

109109
return $location;
@@ -117,7 +117,7 @@ private function formatLocation($location, $type = null, $get_thumb = false)
117117

118118
public function getPath($type = null, $get_thumb = false)
119119
{
120-
$path = base_path() . DIRECTORY_SEPARATOR . $this->file_location;
120+
$path = base_path() . '/' . $this->file_location;
121121

122122
$path = $this->formatLocation($path, $type);
123123

@@ -164,7 +164,7 @@ public function getFileName($file)
164164

165165
$arr_dir = explode('/', $lfm_file_path);
166166
$arr_filename['short'] = end($arr_dir);
167-
$arr_filename['long'] = DIRECTORY_SEPARATOR . $lfm_file_path;
167+
$arr_filename['long'] = '/' . $lfm_file_path;
168168

169169
return $arr_filename;
170170
}

src/controllers/UploadController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private function makeThumb($dest_path, $new_filename)
119119

120120
$thumb_img = Image::make($dest_path . $new_filename);
121121
$thumb_img->fit(200, 200)
122-
->save($dest_path . $thumb_folder_name . DIRECTORY_SEPARATOR . $new_filename);
122+
->save($dest_path . $thumb_folder_name . '/' . $new_filename);
123123
unset($thumb_img);
124124
}
125125

src/middleware/MultiUser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public function handle($request, Closure $next)
1212
$slug = \Config::get('lfm.user_field');
1313

1414
\Auth::user()->user_field = \Auth::user()->$slug;
15-
$new_working_dir = DIRECTORY_SEPARATOR . \Auth::user()->user_field;
15+
$new_working_dir = '/' . \Auth::user()->user_field;
1616

1717
$previous_dir = $request->input('working_dir');
1818

@@ -28,11 +28,11 @@ public function handle($request, Closure $next)
2828

2929
private function validDir($previous_dir)
3030
{
31-
if (starts_with($previous_dir, DIRECTORY_SEPARATOR . \Config::get('lfm.shared_folder_name'))) {
31+
if (starts_with($previous_dir, '/' . \Config::get('lfm.shared_folder_name'))) {
3232
return true;
3333
}
3434

35-
if (starts_with($previous_dir, DIRECTORY_SEPARATOR . (string)\Auth::user()->user_field)) {
35+
if (starts_with($previous_dir, '/' . (string)\Auth::user()->user_field)) {
3636
return true;
3737
}
3838

src/views/script.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
var ds = "{{ addslashes(DIRECTORY_SEPARATOR) }}";
2+
var ds = '/';
33
var home_dir = ds + "{{ (Config::get('lfm.allow_multi_user')) ? Auth::user()->user_field : '' }}";
44
var shared_folder = ds + "{{ Config::get('lfm.shared_folder_name') }}";
55
var image_url = "{{ Config::get('lfm.images_url') }}";

0 commit comments

Comments
 (0)