-
-
Notifications
You must be signed in to change notification settings - Fork 816
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
Avoid hex2bin for PHP 5.3 #895
Conversation
FreshRSS#894 And use native hexadecimal function when available (MySQL) to avoid having binary data in the SQL logs.
@@ -77,7 +83,7 @@ public function addEntry($valuesTmp) { | |||
substr($valuesTmp['link'], 0, 1023), | |||
$valuesTmp['date'], | |||
time(), | |||
hex2bin($valuesTmp['hash']), // X'09AF' hexadecimal literals do not work with SQLite/PDO | |||
$this->hasNativeHex() ? $valuesTmp['hash'] : pack('H*', $valuesTmp['hash']), // X'09AF' hexadecimal literals do not work with SQLite/PDO //hex2bin() is PHP5.4+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not like using hex2bin()
with MySQL anyway, because having binary data in the SQL logs was not nice, sometimes interfering with my SSH client.
@@ -25,4 +25,4 @@ | |||
define('APP_PATH', FRESHRSS_PATH . '/app'); | |||
define('EXTENSIONS_PATH', FRESHRSS_PATH . '/extensions'); | |||
|
|||
define('TMP_PATH', sys_get_temp_dir()); | |||
define('TMP_PATH', sys_get_temp_dir()); //Requires PHP 5.2.1+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need this comment...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed Alkarex@d9d9801
I think I'm ok with that but don't we need to |
sys_get_temp_dir() requires PHP 5.2.1+
@marienfressinaud Ahh, now I understand :-) The unpack is done natively in the SQL requests with |
👍 perfect! |
Avoid hex2bin for PHP 5.3
#894
And use native hexadecimal function when available (MySQL) to avoid
having binary data in the SQL logs.