joomla/joomla-platform — pull request #735 by ruzam (2012-01-11 16:11:14+00:00)
Title: Fix $sef ignoring $live_site value

The value of $live_site is discarded when $sef is enabled. This is
particularly problematic if the Joomla hosted server is behind a proxy server.

I've traced it down to the JURI::current(). This function is called to get the
base uri when SEF is enabled. When the self::$current value is empty (first
time) it's defaulted with a call to self::getInstance(). This doesn't take
into account whether a $live_site has been set.

Checking for live_site in JURI::current() fixes this bug. I'm still too new to
Joomla to know if this fixes or breaks links elsewhere in the application.