From 531c40a059d24883b35b6282e13a8a0047fb0cb9 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 19 Jan 2020 22:52:45 -0700 Subject: [PATCH 1/2] Escape special XML characters for external folder id. Issue #1659 --- Frameworks/Account/Folder.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/Account/Folder.swift b/Frameworks/Account/Folder.swift index 2123da05b..1cff74267 100644 --- a/Frameworks/Account/Folder.swift +++ b/Frameworks/Account/Folder.swift @@ -177,7 +177,7 @@ extension Folder: OPMLRepresentable { let attrExternalID: String = { if allowCustomAttributes, let externalID = externalID { - return " nnw_externalID=\"\(externalID)\"" + return " nnw_externalID=\"\(externalID.escapingSpecialXMLCharacters)\"" } else { return "" } From e183345f98440fe321e5b0d16039e2be2a2f38e0 Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 19 Jan 2020 23:12:02 -0700 Subject: [PATCH 2/2] Stop suppressing the Confirm Mark as Read setting for iPads. Issue #1660 --- iOS/Settings/SettingsViewController.swift | 43 +++++------------------ 1 file changed, 8 insertions(+), 35 deletions(-) diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index 0a8a3755e..c0e12bfce 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -99,50 +99,28 @@ class SettingsViewController: UITableViewController { // MARK: UITableView - override func numberOfSections(in tableView: UITableView) -> Int { - var sections = super.numberOfSections(in: tableView) - if traitCollection.userInterfaceIdiom != .phone { - sections = sections - 1 - } - return sections - } - override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - var adjustedSection = section - if traitCollection.userInterfaceIdiom != .phone && section > 3 { - adjustedSection = adjustedSection + 1 - } - switch adjustedSection { + switch section { case 1: return AccountManager.shared.accounts.count + 1 case 2: - let defaultNumberOfRows = super.tableView(tableView, numberOfRowsInSection: adjustedSection) + let defaultNumberOfRows = super.tableView(tableView, numberOfRowsInSection: section) if AccountManager.shared.activeAccounts.isEmpty || AccountManager.shared.anyAccountHasFeedWithURL(appNewsURLString) { return defaultNumberOfRows - 1 } return defaultNumberOfRows + case 4: + return traitCollection.userInterfaceIdiom == .phone ? 2 : 1 default: - return super.tableView(tableView, numberOfRowsInSection: adjustedSection) + return super.tableView(tableView, numberOfRowsInSection: section) } } - override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - var adjustedSection = section - if traitCollection.userInterfaceIdiom != .phone && adjustedSection > 3 { - adjustedSection = adjustedSection + 1 - } - return super.tableView(tableView, titleForHeaderInSection: adjustedSection) - } - override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - var adjustedSection = indexPath.section - if traitCollection.userInterfaceIdiom != .phone && adjustedSection > 3 { - adjustedSection = adjustedSection + 1 - } let cell: UITableViewCell - switch adjustedSection { + switch indexPath.section { case 1: let sortedAccounts = AccountManager.shared.sortedAccounts @@ -159,8 +137,7 @@ class SettingsViewController: UITableViewController { } default: - let adjustedIndexPath = IndexPath(row: indexPath.row, section: adjustedSection) - cell = super.tableView(tableView, cellForRowAt: adjustedIndexPath) + cell = super.tableView(tableView, cellForRowAt: indexPath) } @@ -168,12 +145,8 @@ class SettingsViewController: UITableViewController { } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - var adjustedSection = indexPath.section - if traitCollection.userInterfaceIdiom != .phone && adjustedSection > 3 { - adjustedSection = adjustedSection + 1 - } - switch adjustedSection { + switch indexPath.section { case 0: UIApplication.shared.open(URL(string: "\(UIApplication.openSettingsURLString)")!) tableView.selectRow(at: nil, animated: true, scrollPosition: .none)