@@ -62,8 +62,7 @@ discard block |
||
62 | 62 | $real = $request->getRequestUri(); |
63 | 63 | |
64 | 64 | $expected = 'homepage' == $page->getSlug() ? |
65 | - $this->get('piedweb.page_canonical')->generatePathForHomepage() : |
|
66 | - $this->get('piedweb.page_canonical')->generatePathForPage($page->getRealSlug()); |
|
65 | + $this->get('piedweb.page_canonical')->generatePathForHomepage() : $this->get('piedweb.page_canonical')->generatePathForPage($page->getRealSlug()); |
|
67 | 66 | |
68 | 67 | if ($real != $expected) { |
69 | 68 | return [$request->getBasePath().$expected, 301]; |
@@ -151,7 +150,7 @@ discard block |
||
151 | 150 | return $this->render('@PiedWebCMS/page/rss.xml.twig', array_merge([ |
152 | 151 | 'pages' => $this->getPages(5, $request, $params), |
153 | 152 | 'page' => $page, |
154 | - 'feedUri' => 'feed'.($params->get('locale') == $locale ? '' : '.'.$locale).'.xml',], $app->getParamsForRendering())); |
|
153 | + 'feedUri' => 'feed'.($params->get('locale') == $locale ? '' : '.'.$locale).'.xml', ], $app->getParamsForRendering())); |
|
155 | 154 | } |
156 | 155 | |
157 | 156 | public function showSitemap( |
@@ -174,7 +173,7 @@ discard block |
||
174 | 173 | |
175 | 174 | protected function getPages(?int $limit = null, Request $request, ParameterBagInterface $params) |
176 | 175 | { |
177 | - $requestedLocale = rtrim($request->getLocale(),'/'); |
|
176 | + $requestedLocale = rtrim($request->getLocale(), '/'); |
|
178 | 177 | |
179 | 178 | $app = App::load($request, $params); |
180 | 179 | $pages = Repository::getPageRepository($this->getDoctrine(), $params->get('pwc.entity_page')) |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | ]; |
110 | 110 | } |
111 | 111 | |
112 | - protected static function prepareForRegex ($var) |
|
112 | + protected static function prepareForRegex($var) |
|
113 | 113 | { |
114 | 114 | if (is_string($var)) { |
115 | 115 | return preg_quote($var, '/'); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | { |
130 | 130 | $urlInAttributes = ' '.self::prepareForRegex(['href', 'data-rot', 'src', 'data-img', 'data-bg']); |
131 | 131 | $regex = '/'.$urlInAttributes.'=((["\'])([^\3]+)\3|([^\s>]+)[\s>])/iU'; |
132 | - preg_match_all( $regex, $this->pageHtml, $matches ); |
|
132 | + preg_match_all($regex, $this->pageHtml, $matches); |
|
133 | 133 | |
134 | 134 | $linkedDocs = []; |
135 | 135 | foreach ($matches[0] as $k => $match) { |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $this->linksCheckedCounter++; |
165 | 165 | if (!is_string($uri)) |
166 | 166 | continue; |
167 | - if (($uri[0] == '/' && !$this->uriExist($uri) ) |
|
167 | + if (($uri[0] == '/' && !$this->uriExist($uri)) |
|
168 | 168 | || (strpos($uri, 'http') === 0 && !$this->urlExist($uri))) { |
169 | 169 | $this->addError('<code>'.$uri.'</code> introuvable'); |
170 | 170 | } |