| @@ -108,9 +108,9 @@ | ||
| 108 | 108 | |
| 109 | 109 | $json = array(); |
| 110 | 110 | |
| 111 | 111 | preg_match_all( |
| 112 | - '#\(\s?["|\'](.*)["|\'],\s?(.*)\s?\);#Ui', | |
| 112 | + '#\(\s?["\'](.*)["\'],\s?(.*)\s?\);#Ui', | |
| 113 | 113 | $js, |
| 114 | 114 | $json |
| 115 | 115 | ); |
| 116 | 116 | |
| @@ -220,9 +220,9 @@ | ||
| 220 | 220 | // Whitelist of function calls that contain translatable JSON |
| 221 | 221 | $allowed_functions = wplng_data_json_in_js_functions(); |
| 222 | 222 | |
| 223 | 223 | if ( empty( $allowed_functions ) ) { |
| 224 | - return array(); | |
| 224 | + return $js; | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | preg_match_all( |
| 228 | 228 | '#([a-zA-Z_$][a-zA-Z0-9_$]*(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)+)\s*\(\s*(\{(?:[^{}"\'\\\\]+|"(?:\\\\.|[^"\\\\])*"|\'(?:\\\\.|[^\'\\\\])*\'|(?2))*\})\s*\)#Us', |