That is a core WordPress file.
It is normally longer than 2505 lines.
It seems something truncated it.
Might be a hack that only partially finished.
You could try to load it into cPanel FileManager CodeEditor and look at line 2505
One fix might be to
1) Download WordPress - the exact same version you are running. Unzip.
2) Rename your site's query.php to queryOLD.php and replace it with the query.php from the fresh download.