protected function is_same_release($remote, $local=null) {

        if (is_null($local)) {
            $this->load_current_environment();
            $local = $this->currentrelease;
        }

        $pattern = '/^([0-9\.\+]+)([^(]*)/';

        preg_match($pattern, $remote, $remotematches);
        preg_match($pattern, $local, $localmatches);

        $remotematches[1] = str_replace('+', '', $remotematches[1]);
        $localmatches[1] = str_replace('+', '', $localmatches[1]);

        if ($remotematches[1] === $localmatches[1] and rtrim($remotematches[2]) === rtrim($localmatches[2])) {
            return true;
        } else {
            return false;
        }
    }
protected function is_same_release($remote, $local=null) {

        if (is_null($local)) {
            $this->load_current_environment();
            $local = $this->currentrelease;
        }

        $pattern = '/^([0-9\.\+]+)([^(]*)/';

        preg_match($pattern, $remote, $remotematches);
        preg_match($pattern, $local, $localmatches);

        $remotematches[1] = str_replace('+', '', $remotematches[1]);
        $localmatches[1] = str_replace('+', '', $localmatches[1]);

        if ($remotematches[1] === $localmatches[1] and rtrim($remotematches[2]) === rtrim($localmatches[2])) {
            return true;
        } else {
            return false;
        }
    }
protected function is_same_release ( $ remote , $ local = null ) { if ( is_null ( $ local ) ) { $ this -> load_current_environment ( ) ; $ local = $ this -> currentrelease ; } $ pattern = '/^([0-9\.\+]+)([^(]*)/' ; preg_match ( $ pattern , $ remote , $ remotematches ) ; preg_match ( $ pattern , $ local , $ localmatches ) ; $ remotematches [ 1 ] = str_replace ( '+' , '' , $ remotematches [ 1 ] ) ; $ localmatches [ 1 ] = str_replace ( '+' , '' , $ localmatches [ 1 ] ) ; if ( $ remotematches [ 1 ] === $ localmatches [ 1 ] and rtrim ( $ remotematches [ 2 ] ) === rtrim ( $ localmatches [ 2 ] ) ) { return true ; } else { return false ; } }
Compare two release labels and decide if they are the same

@param string $remote release info of the available update
@param null|string $local release info of the local code, defaults to $release defined in version.php
@return boolean true if the releases declare the same minor+major version
Compare two release labels and decide if they are the same