Helper/Bibtex.php
function _checkAt($entry)
    {
        $ret = false;
        $opening = array_keys($this->_delimiters);
        $closing = array_values($this->_delimiters);
        //Getting the value (at is only allowd in values)
        if (strrpos($entry, '=') !== false) {
            $position = strrpos($entry, '=');
            $proceed = true;
            if (substr($entry, $position - 1, 1) == '\\') {
                $proceed = false;
            }
            while (!$proceed) {
                $substring = substr($entry, 0, $position);
                $position = strrpos($substring, '=');
                $proceed = true;
                if (substr($entry, $position - 1, 1) == '\\') {
                    $proceed = false;
                }
            }
            $value = trim(substr($entry, $position + 1));
            $open = 0;
            $char = '';
            $lastchar = '';
            for ($i = 0; $i < strlen($value); $i++) {
                $char = substr($this->content, $i, 1);
                if (in_array($char, $opening) && ('\\' != $lastchar)) {
                    $open++;
                } elseif (in_array($char, $closing) && ('\\' != $lastchar)) {
                    $open--;
                }
                $lastchar = $char;
            }
            //if open is grater zero were are inside an entry
            if ($open > 0) {
                $ret = true;
            }
        }
        return $ret;
    }
function _checkAt($entry)
    {
        $ret = false;
        $opening = array_keys($this->_delimiters);
        $closing = array_values($this->_delimiters);
        //Getting the value (at is only allowd in values)
        if (strrpos($entry, '=') !== false) {
            $position = strrpos($entry, '=');
            $proceed = true;
            if (substr($entry, $position - 1, 1) == '\\') {
                $proceed = false;
            }
            while (!$proceed) {
                $substring = substr($entry, 0, $position);
                $position = strrpos($substring, '=');
                $proceed = true;
                if (substr($entry, $position - 1, 1) == '\\') {
                    $proceed = false;
                }
            }
            $value = trim(substr($entry, $position + 1));
            $open = 0;
            $char = '';
            $lastchar = '';
            for ($i = 0; $i < strlen($value); $i++) {
                $char = substr($this->content, $i, 1);
                if (in_array($char, $opening) && ('\\' != $lastchar)) {
                    $open++;
                } elseif (in_array($char, $closing) && ('\\' != $lastchar)) {
                    $open--;
                }
                $lastchar = $char;
            }
            //if open is grater zero were are inside an entry
            if ($open > 0) {
                $ret = true;
            }
        }
        return $ret;
    }
function _checkAt ( $ entry ) { $ ret = false ; $ opening = array_keys ( $ this -> _delimiters ) ; $ closing = array_values ( $ this -> _delimiters ) ; //Getting the value (at is only allowd in values) if ( strrpos ( $ entry , '=' ) !== false ) { $ position = strrpos ( $ entry , '=' ) ; $ proceed = true ; if ( substr ( $ entry , $ position - 1 , 1 ) == '\\' ) { $ proceed = false ; } while ( ! $ proceed ) { $ substring = substr ( $ entry , 0 , $ position ) ; $ position = strrpos ( $ substring , '=' ) ; $ proceed = true ; if ( substr ( $ entry , $ position - 1 , 1 ) == '\\' ) { $ proceed = false ; } } $ value = trim ( substr ( $ entry , $ position + 1 ) ) ; $ open = 0 ; $ char = '' ; $ lastchar = '' ; for ( $ i = 0 ; $ i < strlen ( $ value ) ; $ i ++ ) { $ char = substr ( $ this -> content , $ i , 1 ) ; if ( in_array ( $ char , $ opening ) && ( '\\' != $ lastchar ) ) { $ open ++ ; } elseif ( in_array ( $ char , $ closing ) && ( '\\' != $ lastchar ) ) { $ open -- ; } $ lastchar = $ char ; } //if open is grater zero were are inside an entry if ( $ open > 0 ) { $ ret = true ; } } return $ ret ; }
Checking whether an at is outside an entry

Sometimes an entry misses an entry brace. Then the at of the next entry seems to be
inside an entry. This is checked here. When it is most likely that the at is an opening
at of the next entry this method returns true.

@access private
@param string $entry The text of the entry until the at
@return bool true if the at is correct, false if the at is likely to begin the next entry.
Checking whether an at is outside an entry