The code exists to limit the export to the displayed search results. However, the search query values get lost whenever mysql_real_escape_string() is called because it requires a database connection, and there is no connection where the query is created (which is in a static function). So mysql_real_escape_string() returns false instead of the escaped value.
The code exists to limit the export to the displayed search results. However, the search query values get lost whenever mysql_real_escape_string() is called because it requires a database connection, and there is no connection where the query is created (which is in a static function). So mysql_real_escape_string() returns false instead of the escaped value.