Merge branch 'MDL-49383-master' of git://github.com/lameze/moodle

This commit is contained in:
Dan Poltawski 2015-07-27 12:05:45 +01:00
commit 6d0e700eda
3 changed files with 21 additions and 18 deletions

View File

@ -2359,3 +2359,23 @@ function get_timezone_record($timezonename) {
} }
/* === Apis deprecated since Moodle 3.0 === */ /* === Apis deprecated since Moodle 3.0 === */
/**
* Returns the URL of the HTTP_REFERER, less the querystring portion if required.
*
* @deprecated since Moodle 3.0 MDL-49360 - please do not use this function any more.
* @todo Remove this function in Moodle 3.2
* @param boolean $stripquery if true, also removes the query part of the url.
* @return string The resulting referer or empty string.
*/
function get_referer($stripquery = true) {
debugging('get_referer() is deprecated. Please use get_local_referer() instead.', DEBUG_DEVELOPER);
if (isset($_SERVER['HTTP_REFERER'])) {
if ($stripquery) {
return strip_querystring($_SERVER['HTTP_REFERER']);
} else {
return $_SERVER['HTTP_REFERER'];
}
} else {
return '';
}
}

View File

@ -3,6 +3,7 @@ information provided here is intended especially for developers.
=== 3.0 === === 3.0 ===
* get_referer() has been deprecated, please use the get_local_referer function instead.
* \core\progress\null is renamed to \core\progress\none for improved PHP7 compatibility as null is a reserved word (see MDL-50453). * \core\progress\null is renamed to \core\progress\none for improved PHP7 compatibility as null is a reserved word (see MDL-50453).
* \webservice_xmlrpc_client now respects proxy server settings. If your XMLRPC server is available on your local network and not via your proxy server, you may need to add it to the list of proxy * \webservice_xmlrpc_client now respects proxy server settings. If your XMLRPC server is available on your local network and not via your proxy server, you may need to add it to the list of proxy
server exceptions in $CFG->proxybypass. See MDL-39353 for details. server exceptions in $CFG->proxybypass. See MDL-39353 for details.

View File

@ -158,24 +158,6 @@ function strip_querystring($url) {
} }
} }
/**
* Returns the URL of the HTTP_REFERER, less the querystring portion if required.
*
* @param boolean $stripquery if true, also removes the query part of the url.
* @return string The resulting referer or empty string.
*/
function get_referer($stripquery=true) {
if (isset($_SERVER['HTTP_REFERER'])) {
if ($stripquery) {
return strip_querystring($_SERVER['HTTP_REFERER']);
} else {
return $_SERVER['HTTP_REFERER'];
}
} else {
return '';
}
}
/** /**
* Returns the name of the current script, WITH the querystring portion. * Returns the name of the current script, WITH the querystring portion.
* *