Skip to content

Commit

Permalink
Revert "add more special char escaping"
Browse files Browse the repository at this point in the history
This reverts commit 40ca999.
  • Loading branch information
JoeMatt committed Dec 19, 2024
1 parent 40ca999 commit 108388f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
9 changes: 2 additions & 7 deletions PVLookup/Sources/OpenVGDB/OpenVGDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -338,13 +338,8 @@ public extension OpenVGDB {

// MARK: - Private Helpers
private extension OpenVGDB {
func escapeSQLString(_ input: String) -> String {
input.replacingOccurrences(of: "'", with: "''")
.replacingOccurrences(of: "(", with: "\\(")
.replacingOccurrences(of: ")", with: "\\)")
.replacingOccurrences(of: "[", with: "\\[")
.replacingOccurrences(of: "]", with: "\\]")
.replacingOccurrences(of: "!", with: "\\!")
func escapeSQLString(_ string: String) -> String {
return string.replacingOccurrences(of: "'", with: "''")
}

func escapeLikePattern(_ pattern: String) -> String {
Expand Down
11 changes: 1 addition & 10 deletions PVLookup/Sources/TheGamesDB/TheGamesDB.swift
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public final class TheGamesDB: ArtworkLookupService, @unchecked Sendable {
return nil
}


return ROMMetadata(
gameTitle: gameTitle,
region: game["region"] as? String,
Expand Down Expand Up @@ -401,12 +401,3 @@ private extension String {
return digest.map { String(format: "%02hhx", $0) }.joined()
}
}

private func escapeSQLString(_ input: String) -> String {
input.replacingOccurrences(of: "'", with: "''")
.replacingOccurrences(of: "(", with: "\\(")
.replacingOccurrences(of: ")", with: "\\)")
.replacingOccurrences(of: "[", with: "\\[")
.replacingOccurrences(of: "]", with: "\\]")
.replacingOccurrences(of: "!", with: "\\!")
}
3 changes: 0 additions & 3 deletions PVLookup/Sources/libretrodb/libretrodb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,5 @@ extension libretrodb {
input.replacingOccurrences(of: "'", with: "''")
.replacingOccurrences(of: "(", with: "\\(")
.replacingOccurrences(of: ")", with: "\\)")
.replacingOccurrences(of: "[", with: "\\[")
.replacingOccurrences(of: "]", with: "\\]")
.replacingOccurrences(of: "!", with: "\\!")
}
}

0 comments on commit 108388f

Please sign in to comment.