Skip to content

Commit

Permalink
Merge pull request #19055 from Expensify/OSBotify-cherry-pick-staging…
Browse files Browse the repository at this point in the history
…-18521

🍒 Cherry pick PR #18521 to staging 🍒
  • Loading branch information
OSBotify authored May 16, 2023
2 parents 7b022b6 + 5476be8 commit 854f9b2
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 12 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001031411
versionName "1.3.14-11"
versionCode 1001031412
versionName "1.3.14-12"
}

splits {
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensify/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.3.14.11</string>
<string>1.3.14.12</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
Expand Down
2 changes: 1 addition & 1 deletion ios/NewExpensifyTests/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.14.11</string>
<string>1.3.14.12</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new.expensify",
"version": "1.3.14-11",
"version": "1.3.14-12",
"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.",
Expand Down
57 changes: 56 additions & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,62 @@ const CONST = {

API_ATTACHMENT_VALIDATIONS: {
// Same as the PHP layer allows
ALLOWED_EXTENSIONS: ['webp', 'jpg', 'jpeg', 'png', 'gif', 'pdf', 'html', 'txt', 'rtf', 'doc', 'docx', 'htm', 'tiff', 'tif', 'xml', 'mp3', 'mp4', 'mov'],
/* eslint-disable-next-line max-len */
UNALLOWED_EXTENSIONS: [
'ade',
'adp',
'apk',
'appx',
'appxbundle',
'bat',
'cab',
'chm',
'cmd',
'com',
'cpl',
'diagcab',
'diagcfg',
'diagpack',
'dll',
'dmg',
'ex',
'ex_',
'exe',
'hta',
'img',
'ins',
'iso',
'isp',
'jar',
'jnlp',
'js',
'jse',
'lib',
'lnk',
'mde',
'msc',
'msi',
'msix',
'msixbundle',
'msp',
'mst',
'nsh',
'pif',
'ps1',
'scr',
'sct',
'shb',
'sys',
'vb',
'vbe',
'vbs',
'vhd',
'vxd',
'wsc',
'wsf',
'wsh',
'xll',
],

// 24 megabytes in bytes, this is limit set on servers, do not update without wider internal discussion
MAX_SIZE: 25165824,
Expand Down
4 changes: 2 additions & 2 deletions src/components/AttachmentModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ class AttachmentModal extends PureComponent {
*/
isValidFile(file) {
const {fileExtension} = FileUtils.splitExtensionFromFileName(lodashGet(file, 'name', ''));
if (!_.contains(CONST.API_ATTACHMENT_VALIDATIONS.ALLOWED_EXTENSIONS, fileExtension.toLowerCase())) {
const invalidReason = `${this.props.translate('attachmentPicker.notAllowedExtension')} ${CONST.API_ATTACHMENT_VALIDATIONS.ALLOWED_EXTENSIONS.join(', ')}`;
if (_.contains(CONST.API_ATTACHMENT_VALIDATIONS.UNALLOWED_EXTENSIONS, fileExtension.toLowerCase())) {
const invalidReason = this.props.translate('attachmentPicker.notAllowedExtension');
this.setState({
isAttachmentInvalid: true,
attachmentInvalidReasonTitle: this.props.translate('attachmentPicker.wrongFileType'),
Expand Down
2 changes: 1 addition & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default {
attachmentTooSmall: 'Attachment too small',
sizeNotMet: 'Attachment size must be greater than 240 bytes.',
wrongFileType: 'Attachment is the wrong type',
notAllowedExtension: 'Attachments must be one of the following types:',
notAllowedExtension: 'This filetype is not allowed',
},
avatarCropModal: {
title: 'Edit photo',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default {
attachmentTooSmall: 'Archivo adjunto demasiado pequeño',
sizeNotMet: 'El archivo adjunto debe ser mas grande que 240 bytes.',
wrongFileType: 'El tipo del archivo adjunto es incorrecto',
notAllowedExtension: 'Los archivos adjuntos deben ser de uno de los siguientes tipos:',
notAllowedExtension: 'Este tipo de archivo no está permitido',
},
avatarCropModal: {
title: 'Editar foto',
Expand Down

0 comments on commit 854f9b2

Please sign in to comment.