function PARSEENTRIES::closingDelimiter in Bibliography Module 6
Same name and namespace in other branches
- 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
- 6.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
- 7.3 plugins/biblio_style/bibtex/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
- 7 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
- 7.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::closingDelimiter()
1 call to PARSEENTRIES::closingDelimiter()
- PARSEENTRIES::extractEntries in bibtexParse/
PARSEENTRIES.php
File
- bibtexParse/
PARSEENTRIES.php, line 393
Class
Code
function closingDelimiter($val, $delimitEnd) {
// echo "####>$delimitEnd $val<BR>";
$openquote = $bracelevel = $i = $j = 0;
while ($i < strlen($val)) {
// a '"' found at brace level 0 defines a value such as "ss{\"o}ss"
if ($val[$i] == '"' && !$bracelevel) {
$openquote = !$openquote;
}
elseif ($val[$i] == '{') {
$bracelevel++;
}
elseif ($val[$i] == '}') {
$bracelevel--;
}
if ($val[$i] == $delimitEnd && !$openquote && !$bracelevel) {
return $i;
}
$i++;
}
// echo "--> $bracelevel, $openquote";
return 0;
}