Merge pull request #2392 from Wevah/idna-5.1

IDNA support for 5.1
This commit is contained in:
Maurice Parker 2020-09-02 19:30:37 -05:00 committed by GitHub
commit a8ed04f2a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 11 deletions

View File

@ -43,7 +43,7 @@ struct Browser {
/// - Note: Some browsers (specifically Chromium-derived ones) will ignore the request
/// to open in the background.
static func open(_ urlString: String, inBackground: Bool) {
if let url = URL(string: urlString) {
if let url = URL(unicodeString: urlString) {
if let defaultBrowser = defaultBrowser {
defaultBrowser.openURL(url, inBackground: inBackground)
} else {

View File

@ -167,11 +167,11 @@ private extension WebFeedInspectorViewController {
}
func updateHomePageURL() {
homePageURLTextField?.stringValue = feed?.homePageURL ?? ""
homePageURLTextField?.stringValue = feed?.homePageURL?.decodedURLString ?? ""
}
func updateFeedURL() {
urlTextField?.stringValue = feed?.url ?? ""
urlTextField?.stringValue = feed?.url.decodedURLString ?? ""
}
func updateNotifyAboutNewArticles() {

View File

@ -91,7 +91,7 @@ class AddWebFeedWindowController : NSWindowController, AddFeedWindowController {
cancelSheet()
return;
}
guard let url = URL(string: normalizedURLString) else {
guard let url = URL(unicodeString: normalizedURLString) else {
cancelSheet()
return
}

View File

@ -145,16 +145,16 @@ private extension SidebarViewController {
}
if let homePageURL = webFeed.homePageURL, let _ = URL(string: homePageURL) {
let item = menuItem(NSLocalizedString("Open Home Page", comment: "Command"), #selector(openHomePageFromContextualMenu(_:)), homePageURL)
let item = menuItem(NSLocalizedString("Open Home Page", comment: "Command"), #selector(openHomePageFromContextualMenu(_:)), homePageURL.decodedURLString ?? homePageURL)
menu.addItem(item)
menu.addItem(NSMenuItem.separator())
}
let copyFeedURLItem = menuItem(NSLocalizedString("Copy Feed URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), webFeed.url)
let copyFeedURLItem = menuItem(NSLocalizedString("Copy Feed URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), webFeed.url.decodedURLString ?? webFeed.url)
menu.addItem(copyFeedURLItem)
if let homePageURL = webFeed.homePageURL {
let item = menuItem(NSLocalizedString("Copy Home Page URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), homePageURL)
let item = menuItem(NSLocalizedString("Copy Home Page URL", comment: "Command"), #selector(copyURLFromContextualMenu(_:)), homePageURL.decodedURLString ?? homePageURL)
menu.addItem(item)
}
menu.addItem(NSMenuItem.separator())

View File

@ -92,7 +92,7 @@ class AddWebFeedViewController: UITableViewController, AddContainerViewControlle
let urlString = urlTextField.text ?? ""
let normalizedURLString = urlString.normalizedURL
guard !normalizedURLString.isEmpty, let url = URL(string: normalizedURLString) else {
guard !normalizedURLString.isEmpty, let url = URL(unicodeString: normalizedURLString) else {
delegate?.processingDidCancel()
return
}

View File

@ -50,8 +50,8 @@ class WebFeedInspectorViewController: UITableViewController {
notifyAboutNewArticlesSwitch.setOn(webFeed.isNotifyAboutNewArticles ?? false, animated: false)
alwaysShowReaderViewSwitch.setOn(webFeed.isArticleExtractorAlwaysOn ?? false, animated: false)
homePageLabel.text = webFeed.homePageURL
feedURLLabel.text = webFeed.url
homePageLabel.text = webFeed.homePageURL?.decodedURLString
feedURLLabel.text = webFeed.url.decodedURLString
NotificationCenter.default.addObserver(self, selector: #selector(webFeedIconDidBecomeAvailable(_:)), name: .WebFeedIconDidBecomeAvailable, object: nil)

@ -1 +1 @@
Subproject commit 72754ca5b699af22c80d4326ca7ad74ec4a22c89
Subproject commit 0cee6eafda53e27ee6a4e1249a27a8b9d79d2aed