diff --git a/core/class-bibtex-import.php b/core/class-bibtex-import.php index 595affb..9ec4ba0 100644 --- a/core/class-bibtex-import.php +++ b/core/class-bibtex-import.php @@ -30,9 +30,8 @@ public static function init ($input, $settings, $test = false) { $import_id = ( $test === false ) ? tp_publication_imports::add_import() : 0; // Init bibtexParse - global $PARSEENTRIES; $input = tp_bibtex::convert_bibtex_to_utf8($input); - $parse = NEW PARSEENTRIES(); + $parse = NEW BIBTEXPARSE(); $parse->expandMacro = TRUE; $array = array('RMP' => 'Rev., Mod. Phys.'); $parse->loadStringMacro($array); @@ -258,7 +257,6 @@ public static function init ($entry, $key, $mode) { /** * This function can detect the name format automatically - * @global class $PARSECREATORS * @param array $entry * @param string $key * @return string @@ -266,8 +264,7 @@ public static function init ($entry, $key, $mode) { * @access private */ private static function dynamic_mode ($entry, $key) { - global $PARSECREATORS; - $creator = new PARSECREATORS(); + $creator = new BIBTEXCREATORPARSE(); $creatorArray = $creator->parse( $entry[$key] ); // print_r($creatorArray); $string = ''; diff --git a/core/class-bibtex.php b/core/class-bibtex.php index e2c62ad..546f6ce 100644 --- a/core/class-bibtex.php +++ b/core/class-bibtex.php @@ -396,14 +396,12 @@ public static function explode_url ($url_string) { /** * The function splits a author/editor name and returns the lastname or NULL if there is no name was found - * @global $PARSECREATORS * @param string $input A name of an author or editor * @return string * @since 5.0.0 */ public static function get_lastname ($input) { - global $PARSECREATORS; - $creator = new PARSECREATORS(); + $creator = new BIBTEXCREATORPARSE(); $creatorArray = $creator->parse($input); if ( isset( $creatorArray[0][2] ) ) { return trim($creatorArray[0][2]); @@ -446,11 +444,10 @@ public static function parse_author ($input, $separator, $mode = '') { * @return string * @since 5.0.0 * @access public - * @uses PARSECREATORS() This class is a part of bibtexParse + * @uses BIBTEXCREATORPARSE() This class is a part of bibtexParse */ public static function parse_author_default ($input, $separator = ';', $mode = 'initials') { - global $PARSECREATORS; - $creator = new PARSECREATORS(); + $creator = new BIBTEXCREATORPARSE(); $creatorArray = $creator->parse($input); $all_authors = ''; $max = count($creatorArray); diff --git a/readme.txt b/readme.txt index 1be2092..99caa09 100644 --- a/readme.txt +++ b/readme.txt @@ -70,7 +70,7 @@ The plugin saves course documents in your WordPress upload directory under /teac == Credits == -Copyright 2008-2020 by Michael Winkler +Copyright 2008-2021 by Michael Winkler This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -87,7 +87,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA = Licence information of external resources = -* bibtexParse by Mark Grimshaw & Guillaume Gardey (Licence: GPL) +* Wikindx bibtex import classes (bibtexParse) by Mark Grimshaw-Aagaard & Stéphane Aulery (Licence: ISC License) * Font Awesome Free 5.10.1 by fontawesome (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) * Academicons 1.8.6 by James Walsh (Font: SIL OFL 1.1, CSS: MIT License) * jquery-ui-icons.png by The jQuery Foundation (License: MIT) @@ -123,6 +123,9 @@ Please note the [teachPress 6.0 Upgrade Information](https://mtrv.wordpress.com/ == Changelog == += x.x.x = +* Changed: Update bibtexParse to v2.5 + = 7.1.3 (04.11.2020) = * Bugfix: Adding image URL no longer working with WordPress 5.5 diff --git a/teachpress.php b/teachpress.php index 1f8a04f..b7f4406 100644 --- a/teachpress.php +++ b/teachpress.php @@ -92,10 +92,10 @@ include_once("admin/show-students.php"); } -// BibTeX Parse -if ( !class_exists( 'PARSEENTRIES' ) ) { - include_once("includes/bibtexParse/PARSEENTRIES.php"); - include_once("includes/bibtexParse/PARSECREATORS.php"); +// BibTeX Parse v2.5 +if ( !class_exists( 'BIBTEXPARSE' ) ) { + include_once("includes/bibtexParse/BIBTEXPARSE.php"); + include_once("includes/bibtexParse/BIBTEXCREATORPARSE.php"); } /*********/