Changeset 11171 in josm


Ignore:
Timestamp:
2016-10-26T21:23:24+02:00 (8 years ago)
Author:
simon04
Message:

Fix MOTD image link replacement

Avoids downloading images which are contained in the JOSM distribution.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/GettingStarted.java

    r11040 r11171  
    7171     * Grabs current MOTD from cache or webpage and parses it.
    7272     */
    73     private static class MotdContent extends CacheCustomContent<IOException> {
     73    static class MotdContent extends CacheCustomContent<IOException> {
    7474        MotdContent() {
    7575            super("motd.html", CacheCustomContent.INTERVAL_DAILY);
     
    161161    }
    162162
    163     private String fixImageLinks(String s) {
    164         Matcher m = Pattern.compile("src=\""+Main.getJOSMWebsite()+"/browser/trunk(/images/.*?\\.png)\\?format=raw\"").matcher(s);
     163    static String fixImageLinks(String s) {
     164        Matcher m = Pattern.compile("src=\"/browser/trunk(/images/.*?\\.png)\\?format=raw\"").matcher(s);
    165165        StringBuffer sb = new StringBuffer();
    166166        while (m.find()) {
    167167            String im = m.group(1);
    168             URL u = getClass().getResource(im);
     168            URL u = GettingStarted.class.getResource(im);
    169169            if (u != null) {
    170170                m.appendReplacement(sb, Matcher.quoteReplacement("src=\"" + u + '\"'));
Note: See TracChangeset for help on using the changeset viewer.