Skip to content

Commit

Permalink
Indeed, even more injections
Browse files Browse the repository at this point in the history
  • Loading branch information
oscargus committed Jul 18, 2016
1 parent 83cac35 commit ac3158e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/main/java/net/sf/jabref/logic/layout/LayoutEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.util.regex.Pattern;

import net.sf.jabref.BibDatabaseContext;
import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.logic.formatter.bibtexfields.HtmlToLatexFormatter;
import net.sf.jabref.logic.formatter.bibtexfields.UnicodeToLatexFormatter;
Expand Down Expand Up @@ -582,15 +581,15 @@ private List<LayoutFormatter> getOptionalLayout(String formatterName) {

List<LayoutFormatter> results = new ArrayList<>(formatterStrings.size());

Map<String, String> userNameFormatter = NameFormatter.getNameFormatters();
Map<String, String> userNameFormatter = NameFormatter.getNameFormatters(prefs);

for (List<String> strings : formatterStrings) {

String className = strings.get(0).trim();

// Check if this is a name formatter defined by this export filter:
if (Globals.prefs.customExportNameFormatters != null) {
String contents = Globals.prefs.customExportNameFormatters.get(className);
if (prefs.customExportNameFormatters != null) {
String contents = prefs.customExportNameFormatters.get(className);
if (contents != null) {
NameFormatter nf = new NameFormatter();
nf.setParameter(contents);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.List;
import java.util.Map;

import net.sf.jabref.Globals;
import net.sf.jabref.JabRefPreferences;
import net.sf.jabref.logic.bst.BibtexNameFormatter;
import net.sf.jabref.logic.layout.LayoutFormatter;
import net.sf.jabref.model.entry.AuthorList;
Expand Down Expand Up @@ -184,12 +184,12 @@ public void setParameter(String parameter) {
this.parameter = parameter;
}

public static Map<String, String> getNameFormatters() {
public static Map<String, String> getNameFormatters(JabRefPreferences prefs) {

Map<String, String> result = new HashMap<>();

List<String> names = Globals.prefs.getStringList(NameFormatter.NAME_FORMATER_KEY);
List<String> formats = Globals.prefs.getStringList(NameFormatter.NAME_FORMATTER_VALUE);
List<String> names = prefs.getStringList(NameFormatter.NAME_FORMATER_KEY);
List<String> formats = prefs.getStringList(NameFormatter.NAME_FORMATTER_VALUE);

for (int i = 0; i < names.size(); i++) {
if (i < formats.size()) {
Expand Down

0 comments on commit ac3158e

Please sign in to comment.