* and josh@superfork.com (extracted from php manual)
* Adapted for MailFetch by Philippe Mingo <mingo@rotedic.com>
*
- * @copyright 1999-2012 The SquirrelMail Project Team
+ * @copyright 1999-2014 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package plugins
$aMsgStat = $pop3->command_stat();
if (is_bool($aMsgStat)) {
- $outMsg .= _("Can't get mailbox status:") . ' ' . htmlspecialchars($pop3->error);
+ $outMsg .= _("Can't get mailbox status:") . ' ' . sm_encode_html_special_chars($pop3->error);
continue;
}
if ($mailfetch_lmos == 'on') {
$msglist = $pop3->command_uidl();
if (is_bool($msglist)) {
- $outMsg .= _("Server does not support UIDL.") . ' '.htmlspecialchars($pop3->error);
+ $outMsg .= _("Server does not support UIDL.") . ' '.sm_encode_html_special_chars($pop3->error);
// User asked to leave messages on server, but we can't do that.
$pop3->command_quit();
continue;
$Message = $pop3->command_retr($i);
if (is_bool($Message)) {
- $outMsg .= _("Warning:") . ' ' . htmlspecialchars($pop3->error);
+ $outMsg .= _("Warning:") . ' ' . sm_encode_html_special_chars($pop3->error);
continue;
}
$response=(implode('',$response));
$message=(implode('',$message));
if ($response != 'OK') {
- $outMsg .= _("Error Appending Message!")." ".htmlspecialchars($message);
+ $outMsg .= _("Error Appending Message!")." ".sm_encode_html_special_chars($message);
if ($mailfetch_lmos == 'on') {
setPref($data_dir,$username,"mailfetch_uidl_$i_loop", $msglist[$i-1]);
// end of hooked functions
/**
- * hex2bin - document me
+ * hex2bin - convert a hexadecimal string into binary
+ * Exists since PHP 5.4.
*/
-function hex2bin( $data ) {
+if ( ! function_exists('hex2bin') ) {
+ function hex2bin( $data ) {
- /* Original code by josh@superfork.com */
+ /* Original code by josh@superfork.com */
- $len = strlen($data);
- $newdata = '';
- for( $i=0; $i < $len; $i += 2 ) {
- $newdata .= pack( "C", hexdec( substr( $data, $i, 2) ) );
+ $len = strlen($data);
+ $newdata = '';
+ for( $i=0; $i < $len; $i += 2 ) {
+ $newdata .= pack( "C", hexdec( substr( $data, $i, 2) ) );
+ }
+ return $newdata;
}
- return $newdata;
}
function mf_keyED( $txt ) {