Skip to content

Incorrect RegExp in engine/browser_detection.dart #108999

@rakudrama

Description

@rakudrama

Source code here

/// Detects samsung blink variants.
///
///  Example patterns:
///    Note 2 : GT-N7100
///    Note 3 : SM-N900T
///    Tab 4 : SM-T330NU
///    Galaxy S4: SHV-E330S
///    Galaxy Note2: SHV-E250L
///    Note: SAMSUNG-SGH-I717
///    SPH/SCH are very old Palm models.
bool _isSamsungBrowser(String agent) {
  final RegExp exp = RegExp(
      r'SAMSUNG|SGH-[I|N|T]|GT-[I|N]|SM-[A|N|P|T|Z]|SHV-E|SCH-[I|J|R|S]|SPH-L');
  return exp.hasMatch(agent.toUpperCase());
}

| in a character classes [...] will match the | character.
It is likely that [I|N|T] should be either (I|N|T) or [INT]

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work liste: samsungIssues only reproducible on Samsung devicesengineflutter/engine related. See also e: labels.platform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions