|
Mantis - Quercus
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 3314 | minor | always | 02-02-09 08:17 | 02-02-09 20:34 | |
|
|
|||||
| Reporter: | tlandmann | Platform: | |||
| Assigned To: | nam | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 3.2.1 | ||
| Product Build: | Resolution: | fixed | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 4.0.0 | ||
|
|
|||||
| Summary: | 0003314: html_entity_decode() not Unicode-compatible | ||||
| Description: |
The source code of the function is as follows: -------------------- public static StringValue html_entity_decode(Env env, StringValue string, @Optional int quoteStyle, @Optional String charset) { if (string.length() == 0) return env.getEmptyString(); Iterator<Map.Entry<Value,Value>> iter; if (env.isUnicodeSemantics()) iter = HTML_ENTITIES_ARRAY_UNICODE.getIterator(env); // LINE 380 else iter = HTML_ENTITIES_ARRAY.getIterator(env); while (iter.hasNext()) { Map.Entry<Value,Value> entry = iter.next(); StringValue key = entry.getKey().toStringValue(); StringValue value = entry.getValue().toStringValue(); string = RegexpModule.ereg_replace(env, value, key, string).toStringValue(); } return string; } -------------------- Line 380 (iter = HTML_ENTITIES_ARRAY_UNICODE.getIterator(env);) causes a NullPointerException because HTML_ENTITIES_ARRAY_UNICODE is not set. Temporary workaround: Call htmlentities(" ") once right before using html_entity_decode() for the first time. This helps because htmlentities(), unlike html_entity_decode(), initializes the array if it still equals null (line 319). However, I'd be happy if the problem could be fixed soon. |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||