Skip to content

Commit

Permalink
Fix #442 v1.8.2 lfm.url_prefix backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
youchenlee committed Oct 17, 2017
1 parent a6273a8 commit d214e13
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/controllers/RedirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RedirectController extends LfmController

public function __construct()
{
$delimiter = config('lfm.url_prefix') . '/';
$delimiter = config('lfm.url_prefix', config('lfm.prefix')). '/';
$url = urldecode(request()->url());
$external_path = substr($url, strpos($url, $delimiter) + strlen($delimiter));

Expand Down
2 changes: 1 addition & 1 deletion src/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'\Unisharp\Laravelfilemanager\middlewares\MultiUser',
'\Unisharp\Laravelfilemanager\middlewares\CreateDefaultFolder',
]);
$prefix = \Config::get('lfm.url_prefix', 'laravel-filemanager');
$prefix = \Config::get('lfm.url_prefix', \Config::get('lfm.prefix', 'laravel-filemanager'));
$as = 'unisharp.lfm.';
$namespace = '\Unisharp\Laravelfilemanager\controllers';

Expand Down
2 changes: 1 addition & 1 deletion src/traits/LfmHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function getPathPrefix($type)
}

if ($type === 'url' && $base_directory !== 'public') {
$prefix = config('lfm.url_prefix', 'laravel-filemanager') . '/' . $prefix;
$prefix = config('lfm.url_prefix', config('lfm.prefix', 'laravel-filemanager')) . '/' . $prefix;
}

return $prefix;
Expand Down
2 changes: 1 addition & 1 deletion src/views/demo.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script>
var route_prefix = "{{ url(config('lfm.url_prefix')) }}";
var route_prefix = "{{ url(config('lfm.url_prefix', config('lfm.prefix'))) }}";
</script>

<!-- CKEditor init -->
Expand Down
2 changes: 1 addition & 1 deletion src/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<script src="{{ asset('vendor/laravel-filemanager/js/dropzone.min.js') }}"></script>
<script>
var route_prefix = "{{ url('/') }}";
var lfm_route = "{{ url(config('lfm.url_prefix')) }}";
var lfm_route = "{{ url(config('lfm.url_prefix', config('lfm.prefix'))) }}";
var lang = {!! json_encode(trans('laravel-filemanager::lfm')) !!};
</script>
<script>{!! \File::get(base_path('vendor/unisharp/laravel-filemanager/public/js/script.js')) !!}</script>
Expand Down

0 comments on commit d214e13

Please sign in to comment.