You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Shockwave Flash Player component for React. GCC `ADVANCED` optimizations compatible.
4
4
5
5
Supports all browsers supported by React.
6
6
@@ -24,14 +24,14 @@ if (ReactSWF.isFPVersionSupported('10.0')) {
24
24
```
25
25
```js
26
26
// ExternalInterface callbacks are invoked on the DOM node as usual.
27
-
var returnValue =thisOrRef.getFPDOMNode().myEICallback(...);
27
+
var returnValue =ref.getFPDOMNode().myEICallback(...);
28
28
```
29
29
30
30
## Breaking changes
31
31
32
32
#### 0.11.0
33
33
34
-
* React 0.13 components no longer support `swf.getDOMNode()`, use `swf.getFPDOMNode()` instead.
34
+
* React 0.13 components no longer support `ref.getDOMNode()`, use `ref.getFPDOMNode()` instead.
35
35
* Depends on `Object.is()`, [polyfills are available](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
36
36
37
37
## Properties
@@ -102,9 +102,38 @@ getFPDOMNode()
102
102
103
103
## AS3 ExternalInterface
104
104
105
+
#### Security flaws
106
+
```
107
+
Escape object key characters for FP:
108
+
"&" => "&"
109
+
"<" => "<"
110
+
"\"" => """
111
+
112
+
Escape object key characters for JS:
113
+
"\r" => "\\r"
114
+
"\"" => "\\\""
115
+
+ wrap key string with "\""
116
+
identifiers with keyword names must also be quoted for JS
117
+
118
+
Escape string characters for JS:
119
+
0x005C => "\\\\" (Backslash)
120
+
0x2028 => "\\u2028" (Line separator)
121
+
0x2029 => "\\u2029" (Paragraph separator)
122
+
123
+
Invalid UTF8 characters for FP and JS:
124
+
0x0000 (NULL character)
125
+
0xD800-0xDFFF (Non private use surrogates)
126
+
0xFDD0-0xFDEF (Non-characters)
127
+
0xFFFE-0xFFFF (Non-characters)
128
+
remove or replace with "\uFFFD" (replacement character)
129
+
can only be produced by String.fromCharCode(c) in FP, not "\uXXXX" (exception: 0x0000)
130
+
```
131
+
132
+
This list *may* be incomplete.
133
+
105
134
#### ExternalInterface.addCallback
106
135
107
-
Returned strings should be encoded using `encodeStringForJS`.
136
+
Returned strings should be encoded using `StringForJS.encode`.
108
137
109
138
You must provide a unique DOM `id` to `ReactSWF` for IE8-10.
110
139
@@ -114,48 +143,42 @@ You must provide a unique DOM `id` to `ReactSWF` for IE8-10.
114
143
115
144
#### ExternalInterface.call
116
145
117
-
String arguments should be encoded using `encodeStringForJS`.
146
+
String arguments should be encoded using `StringForJS.encode`.
118
147
119
-
#### encodeStringForJS
148
+
#### StringForJS.encode
120
149
121
-
The Flash run-time does not sufficiently encode strings passed to JavaScript. This can cause run-time errors, string corruption or character substitution to occur.
150
+
The Flash run-time does not sufficiently encode strings passed to JavaScript. This can cause run-time errors, string corruption or character substitution to occur. Encoded strings are transparently decoded by the JavaScript run-time.
122
151
123
-
`encodeUnicodeStringForJS` should be used when the string is untrusted or contains special characters.
124
-
`encodeASCIIStringForJS` is a cheap alternative when the string is trusted or sufficiently sanitized.
125
-
126
-
Encoded strings are transparently decoded by the JavaScript run-time.
127
-
128
-
```as3
129
-
var ENCODE_UNSAFE_ASCII_CHARS_REGEX:RegExp = /\\/g;
130
-
131
-
// Encode unsafe ASCII-chars for use with ExternalInterface.
132
-
// \0 is not encoded and may throw a JavaScript error or corrupt the string.
133
-
function encodeASCIIStringForJS(value:String):String {
Shockwave Flash Player component for React. GCC `ADVANCED` optimizations compatible.
4
4
5
5
Supports all browsers supported by React.
6
6
@@ -24,14 +24,14 @@ if (ReactSWF.isFPVersionSupported('10.0')) {
24
24
```
25
25
```js
26
26
// ExternalInterface callbacks are invoked on the DOM node as usual.
27
-
var returnValue =thisOrRef.getFPDOMNode().myEICallback(...);
27
+
var returnValue =ref.getFPDOMNode().myEICallback(...);
28
28
```
29
29
30
30
## Breaking changes
31
31
32
32
#### 0.11.0
33
33
34
-
* React 0.13 components no longer support `swf.getDOMNode()`, use `swf.getFPDOMNode()` instead.
34
+
* React 0.13 components no longer support `ref.getDOMNode()`, use `ref.getFPDOMNode()` instead.
35
35
* Depends on `Object.is()`, [polyfills are available](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).
36
36
37
37
## Properties
@@ -102,9 +102,38 @@ getFPDOMNode()
102
102
103
103
## AS3 ExternalInterface
104
104
105
+
#### Security flaws
106
+
```
107
+
Escape object key characters for FP:
108
+
"&" => "&"
109
+
"<" => "<"
110
+
"\"" => """
111
+
112
+
Escape object key characters for JS:
113
+
"\r" => "\\r"
114
+
"\"" => "\\\""
115
+
+ wrap key string with "\""
116
+
identifiers with keyword names must also be quoted for JS
117
+
118
+
Escape string characters for JS:
119
+
0x005C => "\\\\" (Backslash)
120
+
0x2028 => "\\u2028" (Line separator)
121
+
0x2029 => "\\u2029" (Paragraph separator)
122
+
123
+
Invalid UTF8 characters for FP and JS:
124
+
0x0000 (NULL character)
125
+
0xD800-0xDFFF (Non private use surrogates)
126
+
0xFDD0-0xFDEF (Non-characters)
127
+
0xFFFE-0xFFFF (Non-characters)
128
+
remove or replace with "\uFFFD" (replacement character)
129
+
can only be produced by String.fromCharCode(c) in FP, not "\uXXXX" (exception: 0x0000)
130
+
```
131
+
132
+
This list *may* be incomplete.
133
+
105
134
#### ExternalInterface.addCallback
106
135
107
-
Returned strings should be encoded using `encodeStringForJS`.
136
+
Returned strings should be encoded using `StringForJS.encode`.
108
137
109
138
You must provide a unique DOM `id` to `ReactSWF` for IE8-10.
110
139
@@ -114,48 +143,42 @@ You must provide a unique DOM `id` to `ReactSWF` for IE8-10.
114
143
115
144
#### ExternalInterface.call
116
145
117
-
String arguments should be encoded using `encodeStringForJS`.
146
+
String arguments should be encoded using `StringForJS.encode`.
118
147
119
-
#### encodeStringForJS
148
+
#### StringForJS.encode
120
149
121
-
The Flash run-time does not sufficiently encode strings passed to JavaScript. This can cause run-time errors, string corruption or character substitution to occur.
150
+
The Flash run-time does not sufficiently encode strings passed to JavaScript. This can cause run-time errors, string corruption or character substitution to occur. Encoded strings are transparently decoded by the JavaScript run-time.
122
151
123
-
`encodeUnicodeStringForJS` should be used when the string is untrusted or contains special characters.
124
-
`encodeASCIIStringForJS` is a cheap alternative when the string is trusted or sufficiently sanitized.
125
-
126
-
Encoded strings are transparently decoded by the JavaScript run-time.
127
-
128
-
```as3
129
-
var ENCODE_UNSAFE_ASCII_CHARS_REGEX:RegExp = /\\/g;
130
-
131
-
// Encode unsafe ASCII-chars for use with ExternalInterface.
132
-
// \0 is not encoded and may throw a JavaScript error or corrupt the string.
133
-
function encodeASCIIStringForJS(value:String):String {
0 commit comments