diff --git a/src/Core/Users/User.php b/src/Core/Users/User.php index 2265f45f4..da2a0aa19 100755 --- a/src/Core/Users/User.php +++ b/src/Core/Users/User.php @@ -306,7 +306,7 @@ class User extends Model { $urlGenerator = app('Flarum\Http\UrlGeneratorInterface'); - return $this->avatar_path ? $urlGenerator->toAsset('assets/avatars/'.$this->avatar_path) : null; + return $this->avatar_path ? $urlGenerator->toAsset('avatars/'.$this->avatar_path) : null; } /** diff --git a/src/Http/UrlGenerator.php b/src/Http/UrlGenerator.php index 22791adfb..6383df3d9 100644 --- a/src/Http/UrlGenerator.php +++ b/src/Http/UrlGenerator.php @@ -11,6 +11,8 @@ namespace Flarum\Http; +use Flarum\Core; + class UrlGenerator implements UrlGeneratorInterface { protected $routes; @@ -26,12 +28,11 @@ class UrlGenerator implements UrlGeneratorInterface $path = $this->routes->getPath($name, $parameters); $path = ltrim($path, '/'); - // TODO: Prepend real base URL - return "/$path"; + return Core::url() . "/$path"; } public function toAsset($path) { - return "/$path"; + return Core::url() . "/assets/$path"; } }