You are here

function biblio_bibtex_check_md5 in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/bibtexParse/biblio_bibtex.module \biblio_bibtex_check_md5()
  2. 7.2 modules/bibtexParse/biblio_bibtex.module \biblio_bibtex_check_md5()
1 call to biblio_bibtex_check_md5()
_biblio_bibtex_import in modules/bibtexParse/biblio_bibtex.module

File

modules/bibtexParse/biblio_bibtex.module, line 543

Code

function biblio_bibtex_check_md5($md5) {
  static $bibtex_md5s = array();
  if (empty($bibtex_md5s)) {
    $result = db_query("SELECT * FROM {biblio_bibtex} ");
    foreach ($result as $row) {
      $bibtex_md5s[$row->biblio_bibtex_md5] = $row->nid;
    }
  }
  if (isset($bibtex_md5s[$md5])) {
    return $bibtex_md5s[$md5];
  }
  else {

    // Gaurd against duplicates in the same import.
    $bibtex_md5s[$md5] = TRUE;
    return;
  }
}