Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Fixed a bug in the unique bibtex key check
Browse files Browse the repository at this point in the history
  • Loading branch information
winkm89 authored and SimonPhumin committed Feb 26, 2022
1 parent e1bd347 commit 4cc39ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/publications/class-db-publications.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ public static function generate_unique_bibtex_key ($bibtex_key) {
}

// Check if the key is unique
$check = $wpdb->get_var("SELECT COUNT('pub_id') FROM " . TEACHPRESS_PUB . " WHERE `bibtex` LIKE '%" . esc_sql($bibtex_key) . "%'");
$check = $wpdb->get_var("SELECT COUNT('pub_id') FROM " . TEACHPRESS_PUB . " WHERE `bibtex` = '" . esc_sql($bibtex_key) . "'");
if ( intval($check) > 0 ) {
$alphabet = range('a', 'z');
if ( $check <= 25 ) {
Expand Down

0 comments on commit 4cc39ce

Please sign in to comment.