Browse files

platform: Escape a regexp character for Firefox 1.0.7 support.

  • Loading branch information...
1 parent 66b87f3 commit f24fb366df28ecfba49ee81aaf4fbbd0706dbbde @jdalton jdalton committed Jan 6, 2012
Showing with 13 additions and 12 deletions.
  1. +10 −10 docs/README.md
  2. +3 −2 platform.js
View
20 docs/README.md
@@ -35,7 +35,7 @@
<!-- div -->
-### <a id="platform" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L792" title="View in source">`platform`</a>
+### <a id="platform" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L793" title="View in source">`platform`</a>
*(Object)*: The platform object.
[&#9650;][1]
@@ -44,7 +44,7 @@
<!-- div -->
-### <a id="platform.description" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L822" title="View in source">`platform.description`</a>
+### <a id="platform.description" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L823" title="View in source">`platform.description`</a>
*(String, Null)*: The platform description.
[&#9650;][1]
@@ -53,7 +53,7 @@
<!-- div -->
-### <a id="platform.layout" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L829" title="View in source">`platform.layout`</a>
+### <a id="platform.layout" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L830" title="View in source">`platform.layout`</a>
*(String, Null)*: The name of the browser layout engine.
[&#9650;][1]
@@ -62,7 +62,7 @@
<!-- div -->
-### <a id="platform.manufacturer" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L836" title="View in source">`platform.manufacturer`</a>
+### <a id="platform.manufacturer" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L837" title="View in source">`platform.manufacturer`</a>
*(String, Null)*: The name of the product's manufacturer.
[&#9650;][1]
@@ -71,7 +71,7 @@
<!-- div -->
-### <a id="platform.name" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L806" title="View in source">`platform.name`</a>
+### <a id="platform.name" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L807" title="View in source">`platform.name`</a>
*(String, Null)*: The name of the browser/environment.
[&#9650;][1]
@@ -80,7 +80,7 @@
<!-- div -->
-### <a id="platform.os" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L813" title="View in source">`platform.os`</a>
+### <a id="platform.os" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L814" title="View in source">`platform.os`</a>
*(String, Null)*: The name of the operating system.
[&#9650;][1]
@@ -89,7 +89,7 @@
<!-- div -->
-### <a id="platform.prerelease" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L843" title="View in source">`platform.prerelease`</a>
+### <a id="platform.prerelease" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L844" title="View in source">`platform.prerelease`</a>
*(String, Null)*: The alpha/beta release indicator.
[&#9650;][1]
@@ -98,7 +98,7 @@
<!-- div -->
-### <a id="platform.product" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L850" title="View in source">`platform.product`</a>
+### <a id="platform.product" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L851" title="View in source">`platform.product`</a>
*(String, Null)*: The name of the product hosting the browser.
[&#9650;][1]
@@ -107,7 +107,7 @@
<!-- div -->
-### <a id="platform.ua" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L857" title="View in source">`platform.ua`</a>
+### <a id="platform.ua" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L858" title="View in source">`platform.ua`</a>
*(String, Null)*: The browser's user agent string.
[&#9650;][1]
@@ -116,7 +116,7 @@
<!-- div -->
-### <a id="platform.version" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L799" title="View in source">`platform.version`</a>
+### <a id="platform.version" href="https://github.com/bestiejs/platform.js/blob/master/platform.js#L800" title="View in source">`platform.version`</a>
*(String, Null)*: The browser/environment version.
[&#9650;][1]
View
5 platform.js
@@ -542,8 +542,9 @@
}
// detect false positives for Firefox/Safari
else if (!name || (data = !/\bMinefield\b/i.test(ua) && /Firefox|Safari/.exec(name))) {
- // clear name of false positives
- if (name && !product && /[/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
+ // escape the `/` for Firefox 1
+ if (name && !product && /[\/,]|^[^(]+?\)/.test(ua.slice(ua.indexOf(data + '/') + 8))) {
+ // clear name of false positives
name = null;
}
// reassign a generic name

0 comments on commit f24fb36

Please sign in to comment.