why request uri gives duplicated string ?

/shopikos/frontend/web/site/contact/shopikos/frontend/web/site/contact

I am receiving this when trying to use $_SERVER[‘REQUEST_URI’]

is this a bug or something else?

This is the code in Request class




 /**

     * Resolves the request URI portion for the currently requested URL.

     * This refers to the portion that is after the [[hostInfo]] part. It includes the [[queryString]] part if any.

     * The implementation of this method referenced Zend_Controller_Request_Http in Zend Framework.

     * @return string|boolean the request URI portion for the currently requested URL.

     * Note that the URI returned is URL-encoded.

     * @throws InvalidConfigException if the request URI cannot be determined due to unusual server configuration

     */

    protected function resolveRequestUri()

    {

        if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // IIS

            $requestUri = $_SERVER['HTTP_X_REWRITE_URL'];

        } elseif (isset($_SERVER['REQUEST_URI'])) {

            $requestUri = $_SERVER['REQUEST_URI'];

            if ($requestUri !== '' && $requestUri[0] !== '/') {

                $requestUri = preg_replace('/^(http|https):\/\/[^\/]+/i', '', $requestUri);

            }

        } elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0 CGI

            $requestUri = $_SERVER['ORIG_PATH_INFO'];

            if (!empty($_SERVER['QUERY_STRING'])) {

                $requestUri .= '?' . $_SERVER['QUERY_STRING'];

            }

        } else {

            throw new InvalidConfigException('Unable to determine the request URI.');

        }


        return $requestUri;

    }



I got that it goes over the code twice! why this happen?

I got the issue. If yii debugger is turned on everything happens twice and as I print and exit it run 2 separate threads so I got 2 same strings!!!