diff --git a/Changelog b/Changelog
index d165f4527..128df3afa 100755
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,5 @@
+2019-12-08 DariusIII
+ * Chg: Replace WWW_TOP with url() helper
2019-12-03 DariusIII
* Chg: Change the name of users table migration
2019-12-01 DariusIII
diff --git a/app/Extensions/helper/helpers.php b/app/Extensions/helper/helpers.php
index f1a16f589..f2723d547 100644
--- a/app/Extensions/helper/helpers.php
+++ b/app/Extensions/helper/helpers.php
@@ -78,7 +78,7 @@ if (! function_exists('makeFieldLinks')) {
if ($i > 7) {
break;
}
- $newArr[] = ''.$ta.'';
+ $newArr[] = ''.$ta.'';
$i++;
}
diff --git a/app/Http/Controllers/Admin/ShowsController.php b/app/Http/Controllers/Admin/ShowsController.php
index 439973d63..3f790d822 100644
--- a/app/Http/Controllers/Admin/ShowsController.php
+++ b/app/Http/Controllers/Admin/ShowsController.php
@@ -48,7 +48,7 @@ class ShowsController extends BasePageController
exit;
}
- header('Location:'.WWW_TOP.'admin/show-list');
+ header('Location:'.url('admin/show-list'));
break;
case 'view':
diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php
index b6aaf8edd..17cd3c3cd 100644
--- a/app/Http/Controllers/Admin/UserController.php
+++ b/app/Http/Controllers/Admin/UserController.php
@@ -66,7 +66,7 @@ class UserController extends BasePageController
);
foreach ($ordering as $orderType) {
- $this->smarty->assign('orderby'.$orderType, WWW_TOP.'user-list?ob='.$orderType);
+ $this->smarty->assign('orderby'.$orderType, url('admin/user-list?ob='.$orderType));
}
$content = $this->smarty->fetch('user-list.tpl');
diff --git a/app/Http/Controllers/AdultController.php b/app/Http/Controllers/AdultController.php
index e8deb66f1..d39e5b857 100644
--- a/app/Http/Controllers/AdultController.php
+++ b/app/Http/Controllers/AdultController.php
@@ -88,7 +88,7 @@ class AdultController extends BasePageController
}
foreach ($ordering as $ordertype) {
- $this->smarty->assign('orderby'.$ordertype, WWW_TOP.'/xxx?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0');
+ $this->smarty->assign('orderby'.$ordertype, url('/xxx?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'));
}
$this->smarty->assign(
diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php
index 4feba25ad..914b8e628 100644
--- a/app/Http/Controllers/Api/ApiController.php
+++ b/app/Http/Controllers/Api/ApiController.php
@@ -267,7 +267,7 @@ class ApiController extends BasePageController
UserRequest::addApiRequest($apiKey, $request->getRequestUri());
$relData = Release::checkGuidForApi($request->input('id'));
if ($relData) {
- return redirect(WWW_TOP.'/getnzb?r='.$apiKey.'&id='.$request->input('id').(($request->has('del') && $request->input('del') === '1') ? '&del=1' : ''));
+ return redirect(url('/getnzb?r='.$apiKey.'&id='.$request->input('id').(($request->has('del') && $request->input('del') === '1') ? '&del=1' : '')));
}
Utility::showApiError(300, 'No such item (the guid you provided has no release in our database)');
diff --git a/app/Http/Controllers/BooksController.php b/app/Http/Controllers/BooksController.php
index 5dae13b68..5f7f86ff6 100644
--- a/app/Http/Controllers/BooksController.php
+++ b/app/Http/Controllers/BooksController.php
@@ -87,7 +87,7 @@ class BooksController extends BasePageController
}
foreach ($ordering as $ordertype) {
- $this->smarty->assign('orderby'.$ordertype, WWW_TOP.'/books?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0');
+ $this->smarty->assign('orderby'.$ordertype, url('/books?t='.$category.$browseby_link.'&ob='.$ordertype.'&offset=0'));
}
$this->smarty->assign(
diff --git a/app/Http/Controllers/MyMoviesController.php b/app/Http/Controllers/MyMoviesController.php
index c134636c8..20bd76de6 100644
--- a/app/Http/Controllers/MyMoviesController.php
+++ b/app/Http/Controllers/MyMoviesController.php
@@ -26,9 +26,9 @@ class MyMoviesController extends BasePageController
$imdbid = $request->input('imdb') ?? '';
if ($request->has('from')) {
- $this->smarty->assign('from', WWW_TOP.$request->input('from'));
+ $this->smarty->assign('from', url($request->input('from')));
} else {
- $this->smarty->assign('from', WWW_TOP.'/mymovies');
+ $this->smarty->assign('from', url('/mymovies'));
}
switch ($action) {
@@ -39,7 +39,7 @@ class MyMoviesController extends BasePageController
}
UserMovie::delMovie($this->userdata->id, $imdbid);
if ($request->has('from')) {
- header('Location:'.WWW_TOP.$request->input('from'));
+ header('Location:'.url($request->input('from')));
} else {
return redirect('/mymovies');
}
@@ -157,7 +157,7 @@ class MyMoviesController extends BasePageController
$this->smarty->assign('covgroup', '');
foreach ($ordering as $ordertype) {
- $this->smarty->assign('orderby'.$ordertype, WWW_TOP.'/mymovies/browse?ob='.$ordertype.'&offset=0');
+ $this->smarty->assign('orderby'.$ordertype, url('/mymovies/browse?ob='.$ordertype.'&offset=0'));
}
$this->smarty->assign('lastvisit', $this->userdata->lastlogin);
diff --git a/app/Http/Controllers/MyShowsController.php b/app/Http/Controllers/MyShowsController.php
index 69428fa8f..12bf10bc6 100644
--- a/app/Http/Controllers/MyShowsController.php
+++ b/app/Http/Controllers/MyShowsController.php
@@ -23,9 +23,9 @@ class MyShowsController extends BasePageController
$videoId = $request->input('id') ?? '';
if ($request->has('from')) {
- $this->smarty->assign('from', WWW_TOP.$request->input('from'));
+ $this->smarty->assign('from', url($request->input('from')));
} else {
- $this->smarty->assign('from', WWW_TOP.'/myshows');
+ $this->smarty->assign('from', url('/myshows'));
}
switch ($action) {
@@ -37,7 +37,7 @@ class MyShowsController extends BasePageController
UserSerie::delShow($this->userdata->id, $videoId);
if ($request->has('from')) {
- header('Location:'.WWW_TOP.$request->input('from'));
+ header('Location:'.url($request->input('from')));
} else {
return redirect('myshows');
}
@@ -191,7 +191,7 @@ class MyShowsController extends BasePageController
$this->smarty->assign('covgroup', '');
foreach ($ordering as $ordertype) {
- $this->smarty->assign('orderby'.$ordertype, WWW_TOP.'/myshows/browse?ob='.$ordertype.'&offset=0');
+ $this->smarty->assign('orderby'.$ordertype, url('/myshows/browse?ob='.$ordertype.'&offset=0'));
}
$this->smarty->assign('lastvisit', $this->userdata->lastlogin);
diff --git a/app/Http/Controllers/SearchController.php b/app/Http/Controllers/SearchController.php
index 9b7806cf0..bfff7b5b8 100644
--- a/app/Http/Controllers/SearchController.php
+++ b/app/Http/Controllers/SearchController.php
@@ -61,8 +61,7 @@ class SearchController extends BasePageController
foreach ($releases->getBrowseOrdering() as $orderType) {
$this->smarty->assign(
'orderby'.$orderType,
- WWW_TOP.'/search?id='.htmlentities($searchString['searchname'], ENT_QUOTES | ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType
- );
+ url('/search?id='.htmlentities($searchString['searchname'], ENT_QUOTES | ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType));
}
$tags = [];