Skip to content

Commit

Permalink
fix overly permissive regexs (#1235)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyc3 authored Jan 18, 2024
1 parent bf0e882 commit 827543b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/services/dailymotion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default class DailyMotionAdapter extends ServiceAdapter {
}

async fetchVideoInfo(videoId: string): Promise<Video> {
if (!/^[A-za-z0-9]+$/.exec(videoId)) {
if (!/^[A-Za-z0-9]+$/.exec(videoId)) {
throw new InvalidVideoIdException(this.serviceId, videoId);
}

Expand Down
2 changes: 1 addition & 1 deletion server/services/googledrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class GoogleDriveAdapter extends ServiceAdapter {
}

async fetchVideoInfo(videoId: string): Promise<Video> {
if (!/^[A-za-z0-9_-]+$/.exec(videoId)) {
if (!/^[A-Za-z0-9_-]+$/.exec(videoId)) {
throw new InvalidVideoIdException(this.serviceId, videoId);
}

Expand Down
2 changes: 1 addition & 1 deletion server/services/youtube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default class YouTubeAdapter extends ServiceAdapter {
}

for (const id of ids) {
if (!/^[A-za-z0-9_-]+$/.exec(id)) {
if (!/^[A-Za-z0-9_-]+$/.exec(id)) {
throw new InvalidVideoIdException(this.serviceId, id);
}
}
Expand Down

0 comments on commit 827543b

Please sign in to comment.