- if (JRequest::getVar("Itemid") && (strpos($path, 'civicrm/payment/ipn') === FALSE)) {
- $Itemid = "{$separator}Itemid=" . JRequest::getVar("Itemid");
+
+ // Get Itemid using JInput::get()
+ $input = Joomla\CMS\Factory::getApplication()->input;
+ $itemIdNum = $input->get("Itemid");
+ if ($itemIdNum && (strpos($path, 'civicrm/payment/ipn') === FALSE)) {
+ $Itemid = "{$separator}Itemid=" . $itemIdNum;