Don’t write "Untitled" to Subscriptions.opml when a feed lacks a name or editedName — “Untitled” is a localizable, display-only string, not something to store in OPML. Fix #527.
This commit is contained in:
parent
aadf4ec09f
commit
eb3c69f4d0
|
@ -231,8 +231,18 @@ public final class Feed: DisplayNameProvider, Renamable, UnreadCountProvider, Ha
|
|||
extension Feed: OPMLRepresentable {
|
||||
|
||||
public func OPMLString(indentLevel: Int) -> String {
|
||||
// https://github.com/brentsimmons/NetNewsWire/issues/527
|
||||
// Don’t use nameForDisplay because that can result in a feed name "Untitled" written to disk,
|
||||
// which NetNewsWire may take later to be the actual name.
|
||||
var nameToUse = editedName
|
||||
if nameToUse == nil {
|
||||
nameToUse = name
|
||||
}
|
||||
if nameToUse == nil {
|
||||
nameToUse = ""
|
||||
}
|
||||
let escapedName = nameToUse!.rs_stringByEscapingSpecialXMLCharacters()
|
||||
|
||||
let escapedName = nameForDisplay.rs_stringByEscapingSpecialXMLCharacters()
|
||||
var escapedHomePageURL = ""
|
||||
if let homePageURL = homePageURL {
|
||||
escapedHomePageURL = homePageURL.rs_stringByEscapingSpecialXMLCharacters()
|
||||
|
|
Loading…
Reference in New Issue