|
@@ -254,30 +254,29 @@ public class NowPlayingPlugin extends Plugin implements ActionListener {
|
254
|
254
|
final String time = source.getTime();
|
255
|
255
|
final String state = source.getState().getNiceName();
|
256
|
256
|
|
257
|
|
- return format.replaceAll("\\$artist", sanitise(artist))
|
258
|
|
- .replaceAll("\\$title", sanitise(title))
|
259
|
|
- .replaceAll("\\$album", sanitise(album))
|
260
|
|
- .replaceAll("\\$app", sanitise(app))
|
261
|
|
- .replaceAll("\\$bitrate", sanitise(bitrate))
|
262
|
|
- .replaceAll("\\$format", sanitise(filetype))
|
263
|
|
- .replaceAll("\\$length", sanitise(length))
|
264
|
|
- .replaceAll("\\$state", sanitise(state))
|
265
|
|
- .replaceAll("\\$time", sanitise(time));
|
|
257
|
+ return format.replace("$artist", sanitise(artist))
|
|
258
|
+ .replace("$title", sanitise(title))
|
|
259
|
+ .replace("$album", sanitise(album))
|
|
260
|
+ .replace("$app", sanitise(app))
|
|
261
|
+ .replace("$bitrate", sanitise(bitrate))
|
|
262
|
+ .replace("$format", sanitise(filetype))
|
|
263
|
+ .replace("$length", sanitise(length))
|
|
264
|
+ .replace("$state", sanitise(state))
|
|
265
|
+ .replace("$time", sanitise(time));
|
266
|
266
|
}
|
267
|
267
|
|
268
|
268
|
/**
|
269
|
269
|
* Sanitises the specified String so that it may be used as the replacement
|
270
|
270
|
* in a call to String.replaceAll. Namely, at present, this method returns
|
271
|
271
|
* an empty String if it is passed a null value; otherwise the input is
|
272
|
|
- * quoted for use as a replacement in the
|
273
|
|
- * {@link String#replaceAll(java.lang.String, java.lang.String)} method.
|
|
272
|
+ * returned as-is.
|
274
|
273
|
*
|
275
|
274
|
* @param input The string to be sanitised
|
276
|
275
|
* @return A sanitised version of the String
|
277
|
276
|
* @since 0.6.3
|
278
|
277
|
*/
|
279
|
278
|
protected static String sanitise(final String input) {
|
280
|
|
- return input == null ? "" : Matcher.quoteReplacement(input);
|
|
279
|
+ return input == null ? "" : input;
|
281
|
280
|
}
|
282
|
281
|
|
283
|
282
|
/**
|