FacebookPlugin::redirectUri PHP Method

redirectUri() public method

public redirectUri ( null $NewValue = null ) : null | string
$NewValue null
return null | string
    public function redirectUri($NewValue = null)
    {
        if ($NewValue !== null) {
            $this->_RedirectUri = $NewValue;
        } elseif ($this->_RedirectUri === null) {
            $RedirectUri = url('/entry/connect/facebook', true);
            if (strpos($RedirectUri, '=') !== false) {
                $p = strrchr($RedirectUri, '=');
                $Uri = substr($RedirectUri, 0, -strlen($p));
                $p = urlencode(ltrim($p, '='));
                $RedirectUri = $Uri . '=' . $p;
            }
            $Path = Gdn::request()->path();
            $Target = val('Target', $_GET, $Path ? $Path : '/');
            // TODO rm global
            if (ltrim($Target, '/') == 'entry/signin' || empty($Target)) {
                $Target = '/';
            }
            $Args = array('Target' => $Target);
            $RedirectUri .= strpos($RedirectUri, '?') === false ? '?' : '&';
            $RedirectUri .= http_build_query($Args);
            $this->_RedirectUri = $RedirectUri;
        }
        return $this->_RedirectUri;
    }