code/view/json.php
protected function _processLinks(&$array)
    {
        $base = $this->getUrl()->toString(HttpUrl::AUTHORITY);

        foreach ($array as $key => &$value)
        {
            if ($key === 'links')
            {
                foreach ($array['links'] as $k => $v)
                {
                    if (strpos($v, ':/') === false) {
                        $array['links'][$k] = $base.$v;
                    }
                }
            }
            elseif (is_array($value)) {
                $this->_processLinks($value);
            }
            elseif (in_array($key, $this->_text_fields, true)) {
                $array[$key] = $this->_processText($value);
            }
        }
    }
protected function _processLinks(&$array)
    {
        $base = $this->getUrl()->toString(HttpUrl::AUTHORITY);

        foreach ($array as $key => &$value)
        {
            if ($key === 'links')
            {
                foreach ($array['links'] as $k => $v)
                {
                    if (strpos($v, ':/') === false) {
                        $array['links'][$k] = $base.$v;
                    }
                }
            }
            elseif (is_array($value)) {
                $this->_processLinks($value);
            }
            elseif (in_array($key, $this->_text_fields, true)) {
                $array[$key] = $this->_processText($value);
            }
        }
    }
protected function _processLinks ( & $ array ) { $ base = $ this -> getUrl ( ) -> toString ( HttpUrl :: AUTHORITY ) ; foreach ( $ array as $ key => & $ value ) { if ( $ key === 'links' ) { foreach ( $ array [ 'links' ] as $ k => $ v ) { if ( strpos ( $ v , ':/' ) === false ) { $ array [ 'links' ] [ $ k ] = $ base . $ v ; } } } elseif ( is_array ( $ value ) ) { $ this -> _processLinks ( $ value ) ; } elseif ( in_array ( $ key , $ this -> _text_fields , true ) ) { $ array [ $ key ] = $ this -> _processText ( $ value ) ; } } }
Converts links in the content array from relative to absolute

@param \Traversable|array $array
Converts links in the content array from relative to absolute