Message ids

Tried to fix the cid: problem + provide safer id generation
Yep, it's an E_WARNING (and a pointless one, as we only do a
function_exists()), we might avoid it by using is_callable, i'll do a few
tests.

On Thu, Dec 4, 2014 at 5:47 PM, Christophe Coevoet <notifications@github.com
> wrote:

> In lib/classes/Swift/Mime/SimpleMimeEntity.php:
>
> > @@ -682,8 +682,17 @@ protected function _clearCache()
> >       */
> >      protected function getRandomId()
> >      {
> > -        $idLeft = md5(getmypid().'.'.time().'.'.uniqid(mt_rand(), true));
> > -        $idRight = !empty($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'swift.generated';
> > +        $idLeft = 'sw5'.str_replace(array('=', '+', '/'), array('', '-', ''), base64_encode(sha1($this->getRandomString(20).microtime(true), true)));
> > +        if (empty($_SERVER['SERVER_NAME'])) {
> > +            if (@function_exists('gethostname')) { // Will only fail if function is disabled on host level
>
> does it really throw a warning ? This is not documented in the PHP
> documentation AFAICT
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/swiftmailer/swiftmailer/pull/565/files#r21317304>.
>



-- 
Xavier De Cock
GPG Fingerprint: 93CA EE3F 9F57 5BE1 AE4A  794D 3C74 CA9E E7A5 0C1B
GPG Id: 0xE7A50C1B