UPDATE
The answer to the main question is:
JFactory::getUri() is deprecated, use JUri directly like this:
<?php
$uri = JUri::getInstance();
echo $uri->toString();
// or simpler:
echo JUri::getInstance();
?>
The Strict Standards error is because of the &
before JFactory::getURI();
. You can find more information about that below.
ORIGINAL ANSWER
Delete the &
//Get the full URL for sharing purposes
$uri = JFactory::getURI();
$absolute_url = $uri->toString();
<?php echo $absolute_url; ?>
With PHP5 the new
operator automatically returns a reference, so the '&' is not needed anymore.
From the official PHP manual:
As of PHP 5, the new operator returns a reference automatically, so assigning the result of new by reference results in an E_DEPRECATED message in PHP 5.3 and later, and an E_STRICT message in earlier versions.
source: http://php.net/manual/en/language.operators.assignment.php
JUri::current()
as it won't return any query parameters. Simply use what is described in the accepted answer below: joomla.stackexchange.com/a/4295/168