Skip to content

Commit

Permalink
disallowing invalid unicode in sheet name
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-j committed May 31, 2023
1 parent 07cc892 commit dcdcf63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xlsxwriter.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ public static function xmlspecialchars($val)
//note, badchars does not include \t\n\r (\x09\x0a\x0d)
static $badchars = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f";
static $goodchars = " ";
return strtr(htmlspecialchars((string)$val, ENT_QUOTES | ENT_XML1), $badchars, $goodchars);//strtr appears to be faster than str_replace
return strtr(htmlspecialchars((string)$val, ENT_QUOTES | ENT_XML1 | ENT_SUBSTITUTE), $badchars, $goodchars);//strtr appears to be faster than str_replace
}
//------------------------------------------------------------------
public static function array_first_key(array $arr)
Expand Down

0 comments on commit dcdcf63

Please sign in to comment.