Merge pull request #1635 from ArthurHoaro/feature/phpcs
This commit is contained in:
commit
302662797c
95 changed files with 480 additions and 386 deletions
application/front
ShaarliMiddleware.php
controller
admin
ConfigureController.phpExportController.phpImportController.phpManageTagController.phpPasswordController.phpPluginsController.phpServerController.phpSessionFilterController.phpShaareAddController.phpShaareManageController.phpShaarePublishController.phpThumbnailsController.phpToolsController.php
visitor
|
@ -42,7 +42,8 @@ class ShaarliMiddleware
|
|||
$this->initBasePath($request);
|
||||
|
||||
try {
|
||||
if (!is_file($this->container->conf->getConfigFileExt())
|
||||
if (
|
||||
!is_file($this->container->conf->getConfigFileExt())
|
||||
&& !in_array($next->getName(), ['displayInstall', 'saveInstall'], true)
|
||||
) {
|
||||
return $response->withRedirect($this->container->basePath . '/install');
|
||||
|
@ -86,7 +87,8 @@ class ShaarliMiddleware
|
|||
*/
|
||||
protected function checkOpenShaarli(Request $request, Response $response, callable $next): bool
|
||||
{
|
||||
if (// if the user isn't logged in
|
||||
if (
|
||||
// if the user isn't logged in
|
||||
!$this->container->loginManager->isLoggedIn()
|
||||
// and Shaarli doesn't have public content...
|
||||
&& $this->container->conf->get('privacy.hide_public_links')
|
||||
|
|
|
@ -51,7 +51,10 @@ class ConfigureController extends ShaarliAdminController
|
|||
$this->assignView('languages', Languages::getAvailableLanguages());
|
||||
$this->assignView('gd_enabled', extension_loaded('gd'));
|
||||
$this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE));
|
||||
$this->assignView('pagetitle', t('Configure') .' - '. $this->container->conf->get('general.title', 'Shaarli'));
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
t('Configure') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
|
||||
return $response->write($this->render(TemplatePage::CONFIGURE));
|
||||
}
|
||||
|
@ -95,12 +98,15 @@ class ConfigureController extends ShaarliAdminController
|
|||
}
|
||||
|
||||
$thumbnailsMode = extension_loaded('gd') ? $request->getParam('enableThumbnails') : Thumbnailer::MODE_NONE;
|
||||
if ($thumbnailsMode !== Thumbnailer::MODE_NONE
|
||||
if (
|
||||
$thumbnailsMode !== Thumbnailer::MODE_NONE
|
||||
&& $thumbnailsMode !== $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE)
|
||||
) {
|
||||
$this->saveWarningMessage(
|
||||
t('You have enabled or changed thumbnails mode.') .
|
||||
'<a href="'. $this->container->basePath .'/admin/thumbnails">' . t('Please synchronize them.') .'</a>'
|
||||
'<a href="' . $this->container->basePath . '/admin/thumbnails">' .
|
||||
t('Please synchronize them.') .
|
||||
'</a>'
|
||||
);
|
||||
}
|
||||
$this->container->conf->set('thumbnails.mode', $thumbnailsMode);
|
||||
|
|
|
@ -23,7 +23,7 @@ class ExportController extends ShaarliAdminController
|
|||
*/
|
||||
public function index(Request $request, Response $response): Response
|
||||
{
|
||||
$this->assignView('pagetitle', t('Export') .' - '. $this->container->conf->get('general.title', 'Shaarli'));
|
||||
$this->assignView('pagetitle', t('Export') . ' - ' . $this->container->conf->get('general.title', 'Shaarli'));
|
||||
|
||||
return $response->write($this->render(TemplatePage::EXPORT));
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class ExportController extends ShaarliAdminController
|
|||
$response = $response->withHeader('Content-Type', 'text/html; charset=utf-8');
|
||||
$response = $response->withHeader(
|
||||
'Content-disposition',
|
||||
'attachment; filename=bookmarks_'.$selection.'_'.$now->format(Bookmark::LINK_DATE_FORMAT).'.html'
|
||||
'attachment; filename=bookmarks_' . $selection . '_' . $now->format(Bookmark::LINK_DATE_FORMAT) . '.html'
|
||||
);
|
||||
|
||||
$this->assignView('date', $now->format(DateTime::RFC822));
|
||||
|
|
|
@ -38,7 +38,7 @@ class ImportController extends ShaarliAdminController
|
|||
true
|
||||
)
|
||||
);
|
||||
$this->assignView('pagetitle', t('Import') .' - '. $this->container->conf->get('general.title', 'Shaarli'));
|
||||
$this->assignView('pagetitle', t('Import') . ' - ' . $this->container->conf->get('general.title', 'Shaarli'));
|
||||
|
||||
return $response->write($this->render(TemplatePage::IMPORT));
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ class ImportController extends ShaarliAdminController
|
|||
$msg = sprintf(
|
||||
t(
|
||||
'The file you are trying to upload is probably bigger than what this webserver can accept'
|
||||
.' (%s). Please upload in smaller chunks.'
|
||||
. ' (%s). Please upload in smaller chunks.'
|
||||
),
|
||||
get_max_upload_size(ini_get('post_max_size'), ini_get('upload_max_filesize'))
|
||||
);
|
||||
|
|
|
@ -32,7 +32,7 @@ class ManageTagController extends ShaarliAdminController
|
|||
$this->assignView('tags_separator', $separator);
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
t('Manage tags') .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
t('Manage tags') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
|
||||
return $response->write($this->render(TemplatePage::CHANGE_TAG));
|
||||
|
@ -87,7 +87,7 @@ class ManageTagController extends ShaarliAdminController
|
|||
|
||||
$this->saveSuccessMessage($alert);
|
||||
|
||||
$redirect = true === $isDelete ? '/admin/tags' : '/?searchtags='. urlencode($toTag);
|
||||
$redirect = true === $isDelete ? '/admin/tags' : '/?searchtags=' . urlencode($toTag);
|
||||
|
||||
return $this->redirect($response, $redirect);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class PasswordController extends ShaarliAdminController
|
|||
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
t('Change password') .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
t('Change password') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ class PasswordController extends ShaarliAdminController
|
|||
|
||||
// Save new password
|
||||
// Salt renders rainbow-tables attacks useless.
|
||||
$this->container->conf->set('credentials.salt', sha1(uniqid('', true) .'_'. mt_rand()));
|
||||
$this->container->conf->set('credentials.salt', sha1(uniqid('', true) . '_' . mt_rand()));
|
||||
$this->container->conf->set(
|
||||
'credentials.hash',
|
||||
sha1(
|
||||
|
|
|
@ -42,7 +42,7 @@ class PluginsController extends ShaarliAdminController
|
|||
$this->assignView('disabledPlugins', $disabledPlugins);
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
t('Plugin Administration') .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
t('Plugin Administration') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
|
||||
return $response->write($this->render(TemplatePage::PLUGINS_ADMIN));
|
||||
|
@ -64,7 +64,7 @@ class PluginsController extends ShaarliAdminController
|
|||
unset($parameters['parameters_form']);
|
||||
unset($parameters['token']);
|
||||
foreach ($parameters as $param => $value) {
|
||||
$this->container->conf->set('plugins.'. $param, escape($value));
|
||||
$this->container->conf->set('plugins.' . $param, escape($value));
|
||||
}
|
||||
} else {
|
||||
$this->container->conf->set('general.enabled_plugins', save_plugin_config($parameters));
|
||||
|
|
|
@ -72,7 +72,9 @@ class ServerController extends ShaarliAdminController
|
|||
|
||||
$this->saveWarningMessage(
|
||||
t('Thumbnails cache has been cleared.') . ' ' .
|
||||
'<a href="'. $this->container->basePath .'/admin/thumbnails">' . t('Please synchronize them.') .'</a>'
|
||||
'<a href="' . $this->container->basePath . '/admin/thumbnails">' .
|
||||
t('Please synchronize them.') .
|
||||
'</a>'
|
||||
);
|
||||
} else {
|
||||
$folders = [
|
||||
|
|
|
@ -45,6 +45,4 @@ class SessionFilterController extends ShaarliAdminController
|
|||
|
||||
return $this->redirectFromReferer($request, $response, ['visibility']);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ class ShaareAddController extends ShaarliAdminController
|
|||
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
t('Shaare a new link') .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
t('Shaare a new link') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
$this->assignView('tags', $tags);
|
||||
$this->assignView('default_private_links', $this->container->conf->get('privacy.default_private_links', false));
|
||||
|
|
|
@ -54,7 +54,7 @@ class ShaareManageController extends ShaarliAdminController
|
|||
$data = $formatter->format($bookmark);
|
||||
$this->executePageHooks('delete_link', $data);
|
||||
$this->container->bookmarkService->remove($bookmark, false);
|
||||
++ $count;
|
||||
++$count;
|
||||
}
|
||||
|
||||
if ($count > 0) {
|
||||
|
|
|
@ -118,7 +118,8 @@ class ShaarePublishController extends ShaarliAdminController
|
|||
$this->container->conf->get('general.tags_separator', ' ')
|
||||
);
|
||||
|
||||
if ($this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
|
||||
if (
|
||||
$this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
|
||||
&& true !== $this->container->conf->get('general.enable_async_metadata', true)
|
||||
&& $bookmark->shouldUpdateThumbnail()
|
||||
) {
|
||||
|
@ -148,7 +149,8 @@ class ShaarePublishController extends ShaarliAdminController
|
|||
return $this->redirectFromReferer(
|
||||
$request,
|
||||
$response,
|
||||
['/admin/add-shaare', '/admin/shaare'], ['addlink', 'post', 'edit_link'],
|
||||
['/admin/add-shaare', '/admin/shaare'],
|
||||
['addlink', 'post', 'edit_link'],
|
||||
$bookmark->getShortUrl()
|
||||
);
|
||||
}
|
||||
|
@ -168,10 +170,10 @@ class ShaarePublishController extends ShaarliAdminController
|
|||
$this->assignView($key, $value);
|
||||
}
|
||||
|
||||
$editLabel = false === $isNew ? t('Edit') .' ' : '';
|
||||
$editLabel = false === $isNew ? t('Edit') . ' ' : '';
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
$editLabel . t('Shaare') .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
$editLabel . t('Shaare') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
|
||||
return $response->write($this->render(TemplatePage::EDIT_LINK));
|
||||
|
@ -194,7 +196,8 @@ class ShaarePublishController extends ShaarliAdminController
|
|||
|
||||
// If this is an HTTP(S) link, we try go get the page to extract
|
||||
// the title (otherwise we will to straight to the edit form.)
|
||||
if (true !== $this->container->conf->get('general.enable_async_metadata', true)
|
||||
if (
|
||||
true !== $this->container->conf->get('general.enable_async_metadata', true)
|
||||
&& empty($title)
|
||||
&& strpos(get_url_scheme($url) ?: '', 'http') !== false
|
||||
) {
|
||||
|
|
|
@ -34,7 +34,7 @@ class ThumbnailsController extends ShaarliAdminController
|
|||
$this->assignView('ids', $ids);
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
t('Thumbnails update') .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
t('Thumbnails update') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
|
||||
return $response->write($this->render(TemplatePage::THUMBNAILS));
|
||||
|
|
|
@ -28,7 +28,7 @@ class ToolsController extends ShaarliAdminController
|
|||
$this->assignView($key, $value);
|
||||
}
|
||||
|
||||
$this->assignView('pagetitle', t('Tools') .' - '. $this->container->conf->get('general.title', 'Shaarli'));
|
||||
$this->assignView('pagetitle', t('Tools') . ' - ' . $this->container->conf->get('general.title', 'Shaarli'));
|
||||
|
||||
return $response->write($this->render(TemplatePage::TOOLS));
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ class BookmarkListController extends ShaarliVisitorController
|
|||
$formatter->addContextData('base_path', $this->container->basePath);
|
||||
|
||||
$searchTags = normalize_spaces($request->getParam('searchtags') ?? '');
|
||||
$searchTerm = escape(normalize_spaces($request->getParam('searchterm') ?? ''));;
|
||||
$searchTerm = escape(normalize_spaces($request->getParam('searchterm') ?? ''));
|
||||
;
|
||||
|
||||
// Filter bookmarks according search parameters.
|
||||
$visibility = $this->container->sessionManager->getSessionParameter('visibility');
|
||||
|
@ -160,7 +161,7 @@ class BookmarkListController extends ShaarliVisitorController
|
|||
$data = array_merge(
|
||||
$this->initializeTemplateVars(),
|
||||
[
|
||||
'pagetitle' => $bookmark->getTitle() .' - '. $this->container->conf->get('general.title', 'Shaarli'),
|
||||
'pagetitle' => $bookmark->getTitle() . ' - ' . $this->container->conf->get('general.title', 'Shaarli'),
|
||||
'links' => [$formatter->format($bookmark)],
|
||||
]
|
||||
);
|
||||
|
@ -185,7 +186,8 @@ class BookmarkListController extends ShaarliVisitorController
|
|||
$bookmark->setThumbnail(null);
|
||||
|
||||
// Requires an update, not async retrieval, thumbnails enabled
|
||||
if ($bookmark->shouldUpdateThumbnail()
|
||||
if (
|
||||
$bookmark->shouldUpdateThumbnail()
|
||||
&& true !== $this->container->conf->get('general.enable_async_metadata', true)
|
||||
&& $this->container->conf->get('thumbnails.mode', Thumbnailer::MODE_NONE) !== Thumbnailer::MODE_NONE
|
||||
) {
|
||||
|
|
|
@ -132,7 +132,7 @@ class DailyController extends ShaarliVisitorController
|
|||
'date' => $endDateTime,
|
||||
'date_rss' => $endDateTime->format(DateTime::RSS),
|
||||
'date_human' => DailyPageHelper::getDescriptionByType($type, $dayDateTime),
|
||||
'absolute_url' => $indexUrl . 'daily?'. $type .'=' . $day,
|
||||
'absolute_url' => $indexUrl . 'daily?' . $type . '=' . $day,
|
||||
'links' => [],
|
||||
];
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class FeedController extends ShaarliVisitorController
|
|||
|
||||
protected function processRequest(string $feedType, Request $request, Response $response): Response
|
||||
{
|
||||
$response = $response->withHeader('Content-Type', 'application/'. $feedType .'+xml; charset=utf-8');
|
||||
$response = $response->withHeader('Content-Type', 'application/' . $feedType . '+xml; charset=utf-8');
|
||||
|
||||
$pageUrl = page_url($this->container->environment);
|
||||
$cache = $this->container->pageCacheManager->getCachePage($pageUrl);
|
||||
|
|
|
@ -39,7 +39,8 @@ class InstallController extends ShaarliVisitorController
|
|||
// Before installation, we'll make sure that permissions are set properly, and sessions are working.
|
||||
$this->checkPermissions();
|
||||
|
||||
if (static::SESSION_TEST_VALUE
|
||||
if (
|
||||
static::SESSION_TEST_VALUE
|
||||
!== $this->container->sessionManager->getSessionParameter(static::SESSION_TEST_KEY)
|
||||
) {
|
||||
$this->container->sessionManager->setSessionParameter(static::SESSION_TEST_KEY, static::SESSION_TEST_VALUE);
|
||||
|
@ -75,17 +76,18 @@ class InstallController extends ShaarliVisitorController
|
|||
// This part makes sure sessions works correctly.
|
||||
// (Because on some hosts, session.save_path may not be set correctly,
|
||||
// or we may not have write access to it.)
|
||||
if (static::SESSION_TEST_VALUE
|
||||
if (
|
||||
static::SESSION_TEST_VALUE
|
||||
!== $this->container->sessionManager->getSessionParameter(static::SESSION_TEST_KEY)
|
||||
) {
|
||||
// Step 2: Check if data in session is correct.
|
||||
$msg = t(
|
||||
'<pre>Sessions do not seem to work correctly on your server.<br>'.
|
||||
'Make sure the variable "session.save_path" is set correctly in your PHP config, '.
|
||||
'and that you have write access to it.<br>'.
|
||||
'It currently points to %s.<br>'.
|
||||
'On some browsers, accessing your server via a hostname like \'localhost\' '.
|
||||
'or any custom hostname without a dot causes cookie storage to fail. '.
|
||||
'<pre>Sessions do not seem to work correctly on your server.<br>' .
|
||||
'Make sure the variable "session.save_path" is set correctly in your PHP config, ' .
|
||||
'and that you have write access to it.<br>' .
|
||||
'It currently points to %s.<br>' .
|
||||
'On some browsers, accessing your server via a hostname like \'localhost\' ' .
|
||||
'or any custom hostname without a dot causes cookie storage to fail. ' .
|
||||
'We recommend accessing your server via it\'s IP address or Fully Qualified Domain Name.<br>'
|
||||
);
|
||||
$msg = sprintf($msg, $this->container->sessionManager->getSavePath());
|
||||
|
@ -104,7 +106,8 @@ class InstallController extends ShaarliVisitorController
|
|||
public function save(Request $request, Response $response): Response
|
||||
{
|
||||
$timezone = 'UTC';
|
||||
if (!empty($request->getParam('continent'))
|
||||
if (
|
||||
!empty($request->getParam('continent'))
|
||||
&& !empty($request->getParam('city'))
|
||||
&& isTimeZoneValid($request->getParam('continent'), $request->getParam('city'))
|
||||
) {
|
||||
|
@ -114,7 +117,7 @@ class InstallController extends ShaarliVisitorController
|
|||
|
||||
$login = $request->getParam('setlogin');
|
||||
$this->container->conf->set('credentials.login', $login);
|
||||
$salt = sha1(uniqid('', true) .'_'. mt_rand());
|
||||
$salt = sha1(uniqid('', true) . '_' . mt_rand());
|
||||
$this->container->conf->set('credentials.salt', $salt);
|
||||
$this->container->conf->set('credentials.hash', sha1($request->getParam('setpassword') . $login . $salt));
|
||||
|
||||
|
@ -123,7 +126,7 @@ class InstallController extends ShaarliVisitorController
|
|||
} else {
|
||||
$this->container->conf->set(
|
||||
'general.title',
|
||||
'Shared bookmarks on '.escape(index_url($this->container->environment))
|
||||
'Shared bookmarks on ' . escape(index_url($this->container->environment))
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ class LoginController extends ShaarliVisitorController
|
|||
$this
|
||||
->assignView('returnurl', escape($returnUrl))
|
||||
->assignView('remember_user_default', $this->container->conf->get('privacy.remember_user_default', true))
|
||||
->assignView('pagetitle', t('Login') .' - '. $this->container->conf->get('general.title', 'Shaarli'))
|
||||
->assignView('pagetitle', t('Login') . ' - ' . $this->container->conf->get('general.title', 'Shaarli'))
|
||||
;
|
||||
|
||||
return $response->write($this->render(TemplatePage::LOGIN));
|
||||
|
@ -64,7 +64,8 @@ class LoginController extends ShaarliVisitorController
|
|||
return $this->redirect($response, '/');
|
||||
}
|
||||
|
||||
if (!$this->container->loginManager->checkCredentials(
|
||||
if (
|
||||
!$this->container->loginManager->checkCredentials(
|
||||
client_ip_id($this->container->environment),
|
||||
$request->getParam('login'),
|
||||
$request->getParam('password')
|
||||
|
@ -101,7 +102,8 @@ class LoginController extends ShaarliVisitorController
|
|||
*/
|
||||
protected function checkLoginState(): bool
|
||||
{
|
||||
if ($this->container->loginManager->isLoggedIn()
|
||||
if (
|
||||
$this->container->loginManager->isLoggedIn()
|
||||
|| $this->container->conf->get('security.open_shaarli', false)
|
||||
) {
|
||||
throw new CantLoginException();
|
||||
|
|
|
@ -26,7 +26,7 @@ class PictureWallController extends ShaarliVisitorController
|
|||
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
t('Picture wall') .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
t('Picture wall') . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
|
||||
// Optionally filter the results:
|
||||
|
|
|
@ -144,7 +144,8 @@ abstract class ShaarliVisitorController
|
|||
if (null !== $referer) {
|
||||
$currentUrl = parse_url($referer);
|
||||
// If the referer is not related to Shaarli instance, redirect to default
|
||||
if (isset($currentUrl['host'])
|
||||
if (
|
||||
isset($currentUrl['host'])
|
||||
&& strpos(index_url($this->container->environment), $currentUrl['host']) === false
|
||||
) {
|
||||
return $response->withRedirect($defaultPath);
|
||||
|
@ -173,7 +174,7 @@ abstract class ShaarliVisitorController
|
|||
}
|
||||
}
|
||||
|
||||
$queryString = count($params) > 0 ? '?'. http_build_query($params) : '';
|
||||
$queryString = count($params) > 0 ? '?' . http_build_query($params) : '';
|
||||
$anchor = $anchor ? '#' . $anchor : '';
|
||||
|
||||
return $response->withRedirect($path . $queryString . $anchor);
|
||||
|
|
|
@ -84,10 +84,10 @@ class TagCloudController extends ShaarliVisitorController
|
|||
$this->executePageHooks('render_tag' . $type, $data, 'tag.' . $type);
|
||||
$this->assignAllView($data);
|
||||
|
||||
$searchTags = !empty($searchTags) ? trim(str_replace($tagsSeparator, ' ', $searchTags)) .' - ' : '';
|
||||
$searchTags = !empty($searchTags) ? trim(str_replace($tagsSeparator, ' ', $searchTags)) . ' - ' : '';
|
||||
$this->assignView(
|
||||
'pagetitle',
|
||||
$searchTags . t('Tag '. $type) .' - '. $this->container->conf->get('general.title', 'Shaarli')
|
||||
$searchTags . t('Tag ' . $type) . ' - ' . $this->container->conf->get('general.title', 'Shaarli')
|
||||
);
|
||||
|
||||
return $response->write($this->render('tag.' . $type));
|
||||
|
|
|
@ -27,7 +27,7 @@ class TagController extends ShaarliVisitorController
|
|||
// In case browser does not send HTTP_REFERER, we search a single tag
|
||||
if (null === $referer) {
|
||||
if (null !== $newTag) {
|
||||
return $this->redirect($response, '/?searchtags='. urlencode($newTag));
|
||||
return $this->redirect($response, '/?searchtags=' . urlencode($newTag));
|
||||
}
|
||||
|
||||
return $this->redirect($response, '/');
|
||||
|
@ -37,7 +37,7 @@ class TagController extends ShaarliVisitorController
|
|||
parse_str($currentUrl['query'] ?? '', $params);
|
||||
|
||||
if (null === $newTag) {
|
||||
return $response->withRedirect(($currentUrl['path'] ?? './') .'?'. http_build_query($params));
|
||||
return $response->withRedirect(($currentUrl['path'] ?? './') . '?' . http_build_query($params));
|
||||
}
|
||||
|
||||
// Prevent redirection loop
|
||||
|
@ -68,7 +68,7 @@ class TagController extends ShaarliVisitorController
|
|||
// We also remove page (keeping the same page has no sense, since the results are different)
|
||||
unset($params['page']);
|
||||
|
||||
return $response->withRedirect(($currentUrl['path'] ?? './') .'?'. http_build_query($params));
|
||||
return $response->withRedirect(($currentUrl['path'] ?? './') . '?' . http_build_query($params));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -90,7 +90,7 @@ class TagController extends ShaarliVisitorController
|
|||
parse_str($currentUrl['query'] ?? '', $params);
|
||||
|
||||
if (null === $tagToRemove) {
|
||||
return $response->withRedirect(($currentUrl['path'] ?? './') .'?'. http_build_query($params));
|
||||
return $response->withRedirect(($currentUrl['path'] ?? './') . '?' . http_build_query($params));
|
||||
}
|
||||
|
||||
// Prevent redirection loop
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue