protected function _parseRelativePathCss($m) {
        /**
         * We take the page. Each time we have a '../' in a path file in the css, we drop a folder of the parent file. Zxample :
         *   css file : css/dossier/truc/test.css
         *   image file in css : ../../test.png
         *   we have two ../ so we delete two folder : css/test/test.png
         */

        $pathReplace = '';

        if (!preg_match('~(?:f|ht)tps?://~i', $m[1]) && !preg_match('~(data)~i', $m[1])) {
            //we clear the '/' at the beginning
            $m[1] = preg_replace("#^/#isU", '', $m[1]);
            $m[1] = str_replace('"', '', $m[1]);
            $m[1] = str_replace("'", '', $m[1]);
            $this->_currentPath = preg_replace("#^/#isU", '', $this->_currentPath);

            //on count the number of '../'
            $numberParentDir = substr_count($m[1], '../');

            if ($numberParentDir > 0) {
                for ($i = 0; $i < $numberParentDir; $i++) {
                    $pathReplace .= '(.[^\/]+)\/';
                }

                $pathReplace .= '$';
                $newCurrentPath = preg_replace('#' . $pathReplace . '#isU', '/', $this->_currentPath);
                $m[1] = preg_replace('#\.\./#isU', '', $m[1]);

                if ($newCurrentPath != $this->_currentPath) {
                    $m[1] = $newCurrentPath . $m[1];
                }
                else if (!preg_match('#^' . preg_quote($newCurrentPath) . '#isU', $m[1])) {
                    if (!preg_match('#^/asset#isU', $m[1]) && !preg_match('#^asset#isU', $m[1])) {
                        $m[1] = $newCurrentPath . $m[1];
                    }
                }
            }

            if (!preg_match('#^/#isU', $m[1])) {
                $m[1] = '/' . $m[1];
            }

            if (Config::config()['user']['output']['https']) {
                return 'https://' . str_replace('//', '/', $_SERVER['HTTP_HOST'] . '/' . Config::config()['user']['framework']['folder'] . $m[1]);
            }
            else {
                return 'http://' . str_replace('//', '/', $_SERVER['HTTP_HOST'] . '/' . Config::config()['user']['framework']['folder'] . $m[1]);
            }
        }
        else {
            return $m[1];
        }
    }
protected function _parseRelativePathCss($m) {
        /**
         * We take the page. Each time we have a '../' in a path file in the css, we drop a folder of the parent file. Zxample :
         *   css file : css/dossier/truc/test.css
         *   image file in css : ../../test.png
         *   we have two ../ so we delete two folder : css/test/test.png
         */

        $pathReplace = '';

        if (!preg_match('~(?:f|ht)tps?://~i', $m[1]) && !preg_match('~(data)~i', $m[1])) {
            //we clear the '/' at the beginning
            $m[1] = preg_replace("#^/#isU", '', $m[1]);
            $m[1] = str_replace('"', '', $m[1]);
            $m[1] = str_replace("'", '', $m[1]);
            $this->_currentPath = preg_replace("#^/#isU", '', $this->_currentPath);

            //on count the number of '../'
            $numberParentDir = substr_count($m[1], '../');

            if ($numberParentDir > 0) {
                for ($i = 0; $i < $numberParentDir; $i++) {
                    $pathReplace .= '(.[^\/]+)\/';
                }

                $pathReplace .= '$';
                $newCurrentPath = preg_replace('#' . $pathReplace . '#isU', '/', $this->_currentPath);
                $m[1] = preg_replace('#\.\./#isU', '', $m[1]);

                if ($newCurrentPath != $this->_currentPath) {
                    $m[1] = $newCurrentPath . $m[1];
                }
                else if (!preg_match('#^' . preg_quote($newCurrentPath) . '#isU', $m[1])) {
                    if (!preg_match('#^/asset#isU', $m[1]) && !preg_match('#^asset#isU', $m[1])) {
                        $m[1] = $newCurrentPath . $m[1];
                    }
                }
            }

            if (!preg_match('#^/#isU', $m[1])) {
                $m[1] = '/' . $m[1];
            }

            if (Config::config()['user']['output']['https']) {
                return 'https://' . str_replace('//', '/', $_SERVER['HTTP_HOST'] . '/' . Config::config()['user']['framework']['folder'] . $m[1]);
            }
            else {
                return 'http://' . str_replace('//', '/', $_SERVER['HTTP_HOST'] . '/' . Config::config()['user']['framework']['folder'] . $m[1]);
            }
        }
        else {
            return $m[1];
        }
    }
protected function _parseRelativePathCss ( $ m ) { /**
         * We take the page. Each time we have a '../' in a path file in the css, we drop a folder of the parent file. Zxample :
         *   css file : css/dossier/truc/test.css
         *   image file in css : ../../test.png
         *   we have two ../ so we delete two folder : css/test/test.png
         */ $ pathReplace = '' ; if ( ! preg_match ( '~(?:f|ht)tps?://~i' , $ m [ 1 ] ) && ! preg_match ( '~(data)~i' , $ m [ 1 ] ) ) { //we clear the '/' at the beginning $ m [ 1 ] = preg_replace ( "#^/#isU" , '' , $ m [ 1 ] ) ; $ m [ 1 ] = str_replace ( '"' , '' , $ m [ 1 ] ) ; $ m [ 1 ] = str_replace ( "'" , '' , $ m [ 1 ] ) ; $ this -> _currentPath = preg_replace ( "#^/#isU" , '' , $ this -> _currentPath ) ; //on count the number of '../' $ numberParentDir = substr_count ( $ m [ 1 ] , '../' ) ; if ( $ numberParentDir > 0 ) { for ( $ i = 0 ; $ i < $ numberParentDir ; $ i ++ ) { $ pathReplace .= '(.[^\/]+)\/' ; } $ pathReplace .= '$' ; $ newCurrentPath = preg_replace ( '#' . $ pathReplace . '#isU' , '/' , $ this -> _currentPath ) ; $ m [ 1 ] = preg_replace ( '#\.\./#isU' , '' , $ m [ 1 ] ) ; if ( $ newCurrentPath != $ this -> _currentPath ) { $ m [ 1 ] = $ newCurrentPath . $ m [ 1 ] ; } else if ( ! preg_match ( '#^' . preg_quote ( $ newCurrentPath ) . '#isU' , $ m [ 1 ] ) ) { if ( ! preg_match ( '#^/asset#isU' , $ m [ 1 ] ) && ! preg_match ( '#^asset#isU' , $ m [ 1 ] ) ) { $ m [ 1 ] = $ newCurrentPath . $ m [ 1 ] ; } } } if ( ! preg_match ( '#^/#isU' , $ m [ 1 ] ) ) { $ m [ 1 ] = '/' . $ m [ 1 ] ; } if ( Config :: config ( ) [ 'user' ] [ 'output' ] [ 'https' ] ) { return 'https://' . str_replace ( '//' , '/' , $ _SERVER [ 'HTTP_HOST' ] . '/' . Config :: config ( ) [ 'user' ] [ 'framework' ] [ 'folder' ] . $ m [ 1 ] ) ; } else { return 'http://' . str_replace ( '//' , '/' , $ _SERVER [ 'HTTP_HOST' ] . '/' . Config :: config ( ) [ 'user' ] [ 'framework' ] [ 'folder' ] . $ m [ 1 ] ) ; } } else { return $ m [ 1 ] ; } }
correct wrong links
@access public
@param $m array
@return string
@since 3.0
@package Gcs\Framework\Core\Asset
correct wrong links