src/CoreBundle/Controller/Backend/AbstractAddAllController.php
private function getReferer(Request $request, $table, $encodeAmp = false)
    {
        $uri = $this->systemAdapter->getReferer($encodeAmp, $table);
        // Make the location an absolute URL
        if (!preg_match('@^https?://@i', $uri)) {
            $uri = $request->getBasePath() . '/' . ltrim($uri, '/');
        }

        return $uri;
    }
private function getReferer(Request $request, $table, $encodeAmp = false)
    {
        $uri = $this->systemAdapter->getReferer($encodeAmp, $table);
        // Make the location an absolute URL
        if (!preg_match('@^https?://@i', $uri)) {
            $uri = $request->getBasePath() . '/' . ltrim($uri, '/');
        }

        return $uri;
    }
Get the current Backend referrer URL.

@param Request $request   The request.
@param string  $table     The table name.
@param bool    $encodeAmp Flag to encode ampersands or not.

@return string