Skip to content

Commit

Permalink
Fix invalid loop argument + missing isset for plugin params
Browse files Browse the repository at this point in the history
  • Loading branch information
lopes-vincent committed Jul 16, 2021
1 parent 5160b36 commit b56a714
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Hook/MetaHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function __construct(RequestStack $requestStack)

public function onMainHeadBottom(HookRenderEvent $event)
{
if($view = $this->request->get('_view')) {
$view = $this->request->get('_view');
if ($view && preg_match('#^[a-zA-Z0-9\-_\.]+$#', $view)) {

$id = $this->request->get($view . '_id');

Expand Down
2 changes: 1 addition & 1 deletion Smarty/Plugins/BetterSeoMicroDataPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getPluginDescriptors()
*/
public function betterSeoMicroData($params)
{
$type = $params['type'] ?: $this->request->get('_view');
$type = $params['type'] ?? $this->request->get('_view');

$lang = $this->request->getSession()->getLang();

Expand Down

0 comments on commit b56a714

Please sign in to comment.