You are here

function PARSEENTRIES::removeDelimiters in Bibliography Module 7.2

Same name and namespace in other branches
  1. 5 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::removeDelimiters()
  2. 6.2 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::removeDelimiters()
  3. 6 bibtexParse/PARSEENTRIES.php \PARSEENTRIES::removeDelimiters()
  4. 7.3 plugins/biblio_style/bibtex/PARSEENTRIES.php \PARSEENTRIES::removeDelimiters()
  5. 7 modules/bibtexParse/PARSEENTRIES.php \PARSEENTRIES::removeDelimiters()
1 call to PARSEENTRIES::removeDelimiters()
PARSEENTRIES::removeDelimitersAndExpand in modules/bibtexParse/PARSEENTRIES.php

File

modules/bibtexParse/PARSEENTRIES.php, line 336

Class

PARSEENTRIES

Code

function removeDelimiters($string) {
  if ($string && $string[0] == "\"") {
    $string = substr($string, 1);
    $string = substr($string, 0, -1);
  }
  else {
    if ($string && $string[0] == "{") {
      if (strlen($string) > 0 && $string[strlen($string) - 1] == "}") {
        $string = substr($string, 1);
        $string = substr($string, 0, -1);
      }
    }
    else {
      if (!is_numeric($string) && !array_key_exists($string, $this->strings) && array_search($string, $this->undefinedStrings) === FALSE) {
        $this->undefinedStrings[] = $string;

        // Undefined string that is not a year etc.
        return '';
      }
    }
  }
  return $string;
}