asdadsasd PKVC(\Vhelpers/index.htmlnu[ PKVC(\W##helpers/mailto.phpnu[get('com_mailto.links', array()); if (!isset($mailto_links[$hash])) { $mailto_links[$hash] = new stdClass; } $mailto_links[$hash]->link = $url; $mailto_links[$hash]->expiry = time(); $session->set('com_mailto.links', $mailto_links); return $hash; } /** * Checks if a URL is a Flash file * * @param string * @return URL */ public static function validateHash($hash) { $retval = false; $session = JFactory::getSession(); self::cleanHashes(); $mailto_links = $session->get('com_mailto.links', array()); if (isset($mailto_links[$hash])) { $retval = $mailto_links[$hash]->link; } return $retval; } /** * Cleans out old hashes * * @since 1.6.1 */ public static function cleanHashes($lifetime = 1440) { // flag for if we've cleaned on this cycle static $cleaned = false; if (!$cleaned) { $past = time() - $lifetime; $session = JFactory::getSession(); $mailto_links = $session->get('com_mailto.links', array()); foreach ($mailto_links as $index => $link) { if ($link->expiry < $past) { unset($mailto_links[$index]); } } $session->set('com_mailto.links', $mailto_links); $cleaned = true; } } } PKVC(\- mailto.xmlnu[ com_mailto Joomla! Project April 2006 (C) 2005 - 2013 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org 3.0.0 COM_MAILTO_XML_DESCRIPTION controller.php index.html mailto.php views language/en-GB.com_mailto.ini index.html language/en-GB.com_mailto.sys.ini PKVC(\Pz 77 mailto.phpnu[registerDefaultTask('mailto'); $controller->execute(JFactory::getApplication()->input->get('task')); //$controller->redirect(); PKVC(\views/sent/view.html.phpnu[ PKVC(\Vviews/sent/tmpl/index.htmlnu[ PKVC(\+-;KKviews/sent/tmpl/default.phpnu[

PKVC(\KrRviews/sent/metadata.xmlnu[ Mailto Andrew Eddie 13 Mar 2006 Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt admin@joomla.org www.joomla.org COM_MAILTO_XML_DESCRIPTION PKVC(\views/mailto/view.html.phpnu[getData(); if ($data === false) { return false; } $this->set('data', $data); parent::display($tpl); } /** * @since 1.5 */ function &getData() { $user = JFactory::getUser(); $app = JFactory::getApplication(); $data = new stdClass; $data->link = urldecode(JRequest::getVar('link', '', 'method', 'base64')); if ($data->link == '') { JError::raiseError(403, JText::_('COM_MAILTO_LINK_IS_MISSING')); $false = false; return $false; } // Load with previous data, if it exists $mailto = $app->input->post->getString('mailto', ''); $sender = $app->input->post->getString('sender', ''); $from = $app->input->post->getString('from', ''); $subject = $app->input->post->getString('subject', ''); if ($user->get('id') > 0) { $data->sender = $user->get('name'); $data->from = $user->get('email'); } else { $data->sender = $sender; $data->from = JStringPunycode::emailToPunycode($from); } $data->subject = $subject; $data->mailto = JStringPunycode::emailToPunycode($mailto); return $data; } } PKVC(\Vviews/mailto/index.htmlnu[ PKVC(\6 views/mailto/tmpl/default.phpnu[ get('data'); ?>

PKVC(\Vviews/mailto/tmpl/index.htmlnu[ PKVC(\##views/mailto/metadata.xmlnu[ PKVC(\Vviews/index.htmlnu[ PKVC(\`7  controller.phpnu[set('com_mailto.formtime', time()); $this->input->set('view', 'mailto'); $this->display(); } /** * Send the message and display a notice * * @access public * @since 1.5 */ public function send() { // Check for request forgeries JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); $app = JFactory::getApplication(); $session = JFactory::getSession(); $timeout = $session->get('com_mailto.formtime', 0); if ($timeout == 0 || time() - $timeout < 20) { JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT')); return $this->mailto(); } $SiteName = $app->getCfg('sitename'); $link = MailtoHelper::validateHash($this->input->get('link', '', 'post')); // Verify that this is a local link if (!$link || !JUri::isInternal($link)) { //Non-local url... JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT')); return $this->mailto(); } // An array of email headers we do not want to allow as input $headers = array ( 'Content-Type:', 'MIME-Version:', 'Content-Transfer-Encoding:', 'bcc:', 'cc:'); // An array of the input fields to scan for injected headers $fields = array( 'mailto', 'sender', 'from', 'subject', ); /* * Here is the meat and potatoes of the header injection test. We * iterate over the array of form input and check for header strings. * If we find one, send an unauthorized header and die. */ foreach ($fields as $field) { foreach ($headers as $header) { if (strpos($_POST[$field], $header) !== false) { JError::raiseError(403, ''); } } } /* * Free up memory */ unset ($headers, $fields); $email = $this->input->post->getString('mailto', ''); $sender = $this->input->post->getString('sender', ''); $from = $this->input->post->getString('from', ''); $subject_default = JText::sprintf('COM_MAILTO_SENT_BY', $sender); $subject = $this->input->post->getString('subject', $subject_default); // Check for a valid to address $error = false; if (! $email || ! JMailHelper::isEmailAddress($email)) { $error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $email); JError::raiseWarning(0, $error); } // Check for a valid from address if (! $from || ! JMailHelper::isEmailAddress($from)) { $error = JText::sprintf('COM_MAILTO_EMAIL_INVALID', $from); JError::raiseWarning(0, $error); } if ($error) { return $this->mailto(); } // Build the message to send $msg = JText::_('COM_MAILTO_EMAIL_MSG'); $link = $link; $body = sprintf($msg, $SiteName, $sender, $from, $link); // Clean the email data $subject = JMailHelper::cleanSubject($subject); $body = JMailHelper::cleanBody($body); // To send we need to use punycode. $from = JStringPunycode::emailToPunycode($from); $from = JMailHelper::cleanAddress($from); $email = JStringPunycode::emailToPunycode($email); // Send the email if (JFactory::getMailer()->sendMail($from, $sender, $email, $subject, $body) !== true) { JError::raiseNotice(500, JText::_('COM_MAILTO_EMAIL_NOT_SENT')); return $this->mailto(); } $this->input->set('view', 'sent'); $this->display(); } } PKVC(\V index.htmlnu[ PKVC(\Vhelpers/index.htmlnu[PKVC(\W##ahelpers/mailto.phpnu[PKVC(\- mailto.xmlnu[PKVC(\Pz 77  mailto.phpnu[PKVC(\Tviews/sent/view.html.phpnu[PKVC(\Vviews/sent/index.htmlnu[PKVC(\Vviews/sent/tmpl/index.htmlnu[PKVC(\+-;KKTviews/sent/tmpl/default.phpnu[PKVC(\KrRviews/sent/metadata.xmlnu[PKVC(\views/mailto/view.html.phpnu[PKVC(\V|views/mailto/index.htmlnu[PKVC(\6 views/mailto/tmpl/default.phpnu[PKVC(\V(views/mailto/tmpl/index.htmlnu[PKVC(\##L)views/mailto/metadata.xmlnu[PKVC(\V)views/index.htmlnu[PKVC(\`7  *controller.phpnu[PKVC(\V ^9index.htmlnu[PK9