this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix issue with site loading on older versions of Safari (#10077)

authored by

DS Boyce and committed by
GitHub
3e7d7ce5 876e2016

+4 -2
+4 -2
src/lib/media/util.ts
··· 36 36 | 'feed_thumbnail' 37 37 | 'download' 38 38 39 + // Using capturing groups here instead of lookbehinds in order to support older versions of Safari. 40 + // https://bugs.webkit.org/show_bug.cgi?id=174931 39 41 const IMGPROXY_PRESET_RE = 40 - /(?<=\/img\/)(default|avatar_thumbnail|avatar|banner|feed_fullsize|feed_thumbnail|download)(?=\/)/ 42 + /(\/img\/)(default|avatar_thumbnail|avatar|banner|feed_fullsize|feed_thumbnail|download)(\/)/ 41 43 42 44 /** 43 45 * Replaces any imgproxy preset in a CDN URI with the given preset. 44 46 */ 45 47 export function convertCdnPreset(uri: string, preset: ImgproxyPreset): string { 46 - return uri.replace(IMGPROXY_PRESET_RE, preset) 48 + return uri.replace(IMGPROXY_PRESET_RE, `$1${preset}$3`) 47 49 }