diff --git a/components/com_contact/src/View/Contact/HtmlView.php b/components/com_contact/src/View/Contact/HtmlView.php index 2c2d192b76d32..bf5850a9eed4c 100644 --- a/components/com_contact/src/View/Contact/HtmlView.php +++ b/components/com_contact/src/View/Contact/HtmlView.php @@ -371,8 +371,10 @@ public function display($tpl = null) $this->contacts = &$contacts; $this->contactUser = $contactUser; - $model = $this->getModel(); - $model->hit(); + if (\in_array($app->getInput()->getMethod(), ['GET', 'POST'])) { + $model = $this->getModel(); + $model->hit(); + } $captchaSet = $item->params->get('captcha', $app->get('captcha', '0')); diff --git a/components/com_content/src/Controller/DisplayController.php b/components/com_content/src/Controller/DisplayController.php index 97d73f6e6fd2a..8f9bb4c3bd190 100644 --- a/components/com_content/src/Controller/DisplayController.php +++ b/components/com_content/src/Controller/DisplayController.php @@ -110,7 +110,7 @@ public function display($cachable = false, $urlparams = false) throw new \Exception(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id), 403); } - if ($vName === 'article') { + if ($vName === 'article' && \in_array($this->input->getMethod(), ['GET', 'POST'])) { // Get/Create the model if ($model = $this->getModel($vName)) { if (ComponentHelper::getParams('com_content')->get('record_hits', 1) == 1) { diff --git a/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php b/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php index 9da806fa31207..cbaa8bd65021d 100644 --- a/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php +++ b/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php @@ -212,8 +212,10 @@ public function display($tpl = null) $item->tags->getItemTags('com_newsfeeds.newsfeed', $item->id); // Increment the hit counter of the newsfeed. - $model = $this->getModel(); - $model->hit(); + if (\in_array($app->getInput()->getMethod(), ['GET', 'POST'])) { + $model = $this->getModel(); + $model->hit(); + } $this->_prepareDocument(); diff --git a/components/com_tags/src/Controller/DisplayController.php b/components/com_tags/src/Controller/DisplayController.php index 7af87d11cdad9..b0979e2043f19 100644 --- a/components/com_tags/src/Controller/DisplayController.php +++ b/components/com_tags/src/Controller/DisplayController.php @@ -59,6 +59,7 @@ public function display($cachable = false, $urlparams = false) if ( $vName === 'tag' + && \in_array($this->input->getMethod(), ['GET', 'POST']) && ComponentHelper::getParams('com_tags')->get('record_hits', 1) == 1 && $model = $this->getModel($vName) ) {