• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/composite/helper.php
  • Класс: BitrixMainCompositecan
  • Вызов: can::removeRandParam
static function removeRandParam()
{
	if (!array_key_exists("bxrand", $_GET) || !preg_match("/^[0-9]+$/", $_GET["bxrand"]))
	{
		return false;
	}

	self::$ajaxRandom = $_GET["bxrand"];

	unset($_GET["bxrand"]);
	unset($_REQUEST["bxrand"]);

	if (isset($_SERVER["REQUEST_URI"]))
	{
		$_SERVER["REQUEST_URI"] = preg_replace(
			"/((?<=\?)bxrand=\d+&?|&bxrand=\d+$)/",
			"",
			$_SERVER["REQUEST_URI"]
		);
		$_SERVER["REQUEST_URI"] = rtrim($_SERVER["REQUEST_URI"], "?&");
	}

	if (isset($_SERVER["QUERY_STRING"]))
	{
		$_SERVER["QUERY_STRING"] = preg_replace("/[?&]?bxrand=[0-9]+/", "", $_SERVER["QUERY_STRING"]);
		$_SERVER["QUERY_STRING"] = trim($_SERVER["QUERY_STRING"], "&");
		if (isset($GLOBALS["QUERY_STRING"]))
		{
			$GLOBALS["QUERY_STRING"] = $_SERVER["QUERY_STRING"];
		}
	}

	return self::$ajaxRandom;
}