Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hex2bin() not available with PHP < 5.4 #894

Closed
marienfressinaud opened this Issue Jul 10, 2015 · 6 comments

Comments

Projects
None yet
2 participants
@marienfressinaud
Copy link
Member

marienfressinaud commented Jul 10, 2015

hex2bin function is used twice in app/Models/EntryDAO.php but is not available before PHP 5.4. Since we should be compatible at least with PHP 5.3, we have to find a solution.

See http://stackoverflow.com/a/17963343

Log example:

PHP Fatal error:  Call to undefined function hex2bin() in /var/www/html/app/Models/EntryDAO.php on line 80, referer: http://localhost/p/i/

@marienfressinaud marienfressinaud added this to the 1.1.2 milestone Jul 10, 2015

@Alkarex Alkarex self-assigned this Jul 10, 2015

@Alkarex

This comment has been minimized.

Copy link
Member

Alkarex commented Jul 10, 2015

hex2bin() is used to support SQLite, and we support SQLite 3.7.4+, which implies PHP 5.3.6+ http://php.net/ChangeLog-5.php#5.3.6
So to keep the existing compatibility, we need to support MySQL with PHP 5.2.1+ and SQLite with PHP 5.3.6+

@marienfressinaud

This comment has been minimized.

Copy link
Member Author

marienfressinaud commented Jul 10, 2015

Yes but PHP 5.3.6 < 5.4 and hex2bin is only >= 5.4 so it doesn't change anything ;).

@Alkarex

This comment has been minimized.

Copy link
Member

Alkarex commented Jul 10, 2015

Yes, it was just for the record

Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Jul 10, 2015

Avoid hex2bin for PHP 5.3
FreshRSS#894
And use native hexadecimal function when available (MySQL) to avoid
having binary data in the SQL logs.

Alkarex referenced this issue Jul 10, 2015

Hexadecimal literals do not work with SQLite/PDO
X'09AF' hexadecimal literals do not work with SQLite/PDO. Replaced by
PHP hex2bin().

711530a
@Alkarex

This comment has been minimized.

Copy link
Member

Alkarex commented Jul 10, 2015

Patch available #895

@Alkarex

This comment has been minimized.

Copy link
Member

Alkarex commented Jul 10, 2015

Just for reference, link to another commit for PHP 5.2 compatibility Alkarex@214a5cc

Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Jul 10, 2015

@Alkarex

This comment has been minimized.

Copy link
Member

Alkarex commented Jul 12, 2015

Done.

@Alkarex Alkarex closed this Jul 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.