forked from wallabag/wallabag
Apply PHP-CS-Fixer fixes
This commit is contained in:
@ -98,7 +98,7 @@ class ContentProxy
|
||||
|
||||
$errors = $this->validator->validate(
|
||||
$value,
|
||||
(new LocaleConstraint(['canonicalize' => true]))
|
||||
new LocaleConstraint(['canonicalize' => true])
|
||||
);
|
||||
|
||||
if (0 === \count($errors)) {
|
||||
@ -119,7 +119,7 @@ class ContentProxy
|
||||
{
|
||||
$errors = $this->validator->validate(
|
||||
$value,
|
||||
(new UrlConstraint())
|
||||
new UrlConstraint()
|
||||
);
|
||||
|
||||
if (0 === \count($errors)) {
|
||||
@ -207,8 +207,6 @@ class ContentProxy
|
||||
* If the title from the fetched content comes from a PDF, then its very possible that the character encoding is not
|
||||
* UTF-8. This methods tries to identify the character encoding and translate the title to UTF-8.
|
||||
*
|
||||
* @param $title
|
||||
*
|
||||
* @return string (maybe contains invalid UTF-8 character)
|
||||
*/
|
||||
private function convertPdfEncodingToUTF8($title)
|
||||
|
||||
@ -162,7 +162,7 @@ class DownloadImages
|
||||
$cleanSVG = $sanitizer->sanitize((string) $res->getBody());
|
||||
|
||||
// add an extra validation by checking about `<svg `
|
||||
if (false === $cleanSVG || false === strpos($cleanSVG, '<svg ')) {
|
||||
if (false === $cleanSVG || !str_contains($cleanSVG, '<svg ')) {
|
||||
$this->logger->error('DownloadImages: Bad SVG given', ['path' => $imagePath]);
|
||||
|
||||
return false;
|
||||
@ -373,7 +373,7 @@ class DownloadImages
|
||||
$bytes = substr((string) $res->getBody(), 0, 8);
|
||||
|
||||
foreach ($types as $type => $header) {
|
||||
if (0 === strpos($bytes, $header)) {
|
||||
if (str_starts_with($bytes, $header)) {
|
||||
$ext = $type;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -44,8 +44,8 @@ class Redirect
|
||||
return $url;
|
||||
}
|
||||
|
||||
if (!$ignoreActionMarkAsRead &&
|
||||
Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
|
||||
if (!$ignoreActionMarkAsRead
|
||||
&& Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
|
||||
return $this->router->generate('homepage');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user