From 76f49ba10e6bc94e384f52a2c3a45c83a40f4aa3 Mon Sep 17 00:00:00 2001 From: OSBotify <76178356+OSBotify@users.noreply.github.com> Date: Fri, 24 Mar 2023 12:29:13 -0400 Subject: [PATCH 1/2] Merge pull request #16480 from Expensify/version-BUILD-326A2985-2668-48D5-8461-B2C23252731A Update version to 1.2.88-2 on main (cherry picked from commit 68435f0178f84fe66690e85a76be1cd1bad87590) --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 80742df30297..fea7357aafe4 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -156,8 +156,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001028801 - versionName "1.2.88-1" + versionCode 1001028802 + versionName "1.2.88-2" buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() if (isNewArchitectureEnabled()) { diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 7487f1fd4585..524bc419700f 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.2.88.1 + 1.2.88.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 194f69ecee8a..12a17ae7fc2e 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.2.88.1 + 1.2.88.2 diff --git a/package-lock.json b/package-lock.json index 8e00b3820321..07027168a4dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.2.88-1", + "version": "1.2.88-2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.2.88-1", + "version": "1.2.88-2", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index ac4bd0bade4a..c38f8b2d2dee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.2.88-1", + "version": "1.2.88-2", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From bc77d3c3006b51a04bd129646e47d39bff5ce79a Mon Sep 17 00:00:00 2001 From: Andrew Gable Date: Fri, 24 Mar 2023 10:10:53 -0600 Subject: [PATCH 2/2] Merge pull request #16441 from hellohublot/16354_getSmallSizeAvatar_cloudfront Fix getSmallSizeAvatar to block url is not from cloudfront (cherry picked from commit 43506832336c0eab0775383c62593c65f99bdd6a) --- src/CONST.js | 4 +++- src/libs/ReportUtils.js | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/CONST.js b/src/CONST.js index bc9850a3dec8..cdfb603093ee 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -2,7 +2,8 @@ import lodashGet from 'lodash/get'; import Config from 'react-native-config'; import * as Url from './libs/Url'; -const CLOUDFRONT_URL = 'https://d2k5nsl2zxldvw.cloudfront.net'; +const CLOUDFRONT_DOMAIN = 'cloudfront.net'; +const CLOUDFRONT_URL = `https://d2k5nsl2zxldvw.${CLOUDFRONT_DOMAIN}`; const ACTIVE_EXPENSIFY_URL = Url.addTrailingForwardSlash(lodashGet(Config, 'NEW_EXPENSIFY_URL', 'https://new.expensify.com')); const USE_EXPENSIFY_URL = 'https://use.expensify.com'; const PLATFORM_OS_MACOS = 'Mac OS'; @@ -289,6 +290,7 @@ const CONST = { GOOGLE_MEET_URL_ANDROID: 'https://meet.google.com', DEEPLINK_BASE_URL: 'new-expensify://', PDF_VIEWER_URL: '/pdf/web/viewer.html', + CLOUDFRONT_DOMAIN_REGEX: /^https:\/\/\w+\.cloudfront\.net/i, EXPENSIFY_ICON_URL: `${CLOUDFRONT_URL}/images/favicon-2019.png`, CONCIERGE_ICON_URL: `${CLOUDFRONT_URL}/images/icons/concierge_2022.png`, UPWORK_URL: 'https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3A%22Help+Wanted%22', diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index b7757743b7ca..90c9528e12eb 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -571,6 +571,11 @@ function getSmallSizeAvatar(avatarURL, login) { return source; } + // Because other urls than CloudFront do not support dynamic image sizing (_SIZE suffix), the current source is already what we want to use here. + if (!CONST.CLOUDFRONT_DOMAIN_REGEX.test(source)) { + return source; + } + // If image source already has _128 at the end, the given avatar URL is already what we want to use here. const lastPeriodIndex = source.lastIndexOf('.'); if (source.substring(lastPeriodIndex - 4, lastPeriodIndex) === '_128') {