當前位置: 首頁>>代碼示例>>PHP>>正文


PHP General::reverse_sanitize方法代碼示例

本文整理匯總了PHP中General::reverse_sanitize方法的典型用法代碼示例。如果您正苦於以下問題:PHP General::reverse_sanitize方法的具體用法?PHP General::reverse_sanitize怎麽用?PHP General::reverse_sanitize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在General的用法示例。


在下文中一共展示了General::reverse_sanitize方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

             }
             ##Update the custom fields
             $sql = "SELECT * FROM `tbl_entries2customfields` WHERE `entry_id` = '" . $e['id'] . "'";
             $customfields = $DB->fetch($sql);
             if (!$error && is_array($customfields) && !empty($customfields)) {
                 foreach ($customfields as $c) {
                     $fields = array();
                     $format = $DB->fetchVar("format", 0, "SELECT `format` FROM `tbl_customfields` WHERE `id` = '" . $c['field_id'] . "' LIMIT 1");
                     if ($format == '1' && $e['formatter'] && !@is_object($formatter)) {
                         $error = true;
                         $Admin->log->pushToLog("Failed (Could not create formatter '" . $e['formatter'] . "')", SYM_LOG_NOTICE, true, true, true);
                     } else {
                         if (!@is_object($formatter)) {
                             $fields['value'] = $formatter->run(General::reverse_sanitize($c['value_raw']));
                         } else {
                             $fields['value'] = General::reverse_sanitize($c['value_raw']);
                         }
                     }
                     ##Update the entry
                     if (!$DB->update($fields, "tbl_entries2customfields", "WHERE `field_id` = '" . $c['field_id'] . "' AND `entry_id` = '" . $e['id'] . "' LIMIT 1")) {
                         $Admin->log->pushToLog("Failed (Problem updating custom fields)", SYM_LOG_NOTICE, true, true, true);
                         $error = true;
                     }
                 }
             }
         }
         if (!$error) {
             $Admin->log->pushToLog("Done.", SYM_LOG_NOTICE, true, true, true);
         }
     }
 }
開發者ID:symphonycms,項目名稱:symphony-1.7,代碼行數:31,代碼來源:sym_publish_migrate.php

示例2: prepareExportValue

 /**
  * Give the field some data and ask it to return a value using one of many
  * possible modes.
  *
  * @param mixed $data
  * @param integer $mode
  * @param integer $entry_id
  * @return array|null
  */
 public function prepareExportValue($data, $mode, $entry_id = null)
 {
     $modes = (object) $this->getExportModes();
     if (isset($data['relation_id']) === false) {
         return null;
     }
     if (is_array($data['relation_id']) === false) {
         $data['relation_id'] = array($data['relation_id']);
     }
     if ($mode === $modes->getPostdata) {
         // Return postdata:
         return $data;
     } else {
         if ($mode === $modes->listEntry) {
             // Return the entry IDs:
             return $data['relation_id'];
         } else {
             if ($mode === $modes->listEntryObject) {
                 // Return entry objects:
                 $items = array();
                 $entries = EntryManager::fetch($data['relation_id']);
                 foreach ($entries as $entry) {
                     if (is_array($entry) === false || empty($entry)) {
                         continue;
                     }
                     $items[] = current($entry);
                 }
                 return $items;
             }
         }
     }
     // All other modes require full data:
     $data = $this->findRelatedValues($data['relation_id']);
     $items = array();
     foreach ($data as $item) {
         $item = (object) $item;
         if ($mode === $modes->listValue) {
             $items[] = General::reverse_sanitize($item->value);
         } elseif ($mode === $modes->listEntryToValue) {
             $items[$item->id] = General::reverse_sanitize($item->value);
         }
     }
     return $items;
 }
開發者ID:mazedigital,項目名稱:association_field,代碼行數:53,代碼來源:field.association.php

示例3: foreach

                            <td colspan="3" class="inactive">
								None found.
                            </td>
                        </tr>
<?php 
} else {
    $bEven = false;
    $date = $Admin->getDateObj();
    foreach ($comments as $comment) {
        foreach ($comment as $index => $value) {
            $comment[$index] = htmlspecialchars(stripslashes($value));
        }
        $url = $Admin->getCurrentPageURL() . 'edit/&amp;id=' . $comment['id'];
        extract($comment, EXTR_PREFIX_ALL, "comment");
        $comment_creation_timestamp_gmt = $DB->fetchVar("creation_timestamp_gmt", 0, "SELECT UNIX_TIMESTAMP(creation_date_gmt) as `creation_timestamp_gmt` FROM `tbl_metadata` WHERE `relation_id` = '{$comment_id}' AND `class` = 'comment' LIMIT 1");
        $comment_body = strip_tags(General::reverse_sanitize(General::reverse_sanitize($comment_body)));
        $comment_body_short = General::limitWords($comment_body, 75);
        if (strlen($comment_body_short) < strlen($comment_body)) {
            $comment_body_short .= "...";
        }
        $class = "";
        if (isset($_REQUEST['_f']) && $_REQUEST['id'] == $comment['id']) {
            $class = "active ";
        }
        if ($bEven) {
            $class .= "even";
        }
        $class = trim($class);
        ?>

				<tr<?php 
開發者ID:symphonycms,項目名稱:symphony-1.7,代碼行數:31,代碼來源:sym_publish_comments.php


注:本文中的General::reverse_sanitize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。