adriangibbons/php-fit-file-analysis

Deprecated: Constant FILTER_SANITIZE_STRING is deprecated

Opened this issue · 0 comments

Currently phpFITFileAnalysis contains a line (line 1476):
filter_var($tmp_value, FILTER_SANITIZE_STRING);

According php manual this is deprecated as of PHP 8.1.0. It's recommended to use htmlspecialchars() instead. Everything works just fine if we would replace that to:
$this->data_mesgs[$this->data_mesg_info[$this->defn_mesgs[$local_mesg_type]['global_mesg_num']]['mesg_name']][$this->data_mesg_info[$this->defn_mesgs[$local_mesg_type]['global_mesg_num']]['field_defns'][$field_defn['field_definition_number']]['field_name']][] = htmlspecialchars( (string)$tmp_value );