$pos = strrpos($id, '.');
/* Check the boundary case (ID = 0). */
- if (($pos === false) && ($id == '0')) {
+ if (($pos === false) && ($id === '0')) {
return in_array($action, array('prev', 'up')) ? null : 1;
}
switch ($action) {
case 'down':
- $id = (substr($id, $pos + 1) == '0')
+ $id = (substr($id, $pos + 1) === '0')
? substr_replace($id, '1', $pos + 1)
: $id . '.0';
break;
if ($pos === false) {
$id = 0;
} else {
- $id = (substr($id, $pos + 1) == '0')
+ $id = (substr($id, $pos + 1) === '0')
? substr($id, 0, $pos)
: substr_replace($id, '0', $pos + 1);
}
*/
protected function _IMPrender($inline)
{
+ $ids = array_keys($this->_mimepart->contentTypeMap());
$related_id = $this->_mimepart->getMimeId();
/* Look at the 'start' parameter to determine which part to start
* [3.1] */
$id = $this->_mimepart->getContentTypeParameter('start');
if (is_null($id)) {
- $id = Horde_Mime::mimeidArithmetic($related_id, 'down');
+ reset($ids);
+ next($ids);
+ $id = key($ids);
}
/* Only display if the start part (normally text/html) can be
}
$cids = $ret = array();
- $ids = array_keys($this->_mimepart->contentTypeMap());
/* Build a list of parts -> CIDs. */
foreach ($ids as $val) {