fix compose ID and random string generation to use API auth::randomstring() method

This commit is contained in:
Ralf Becker 2014-11-21 09:33:34 +00:00
parent 1d668d5a10
commit f5769333da

View File

@ -179,7 +179,7 @@ class mail_compose
// is some style already set and our initalStyle always adds a span with   // is some style already set and our initalStyle always adds a span with  
// and we want to avoid that // and we want to avoid that
$isFirstLoad = !($actionToProcess=='composeasnew');//true; $isFirstLoad = !($actionToProcess=='composeasnew');//true;
$this->composeID = $_content['composeID'] = $this->getComposeID(); $this->composeID = $_content['composeID'] = $this->generateComposeID();
if (!is_array($_content)) if (!is_array($_content))
{ {
$_content = $this->setDefaults(); $_content = $this->setDefaults();
@ -1341,13 +1341,12 @@ class mail_compose
} }
} }
// create a hopefully unique id, to keep track of different compose windows /**
// if you do this, you are creating a new email * create a unique id, to keep track of different compose windows
function getComposeID() */
function generateComposeID()
{ {
$this->composeID = $this->getRandomString(); return mail_bo::getRandomString();
return $this->composeID;
} }
// $_mode can be: // $_mode can be:
@ -1756,17 +1755,7 @@ class mail_compose
} }
/** /**
* Fetch a random string and md5 encode that one * Test if string contains one of the keys of an array
*
* @param none
* @return string - a random number which is md5 encoded
*/
function getRandomString() {
return mail_bo::getRandomString();
}
/**
* Fetch a random string and md5 encode that one
* *
* @param array arrayToTestAgainst to test its keys against haystack * @param array arrayToTestAgainst to test its keys against haystack
* @param string haystack * @param string haystack