Skip to content

Commit

Permalink
Fixed a bug in the unique bibtex key check
Browse files Browse the repository at this point in the history
For #101
  • Loading branch information
winkm89 committed Apr 26, 2021
1 parent e9b7506 commit 658784a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/publications/class-db-publications.php
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 658784a

Please sign in to comment.