diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index 02fc93da75..fe461c309f 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -7,6 +7,6 @@ jobs: permissions: pull-requests: write steps: - - uses: actions/labeler@4.1.0 + - uses: actions/labeler@v4.3.0 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/Gemfile b/Gemfile index d13be903e9..94b80f72ff 100644 --- a/Gemfile +++ b/Gemfile @@ -1,8 +1,8 @@ source "https://rubygems.org" ruby "3.2.1" -gem "fastlane", "2.212.1" -gem "cocoapods", "1.12.0" +gem "fastlane", "2.214.0" +gem "cocoapods", "1.12.1" gem "generamba", "1.5.0" eval_gemfile("fastlane/Pluginfile") diff --git a/Gemfile.lock b/Gemfile.lock index 08609515af..0b31c69587 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,12 +3,12 @@ GEM specs: CFPropertyList (3.0.6) rexml - activesupport (7.0.4.3) + activesupport (7.0.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - addressable (2.8.2) + addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) algoliasearch (1.27.5) httpclient (~> 2.8, >= 2.8.3) @@ -16,27 +16,27 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.739.0) - aws-sdk-core (3.171.0) + aws-partitions (1.819.0) + aws-sdk-core (3.181.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.63.0) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-kms (1.71.0) + aws-sdk-core (~> 3, >= 3.177.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.120.0) - aws-sdk-core (~> 3, >= 3.165.0) + aws-sdk-s3 (1.134.0) + aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.5.2) + aws-sigv4 (~> 1.6) + aws-sigv4 (1.6.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) - cocoapods (1.12.0) + cocoapods (1.12.1) addressable (~> 2.8) claide (>= 1.0.2, < 2.0) - cocoapods-core (= 1.12.0) + cocoapods-core (= 1.12.1) cocoapods-deintegrate (>= 1.0.3, < 2.0) cocoapods-downloader (>= 1.6.0, < 2.0) cocoapods-plugins (>= 1.0.0, < 2.0) @@ -51,7 +51,7 @@ GEM nap (~> 1.0) ruby-macho (>= 2.3.0, < 3.0) xcodeproj (>= 1.21.0, < 2.0) - cocoapods-core (1.12.0) + cocoapods-core (1.12.1) activesupport (>= 5.0, < 8) addressable (~> 2.8) algoliasearch (~> 1.0) @@ -76,7 +76,7 @@ GEM highline (~> 2.0.0) concurrent-ruby (1.2.2) declarative (0.0.20) - digest-crc (0.6.4) + digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -85,7 +85,7 @@ GEM escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - excon (0.99.0) + excon (0.102.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -114,8 +114,8 @@ GEM faraday-retry (1.0.3) faraday_middleware (1.2.0) faraday (~> 1.0) - fastimage (2.2.6) - fastlane (2.212.1) + fastimage (2.2.7) + fastlane (2.214.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -139,7 +139,7 @@ GEM json (< 3.0.0) jwt (>= 2.1.0, < 3) mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (~> 2.0.0) + multipart-post (>= 2.0.0, < 3.0.0) naturally (~> 2.2) optparse (~> 0.1.1) plist (>= 3.1.0, < 4.0.0) @@ -154,7 +154,8 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-firebase_app_distribution (0.5.0) + fastlane-plugin-firebase_app_distribution (0.7.3) + google-apis-firebaseappdistribution_v1 (~> 0.3.0) ffi (1.15.5) fourflusher (2.3.1) fuzzy_match (2.0.4) @@ -167,9 +168,9 @@ GEM xcodeproj (>= 1.5.0, < 2.0.0) gh_inspector (1.1.3) git (1.2.9.1) - google-apis-androidpublisher_v3 (0.38.0) + google-apis-androidpublisher_v3 (0.49.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.0) + google-apis-core (0.11.1) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -178,6 +179,8 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick + google-apis-firebaseappdistribution_v1 (0.3.0) + google-apis-core (>= 0.11.0, < 2.a) google-apis-iamcredentials_v1 (0.17.0) google-apis-core (>= 0.11.0, < 2.a) google-apis-playcustomapp_v1 (0.13.0) @@ -198,10 +201,9 @@ GEM google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) - googleauth (1.5.0) + googleauth (1.8.0) faraday (>= 0.17.3, < 3.a) jwt (>= 1.4, < 3.0) - memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) @@ -209,19 +211,18 @@ GEM http-cookie (1.0.5) domain_name (~> 0.5) httpclient (2.8.3) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) jmespath (1.6.2) json (2.6.3) - jwt (2.7.0) + jwt (2.7.1) liquid (4.0.0) - memoist (0.16.2) mini_magick (4.12.0) - mini_mime (1.1.2) - minitest (5.18.0) + mini_mime (1.1.5) + minitest (5.20.0) molinillo (0.8.0) multi_json (1.15.0) - multipart-post (2.0.0) + multipart-post (2.3.0) nanaimo (0.3.0) nap (1.1.0) naturally (2.2.1) @@ -236,13 +237,13 @@ GEM trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.5) + rexml (3.2.6) rouge (2.0.7) ruby-macho (2.5.1) ruby2_keywords (0.0.5) rubyzip (2.3.2) security (0.1.3) - signet (0.17.0) + signet (0.18.0) addressable (~> 2.8) faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) @@ -284,8 +285,8 @@ PLATFORMS ruby DEPENDENCIES - cocoapods (= 1.12.0) - fastlane (= 2.212.1) + cocoapods (= 1.12.1) + fastlane (= 2.214.0) fastlane-plugin-firebase_app_distribution generamba (= 1.5.0) diff --git a/Podfile.lock b/Podfile.lock index 1788a66dc8..fa7d53e176 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -425,4 +425,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 75718f193cfc7924dbc1854e38c62a6d03cc46c6 -COCOAPODS: 1.12.0 +COCOAPODS: 1.12.1 diff --git a/Stepic.xcodeproj/project.pbxproj b/Stepic.xcodeproj/project.pbxproj index eb04c33cbb..e400ae7119 100644 --- a/Stepic.xcodeproj/project.pbxproj +++ b/Stepic.xcodeproj/project.pbxproj @@ -1165,6 +1165,7 @@ 2CE532F7266E965600E80983 /* course-benefit-summaries.json in Resources */ = {isa = PBXBuildFile; fileRef = 2CE532F6266E965600E80983 /* course-benefit-summaries.json */; }; 2CE532F9266EB02200E80983 /* CourseBenefitSummariesAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE532F8266EB02200E80983 /* CourseBenefitSummariesAPI.swift */; }; 2CE532FB266EB0A400E80983 /* CourseBenefitSummariesPersistenceService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE532FA266EB0A400E80983 /* CourseBenefitSummariesPersistenceService.swift */; }; + 2CE619E82AB2F98100E5CA55 /* String+URLValidation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE619E72AB2F98100E5CA55 /* String+URLValidation.swift */; }; 2CE61D832412960500DA2CBA /* SpotlightSearchableItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE61D822412960500DA2CBA /* SpotlightSearchableItem.swift */; }; 2CE61D852412961500DA2CBA /* SpotlightDomainIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE61D842412961500DA2CBA /* SpotlightDomainIdentifier.swift */; }; 2CE664E320F5207A0082F3FE /* Downloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CE664DF20F520790082F3FE /* Downloader.swift */; }; @@ -3267,6 +3268,7 @@ 2CE532F6266E965600E80983 /* course-benefit-summaries.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "course-benefit-summaries.json"; sourceTree = ""; }; 2CE532F8266EB02200E80983 /* CourseBenefitSummariesAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseBenefitSummariesAPI.swift; sourceTree = ""; }; 2CE532FA266EB0A400E80983 /* CourseBenefitSummariesPersistenceService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseBenefitSummariesPersistenceService.swift; sourceTree = ""; }; + 2CE619E72AB2F98100E5CA55 /* String+URLValidation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+URLValidation.swift"; sourceTree = ""; }; 2CE61D822412960500DA2CBA /* SpotlightSearchableItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotlightSearchableItem.swift; sourceTree = ""; }; 2CE61D842412961500DA2CBA /* SpotlightDomainIdentifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpotlightDomainIdentifier.swift; sourceTree = ""; }; 2CE664DF20F520790082F3FE /* Downloader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Downloader.swift; sourceTree = ""; }; @@ -4531,6 +4533,7 @@ 2CFED65E252C5AC900FCAD41 /* Result+Stepik.swift */, 2C9A8D2D22D348A5009434DB /* String+HTMLEscape.swift */, 2C546C1223DA02AB00352F27 /* String+SafeSubscript.swift */, + 2CE619E72AB2F98100E5CA55 /* String+URLValidation.swift */, 2C6D61AD24D93E4500D019F2 /* String+Whitespaces.swift */, ); path = SwiftStdlib; @@ -11614,6 +11617,7 @@ 08F485A51C57AF2E000165AA /* FreeAnswerReply.swift in Sources */, 2C85FCEE26FDE60700BD6BB9 /* CourseInfoTabNewsBadgeView.swift in Sources */, 2C0A10A7268B279A001D4023 /* CourseBenefitByMonthsAPI.swift in Sources */, + 2CE619E82AB2F98100E5CA55 /* String+URLValidation.swift in Sources */, 2CCB4B1A26E77CED0056C44E /* AnnouncementsAPI.swift in Sources */, 08C1FC331F41E74500E14B46 /* QuizPresenter.swift in Sources */, 2C604E21207E4609001588FB /* CodeEditorPreviewView.swift in Sources */, @@ -13294,7 +13298,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; @@ -13319,7 +13323,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Production.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -13461,7 +13465,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Production.plist"; @@ -13491,7 +13495,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; @@ -13582,7 +13586,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13634,7 +13638,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; @@ -13715,7 +13719,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Develop.plist"; @@ -13763,7 +13767,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Develop.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; @@ -14283,7 +14287,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14337,7 +14341,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; @@ -14419,7 +14423,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; ENABLE_BITCODE = NO; INFOPLIST_FILE = "Stepic/Info-Release.plist"; @@ -14467,7 +14471,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 432; + CURRENT_PROJECT_VERSION = 435; DEVELOPMENT_TEAM = UJ4KC2QN7B; INFOPLIST_FILE = "StickerPackExtension/Info-Release.plist"; IPHONEOS_DEPLOYMENT_TARGET = 12.0; diff --git a/Stepic.xcodeproj/xcshareddata/xcschemes/Stepic Production.xcscheme b/Stepic.xcodeproj/xcshareddata/xcschemes/Stepic Production.xcscheme index 368492f397..7ae546d13f 100644 --- a/Stepic.xcodeproj/xcshareddata/xcschemes/Stepic Production.xcscheme +++ b/Stepic.xcodeproj/xcshareddata/xcschemes/Stepic Production.xcscheme @@ -1,7 +1,7 @@ + version = "1.8"> diff --git a/Stepic/Info-Develop.plist b/Stepic/Info-Develop.plist index a208aa71a5..a7916a75dc 100644 --- a/Stepic/Info-Develop.plist +++ b/Stepic/Info-Develop.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.218-develop + 1.219-develop CFBundleSignature ???? CFBundleURLTypes @@ -62,7 +62,7 @@ CFBundleVersion - 432 + 435 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Production.plist b/Stepic/Info-Production.plist index b3a9ed6591..f70fb21b06 100644 --- a/Stepic/Info-Production.plist +++ b/Stepic/Info-Production.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.218 + 1.219 CFBundleSignature ???? CFBundleURLTypes @@ -62,7 +62,7 @@ CFBundleVersion - 432 + 435 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Info-Release.plist b/Stepic/Info-Release.plist index cff8a372e2..749f9ab56f 100644 --- a/Stepic/Info-Release.plist +++ b/Stepic/Info-Release.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.218-release + 1.219-release CFBundleSignature ???? CFBundleURLTypes @@ -62,7 +62,7 @@ CFBundleVersion - 432 + 435 FacebookAppID 171127739724012 FacebookDisplayName diff --git a/Stepic/Legacy/Model/Entities/Course/Course+CoreDataProperties.swift b/Stepic/Legacy/Model/Entities/Course/Course+CoreDataProperties.swift index 052cfce186..53b386f0ef 100644 --- a/Stepic/Legacy/Model/Entities/Course/Course+CoreDataProperties.swift +++ b/Stepic/Legacy/Model/Entities/Course/Course+CoreDataProperties.swift @@ -215,7 +215,7 @@ extension Course { self.managedImageURL = url } get { - managedImageURL ?? "http://www.yoprogramo.com/wp-content/uploads/2015/08/human-error-in-finance-640x324.jpg" + managedImageURL ?? "" } } diff --git a/Stepic/Legacy/Model/Entities/Course/Course.swift b/Stepic/Legacy/Model/Entities/Course/Course.swift index 1209d41ca6..1ee5c8de02 100644 --- a/Stepic/Legacy/Model/Entities/Course/Course.swift +++ b/Stepic/Legacy/Model/Entities/Course/Course.swift @@ -106,7 +106,9 @@ final class Course: NSManagedObject, ManagedObject, IDFetchable { self.id = json[JSONKey.id.rawValue].intValue self.title = json[JSONKey.title.rawValue].stringValue self.courseDescription = json[JSONKey.description.rawValue].stringValue - self.coverURLString = "\(StepikApplicationsInfo.stepikURL)" + json[JSONKey.cover.rawValue].stringValue + + let cover = json[JSONKey.cover.rawValue].stringValue + self.coverURLString = cover.isValidHttpUrl ? cover : "\(StepikApplicationsInfo.stepikURL)\(cover)" self.beginDate = Parser.dateFromTimedateJSON(json[JSONKey.beginDate.rawValue]) self.endDate = Parser.dateFromTimedateJSON(json[JSONKey.endDate.rawValue]) diff --git a/Stepic/Legacy/Model/Entities/User/User+CoreDataProperties.swift b/Stepic/Legacy/Model/Entities/User/User+CoreDataProperties.swift index 6c8b11b306..e53e746ff3 100644 --- a/Stepic/Legacy/Model/Entities/User/User+CoreDataProperties.swift +++ b/Stepic/Legacy/Model/Entities/User/User+CoreDataProperties.swift @@ -154,7 +154,7 @@ extension User { managedAvatarURL = value } get { - managedAvatarURL ?? "http://www.yoprogramo.com/wp-content/uploads/2015/08/human-error-in-finance-640x324.jpg" + managedAvatarURL ?? "" } } diff --git a/Stepic/Sources/Extensions/SwiftStdlib/String+URLValidation.swift b/Stepic/Sources/Extensions/SwiftStdlib/String+URLValidation.swift new file mode 100644 index 0000000000..29890696d8 --- /dev/null +++ b/Stepic/Sources/Extensions/SwiftStdlib/String+URLValidation.swift @@ -0,0 +1,15 @@ +import Foundation + +extension String { + /// Check if string is a valid http protocol URL. + /// + /// `"http://google.com".isValidHttpUrl -> true` + /// `"https://google.com".isValidHttpsUrl -> true` + var isValidHttpUrl: Bool { + guard let url = URL(string: self) else { + return false + } + + return ["http", "https"].contains(url.scheme) + } +} diff --git a/Stepic/Sources/Modules/NewProfile/NewProfilePresenter.swift b/Stepic/Sources/Modules/NewProfile/NewProfilePresenter.swift index 89b86bda1b..c937cb6a18 100644 --- a/Stepic/Sources/Modules/NewProfile/NewProfilePresenter.swift +++ b/Stepic/Sources/Modules/NewProfile/NewProfilePresenter.swift @@ -90,8 +90,9 @@ final class NewProfilePresenter: NewProfilePresenterProtocol { private func makeHeaderViewModel(user: User) -> NewProfileHeaderViewModel { let coverURL: URL? = { if let cover = user.cover { - let urlString = "\(StepikApplicationsInfo.stepikURL)\(cover)" - return URL(string: urlString) + return cover.isValidHttpUrl + ? URL(string: cover) + : URL(string: "\(StepikApplicationsInfo.stepikURL)\(cover)") } return nil }() diff --git a/StepicTests/Info-Develop.plist b/StepicTests/Info-Develop.plist index 1d022c9ee2..a7fe6160d3 100644 --- a/StepicTests/Info-Develop.plist +++ b/StepicTests/Info-Develop.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.218-develop + 1.219-develop CFBundleSignature ???? CFBundleVersion - 432 + 435 diff --git a/StepicTests/Info-Production.plist b/StepicTests/Info-Production.plist index 81b7e015f4..f5b9fb02f6 100644 --- a/StepicTests/Info-Production.plist +++ b/StepicTests/Info-Production.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.218 + 1.219 CFBundleSignature ???? CFBundleVersion - 432 + 435 diff --git a/StepicTests/Info-Release.plist b/StepicTests/Info-Release.plist index 3219e24a16..9e8df74776 100644 --- a/StepicTests/Info-Release.plist +++ b/StepicTests/Info-Release.plist @@ -15,10 +15,10 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 1.218-release + 1.219-release CFBundleSignature ???? CFBundleVersion - 432 + 435 diff --git a/StepicUITests/Info-Develop.plist b/StepicUITests/Info-Develop.plist index 0ec59ca193..2a5a5f0ff3 100644 --- a/StepicUITests/Info-Develop.plist +++ b/StepicUITests/Info-Develop.plist @@ -15,8 +15,8 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.218-develop + 1.219-develop CFBundleVersion - 432 + 435 diff --git a/StepicUITests/Info-Production.plist b/StepicUITests/Info-Production.plist index 2725f77a30..51ba2b70d0 100644 --- a/StepicUITests/Info-Production.plist +++ b/StepicUITests/Info-Production.plist @@ -15,8 +15,8 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.218 + 1.219 CFBundleVersion - 432 + 435 diff --git a/StepicUITests/Info-Release.plist b/StepicUITests/Info-Release.plist index be3833f798..1d7193bef6 100644 --- a/StepicUITests/Info-Release.plist +++ b/StepicUITests/Info-Release.plist @@ -15,8 +15,8 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.218-release + 1.219-release CFBundleVersion - 432 + 435 diff --git a/StepicWidget/Info-Develop.plist b/StepicWidget/Info-Develop.plist index 6a345568ed..789f51dc01 100644 --- a/StepicWidget/Info-Develop.plist +++ b/StepicWidget/Info-Develop.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.218-develop + 1.219-develop CFBundleVersion - 432 + 435 NSExtension NSExtensionPointIdentifier diff --git a/StepicWidget/Info-Production.plist b/StepicWidget/Info-Production.plist index f2ff512ff6..77b88d5237 100644 --- a/StepicWidget/Info-Production.plist +++ b/StepicWidget/Info-Production.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.218 + 1.219 CFBundleVersion - 432 + 435 NSExtension NSExtensionPointIdentifier diff --git a/StepicWidget/Info-Release.plist b/StepicWidget/Info-Release.plist index 632d42a24c..8f1cbe5227 100644 --- a/StepicWidget/Info-Release.plist +++ b/StepicWidget/Info-Release.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 1.218-release + 1.219-release CFBundleVersion - 432 + 435 NSExtension NSExtensionPointIdentifier diff --git a/StickerPackExtension/Info-Develop.plist b/StickerPackExtension/Info-Develop.plist index e2a83b23f7..7d6d880481 100644 --- a/StickerPackExtension/Info-Develop.plist +++ b/StickerPackExtension/Info-Develop.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.218-develop + 1.219-develop CFBundleVersion - 432 + 435 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Production.plist b/StickerPackExtension/Info-Production.plist index bc2612cfc7..bdeaec1b46 100644 --- a/StickerPackExtension/Info-Production.plist +++ b/StickerPackExtension/Info-Production.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.218 + 1.219 CFBundleVersion - 432 + 435 UIRequiredDeviceCapabilities arm64 diff --git a/StickerPackExtension/Info-Release.plist b/StickerPackExtension/Info-Release.plist index 9fdf7de5fe..258e224c30 100644 --- a/StickerPackExtension/Info-Release.plist +++ b/StickerPackExtension/Info-Release.plist @@ -17,9 +17,9 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 1.218-release + 1.219-release CFBundleVersion - 432 + 435 UIRequiredDeviceCapabilities arm64 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 9d78943d78..562b1b4459 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,4 +1,4 @@ -fastlane_version "2.212.1" +fastlane_version "2.214.0" default_platform :ios