当前位置: 首页>>代码示例>>PHP>>正文


PHP Format::htmldecode方法代码示例

本文整理汇总了PHP中Format::htmldecode方法的典型用法代码示例。如果您正苦于以下问题:PHP Format::htmldecode方法的具体用法?PHP Format::htmldecode怎么用?PHP Format::htmldecode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Format的用法示例。


在下文中一共展示了Format::htmldecode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: striptags

 function striptags($var, $decode = true)
 {
     if (is_array($var)) {
         return array_map(array('Format', 'striptags'), $var, array_fill(0, count($var), $decode));
     }
     return strip_tags($decode ? Format::htmldecode($var) : $var);
 }
开发者ID:gizur,项目名称:osticket,代码行数:7,代码来源:class.format.php

示例2: searchable

 function searchable($value)
 {
     $value = preg_replace(array('`<br(\\s*)?/?>`i', '`</div>`i'), "\n", $value);
     $value = Format::htmldecode(Format::striptags($value));
     return Format::searchable($value);
 }
开发者ID:gizur,项目名称:osticket,代码行数:6,代码来源:class.forms.php

示例3: send

 function send($to, $subject, $message, $options = null)
 {
     global $ost;
     //Get the goodies
     require_once PEAR_DIR . 'Mail.php';
     // PEAR Mail package
     require_once PEAR_DIR . 'Mail/mime.php';
     // PEAR Mail_Mime packge
     //do some cleanup
     $to = preg_replace("/(\r\n|\r|\n)/s", '', trim($to));
     $subject = preg_replace("/(\r\n|\r|\n)/s", '', trim($subject));
     //We're decoding html entities here becasuse we only support plain text for now - html support comming.
     $body = Format::htmldecode(preg_replace("/(\r\n|\r)/s", "\n", trim($message)));
     /* Message ID - generated for each outgoing email */
     $messageId = sprintf('<%s%d-%s>', Misc::randCode(6), time(), $this->getEmail() ? $this->getEmail()->getEmail() : '@osTicketMailer');
     $headers = array('From' => $this->getFromAddress(), 'To' => $to, 'Subject' => $subject, 'Date' => date('D, d M Y H:i:s O'), 'Message-ID' => $messageId, 'X-Mailer' => 'osTicket Mailer');
     //Set bulk/auto-response headers.
     if ($options && ($options['autoreply'] or $options['bulk'])) {
         $headers += array('X-Autoreply' => 'yes', 'X-Auto-Response-Suppress' => 'ALL, AutoReply', 'Auto-Submitted' => 'auto-replied');
         if ($options['bulk']) {
             $headers += array('Precedence' => 'bulk');
         } else {
             $headers += array('Precedence' => 'auto_reply');
         }
     }
     if ($options) {
         if (isset($options['inreplyto']) && $options['inreplyto']) {
             $headers += array('In-Reply-To' => $options['inreplyto']);
         }
         if (isset($options['references']) && $options['references']) {
             if (is_array($options['references'])) {
                 $headers += array('References' => implode(' ', $options['references']));
             } else {
                 $headers += array('References' => $options['references']);
             }
         }
     }
     $mime = new Mail_mime();
     $mime->setTXTBody($body);
     //XXX: Attachments
     if ($attachments = $this->getAttachments()) {
         foreach ($attachments as $attachment) {
             if ($attachment['file_id'] && ($file = AttachmentFile::lookup($attachment['file_id']))) {
                 $mime->addAttachment($file->getData(), $file->getType(), $file->getName(), false);
             } elseif ($attachment['file'] && file_exists($attachment['file']) && is_readable($attachment['file'])) {
                 $mime->addAttachment($attachment['file'], $attachment['type'], $attachment['name']);
             }
         }
     }
     //Desired encodings...
     $encodings = array('head_encoding' => 'quoted-printable', 'text_encoding' => 'base64', 'html_encoding' => 'base64', 'html_charset' => 'utf-8', 'text_charset' => 'utf-8', 'head_charset' => 'utf-8');
     //encode the body
     $body = $mime->get($encodings);
     //encode the headers.
     $headers = $mime->headers($headers, true);
     if ($smtp = $this->getSMTPInfo()) {
         //Send via SMTP
         $mail = mail::factory('smtp', array('host' => $smtp['host'], 'port' => $smtp['port'], 'auth' => $smtp['auth'], 'username' => $smtp['username'], 'password' => $smtp['password'], 'timeout' => 20, 'debug' => false));
         $result = $mail->send($to, $headers, $body);
         if (!PEAR::isError($result)) {
             return $messageId;
         }
         $alert = sprintf("Unable to email via SMTP:%s:%d [%s]\n\n%s\n", $smtp['host'], $smtp['port'], $smtp['username'], $result->getMessage());
         $this->logError($alert);
     }
     //No SMTP or it failed....use php's native mail function.
     $mail = mail::factory('mail');
     return PEAR::isError($mail->send($to, $headers, $body)) ? false : $messageId;
 }
开发者ID:pkdevboxy,项目名称:osTicket-1.7,代码行数:69,代码来源:class.mailer.php

示例4: getSearchable

 function getSearchable()
 {
     // <br> -> \n
     $body = preg_replace(array('`<br(\\s*)?/?>`i', '`</div>`i'), "\n", $this->body);
     $body = Format::htmldecode(Format::striptags($body));
     return Format::searchable($body);
 }
开发者ID:CarlosAvilesMx,项目名称:CarlosAviles.Mx,代码行数:7,代码来源:class.thread.php

示例5: fromVars

 static function fromVars($vars)
 {
     // Try and lookup by email address
     $user = static::lookupByEmail($vars['email']);
     if (!$user) {
         $name = $vars['name'];
         if (!$name) {
             list($name) = explode('@', $vars['email'], 2);
         }
         $user = User::create(array('name' => Format::htmldecode(Format::sanitize($name, false)), 'created' => new SqlFunction('NOW'), 'updated' => new SqlFunction('NOW'), 'default_email' => UserEmail::ensure($vars['email'])));
         // Is there an organization registered for this domain
         list($mailbox, $domain) = explode('@', $vars['email'], 2);
         if (isset($vars['org_id'])) {
             $user->set('org_id', $vars['org_id']);
         } elseif ($org = Organization::forDomain($domain)) {
             $user->setOrganization($org, false);
         }
         try {
             $user->save(true);
             $user->emails->add($user->default_email);
             // Attach initial custom fields
             $user->addDynamicData($vars);
         } catch (OrmException $e) {
             return null;
         }
     }
     return $user;
 }
开发者ID:dmiguel92,项目名称:osTicket-1.8,代码行数:28,代码来源:class.user.php

示例6: fromVars

 static function fromVars($vars, $update = false)
 {
     // Try and lookup by email address
     $user = static::lookupByEmail($vars['email']);
     if (!$user) {
         $name = $vars['name'];
         if (!$name) {
             list($name) = explode('@', $vars['email'], 2);
         }
         $user = User::create(array('name' => Format::htmldecode(Format::sanitize($name, false)), 'created' => new SqlFunction('NOW'), 'updated' => new SqlFunction('NOW'), 'default_email' => UserEmail::ensure($vars['email'])));
         // Is there an organization registered for this domain
         list($mailbox, $domain) = explode('@', $vars['email'], 2);
         if (isset($vars['org_id'])) {
             $user->set('org_id', $vars['org_id']);
         } elseif ($org = Organization::forDomain($domain)) {
             $user->setOrganization($org, false);
         }
         try {
             $user->save(true);
             $user->emails->add($user->default_email);
             // Attach initial custom fields
             $user->addDynamicData($vars);
         } catch (OrmException $e) {
             return null;
         }
     } elseif ($update) {
         $errors = array();
         $user->updateInfo($vars, $errors, true);
     }
     /* INICIO
        Anthony Parisi
        */
     if (isset($_SESSION["crmEmail"])) {
         $mysqli = new mysqli("localhost", "root", "ip15x0", "vtigercrm600");
         $sqlUser = $mysqli->query("SELECT MAX(id) FROM `vtigercrm600`.vtiger_modtracker_detail;");
         $resUser = $sqlUser->fetch_array();
         $mysqli->query("UPDATE `vtigercrm600`.`vtiger_contactdetails` SET `mobile` = '" . $_SESSION["crmPhone"] . "' WHERE UPPER(`vtiger_contactdetails`.`email`) = UPPER('" . $_SESSION["crmEmail"] . "');");
         $mysqli->query("INSERT INTO `vtigercrm600`.vtiger_modtracker_detail(id,fieldname,prevalue,postvalue) VALUES('" . $resUser[0] . "','email',NULL,'" . $_SESSION["crmPhone"] . "');");
         unset($_SESSION["crmEmail"]);
         unset($_SESSION["crmPhone"]);
     }
     /* FIN */
     return $user;
 }
开发者ID:jmangarret,项目名称:ostickets,代码行数:44,代码来源:class.user.php


注:本文中的Format::htmldecode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。