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


PHP String::stripUnsafeHtml方法代碼示例

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


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

示例1: getTemplateVarsFromRowColumn

 /**
  * Extracts variables for a given column from a data element
  * so that they may be assigned to template before rendering.
  * @param $row GridRow
  * @param $column GridColumn
  * @return array
  */
 function getTemplateVarsFromRowColumn($row, $column)
 {
     $element = $row->getData();
     $columnId = $column->getId();
     assert(is_a($element, 'DataObject') && !empty($columnId));
     // there is only one column in the Footer grid.
     switch ($columnId) {
         case 'title':
             return array('label' => '<a href="' . String::stripUnsafeHtml($element->getLocalizedUrl()) . '" target="_blank">' . $element->getLocalizedTitle() . '</a>');
     }
 }
開發者ID:mczirfusz,項目名稱:pkp-lib,代碼行數:18,代碼來源:FooterGridCellProvider.inc.php

示例2: getTemplateVarsFromRowColumn

 /**
  * Extracts variables for a given column from a data element
  * so that they may be assigned to template before rendering.
  * @param $row GridRow
  * @param $column GridColumn
  * @return array
  */
 function getTemplateVarsFromRowColumn($row, $column)
 {
     $element =& $row->getData();
     $columnId = $column->getId();
     assert(!empty($columnId));
     switch ($columnId) {
         case 'url':
             return array('label' => '<a href="' . String::stripUnsafeHtml($element['url']) . '" target="_blank">' . String::stripUnsafeHtml($element['url']) . '</a>');
         case 'shares':
             return array('label' => $element['shares']);
     }
 }
開發者ID:josekarvalho,項目名稱:omp,代碼行數:19,代碼來源:AddThisStatisticsGridCellProvider.inc.php

示例3: array

	<?php 
$this->_tag_stack[] = array('iterate', array('from' => 'issues', 'item' => 'issue'));
$_block_repeat = true;
$this->_plugins['block']['iterate'][0][0]->smartyIterate($this->_tag_stack[count($this->_tag_stack) - 1][1], null, $this, $_block_repeat);
while ($_block_repeat) {
    ob_start();
    ?>
	<tr valign="top" class="data" id="issue-<?php 
    echo $this->_tpl_vars['issue']->getId();
    ?>
">
		<td class="drag"><a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'issueToc', 'path' => $this->_tpl_vars['issue']->getId()), $this);
    ?>
" class="action"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getIssueIdentification()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
</a></td>
		<td class="drag"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getDatePublished()) ? $this->_run_mod_handler('date_format', true, $_tmp, $this->_tpl_vars['dateFormatShort']) : smarty_modifier_date_format($_tmp, $this->_tpl_vars['dateFormatShort'])) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
    ?>
</td>
		<td class="drag"><?php 
    echo is_array($_tmp = $this->_tpl_vars['issue']->getNumArticles()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</td>
		<td><a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'moveIssue', 'd' => 'u', 'id' => $this->_tpl_vars['issue']->getId(), 'issuesPage' => $this->_tpl_vars['page']), $this);
    ?>
">&uarr;</a>	<a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('op' => 'moveIssue', 'd' => 'd', 'id' => $this->_tpl_vars['issue']->getId(), 'issuesPage' => $this->_tpl_vars['page']), $this);
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:31,代碼來源:%%AF^AFD^AFD65FDE%%backIssues.tpl.php

示例4: is_array

    $this->assign('issue', $this->_tpl_vars['articleData']['issue']);
    ?>
	<tr valign="top">
		<td><input type="checkbox" name="articleId[]" value="<?php 
    echo $this->_tpl_vars['article']->getId();
    ?>
"/></td>
		<td><a href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('page' => 'issue', 'op' => 'view', 'path' => $this->_tpl_vars['issue']->getId()), $this);
    ?>
" class="action"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['issue']->getIssueIdentification()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
</a></td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['article']->getLocalizedTitle()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp);
    ?>
</td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['article']->getAuthorString()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</td>
		<td align="right"><a href="<?php 
    echo $this->_plugins['function']['plugin_url'][0][0]->smartyPluginUrl(array('path' => is_array($_tmp = 'exportArticle') ? $this->_run_mod_handler('to_array', true, $_tmp, $this->_tpl_vars['article']->getId()) : $this->_plugins['modifier']['to_array'][0][0]->smartyToArray($_tmp, $this->_tpl_vars['article']->getId())), $this);
    ?>
" class="action"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.export"), $this);
    ?>
</a></td>
	</tr>
	<tr>
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:31,代碼來源:%%BB^BBC^BBC7EE8A%%articles.tpl.php

示例5: setupTemplate

 /**
  * Set up the comment template.
  * @param $request PKPRequest
  * @param $article Article
  * @param $galleyId int
  * @param $comment Comment
  */
 function setupTemplate(&$request, $article, $galleyId, $comment = null)
 {
     parent::setupTemplate();
     AppLocale::requireComponents(LOCALE_COMPONENT_PKP_READER);
     $templateMgr =& TemplateManager::getManager();
     $journal =& $request->getJournal();
     if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
         $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     }
     $pageHierarchy = array(array($request->url(null, 'article', 'view', array($article->getBestArticleId($request->getJournal()), $galleyId)), String::stripUnsafeHtml($article->getLocalizedTitle()), true));
     if ($comment) {
         $pageHierarchy[] = array($request->url(null, 'comment', 'view', array($article->getId(), $galleyId)), 'comments.readerComments');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
開發者ID:yuricampos,項目名稱:ojs,代碼行數:22,代碼來源:CommentHandler.inc.php

示例6: setupTemplate

 function setupTemplate($paper, $galleyId, $comment = null)
 {
     parent::setupTemplate();
     $templateMgr =& TemplateManager::getManager();
     $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     Locale::requireComponents(array(LOCALE_COMPONENT_PKP_READER));
     $pageHierarchy = array(array(Request::url(null, null, 'paper', 'view', array($paper->getBestPaperId(Request::getConference()), $galleyId)), String::stripUnsafeHtml($paper->getLocalizedTitle()), true));
     if ($comment) {
         $pageHierarchy[] = array(Request::url(null, null, 'comment', 'view', array($paper->getId(), $galleyId)), 'comments.readerComments');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
開發者ID:jalperin,項目名稱:ocs,代碼行數:12,代碼來源:CommentHandler.inc.php

示例7: is_array

?>


<?php 
if ($this->_tpl_vars['currentJournal']->getSetting('metaCitations')) {
    ?>
	<div id="citations">
	<h4><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.citations"), $this);
    ?>
</h4>

	<table width="100%" class="data">
		<tr valign="top">
			<td width="20%" class="label"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.citations"), $this);
    ?>
</td>
			<td width="80%" class="value"><?php 
    echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['submission']->getCitations()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
    ?>
</td>
		</tr>
	</table>
	</div>
<?php 
}
?>

</div><!-- metadata -->
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:30,代碼來源:%%84^849^84905BC3%%metadata.tpl.php

示例8: _formatEmail

 /**
  * Format the contents of the email
  * @param $emailLogEntry EmailLogEntry
  * @return string Formatted email
  */
 function _formatEmail($emailLogEntry)
 {
     assert(is_a($emailLogEntry, 'EmailLogEntry'));
     $text = array();
     $text[] = __('email.from') . ': ' . htmlspecialchars($emailLogEntry->getFrom());
     $text[] = __('email.to') . ': ' . htmlspecialchars($emailLogEntry->getRecipients());
     $text[] = __('email.subject') . ': ' . htmlspecialchars($emailLogEntry->getSubject());
     $text[] = $emailLogEntry->getBody();
     return nl2br(String::stripUnsafeHtml(implode(PHP_EOL . PHP_EOL, $text)));
 }
開發者ID:mczirfusz,項目名稱:pkp-lib,代碼行數:15,代碼來源:SubmissionEventLogGridHandler.inc.php

示例9: is_array

    echo is_array($_tmp = $this->_tpl_vars['referral']->getDateAdded()) ? $this->_run_mod_handler('date_format', true, $_tmp, $this->_tpl_vars['dateFormatShort']) : smarty_modifier_date_format($_tmp, $this->_tpl_vars['dateFormatShort']);
    ?>
</td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['referral']->getLinkCount()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</td>
		<td><a href="<?php 
    echo is_array($_tmp = $this->_tpl_vars['referral']->getUrl()) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['referral']->getUrl()) ? $this->_run_mod_handler('truncate', true, $_tmp, 50) : $this->_plugins['modifier']['truncate'][0][0]->smartyTruncate($_tmp, 50)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
</a></td>
		<td><?php 
    echo is_array($_tmp = $this->_tpl_vars['articleTitles'][$this->_tpl_vars['articleId']]) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp);
    ?>
</td>
		<td><?php 
    echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['referral']->getReferralName()) ? $this->_run_mod_handler('truncate', true, $_tmp, 50) : $this->_plugins['modifier']['truncate'][0][0]->smartyTruncate($_tmp, 50)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
    ?>
</td>
		<td><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => $this->_tpl_vars['referral']->getStatusKey()), $this);
    ?>
</td>
		<td align="right">
			<a class="action" href="<?php 
    echo $this->_plugins['function']['url'][0][0]->smartyUrl(array('page' => 'referral', 'op' => 'editReferral', 'path' => $this->_tpl_vars['referral']->getId()), $this);
    ?>
"><?php 
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:31,代碼來源:%%66^660^660EB43F%%authorReferrals.tpl.php

示例10: setupTemplate

 function setupTemplate($article, $galleyId, $comment = null)
 {
     $templateMgr =& TemplateManager::getManager();
     $journal =& Request::getJournal();
     if (!$journal || !$journal->getSetting('restrictSiteAccess')) {
         $templateMgr->setCacheability(CACHEABILITY_PUBLIC);
     }
     $pageHierarchy = array(array(Request::url(null, 'article', 'view', array($article->getBestArticleId(Request::getJournal()), $galleyId)), String::stripUnsafeHtml($article->getArticleTitle()), true));
     if ($comment) {
         $pageHierarchy[] = array(Request::url(null, 'comment', 'view', array($article->getArticleId(), $galleyId)), 'comments.readerComments');
     }
     $templateMgr->assign('pageHierarchy', $pageHierarchy);
 }
開發者ID:Jouper,項目名稱:jouper,代碼行數:13,代碼來源:CommentHandler.inc.php

示例11: is_array

<?php 
if ($this->_tpl_vars['error']) {
    ?>
	<span class="pkp_form_error"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => $this->_tpl_vars['error'], 'reason' => $this->_tpl_vars['reason']), $this);
    ?>
</span>
	<br />
	<br />
<?php 
}
?>

<input type="hidden" name="source" value="<?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['source']) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
?>
" />

<?php 
if (!$this->_tpl_vars['implicitAuth']) {
    ?>
	<table id="signinTable" class="data">
	<tr>
		<td class="label"><label for="loginUsername"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.username"), $this);
    ?>
</label></td>
		<td class="value"><input type="text" id="loginUsername" name="username" value="<?php 
    echo is_array($_tmp = $this->_tpl_vars['username']) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp);
    ?>
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:30,代碼來源:%%16^161^161F6743%%login.tpl.php

示例12: is_array

	<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.mailingAddress"), $this);
?>
:</td>
	<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getMailingAddress()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</td>
</tr>
<tr valign="top">
	<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.biography"), $this);
?>
:</td>
	<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getLocalizedBiography()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
?>
</td>
</tr>
<tr valign="top">
	<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.workingLanguages"), $this);
?>
:</td>
	<td class="value"><?php 
$_from = $this->_tpl_vars['user']->getLocales();
if (!is_array($_from) && !is_object($_from)) {
    settype($_from, 'array');
}
$this->_foreach['workingLanguages'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['workingLanguages']['total'] > 0) {
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:31,代碼來源:%%40^409^40906566%%userProfile.tpl.php

示例13: is_array

		<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "common.country"), $this);
?>
</td>
		<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['country']) ? $this->_run_mod_handler('escape', true, $_tmp) : $this->_plugins['modifier']['escape'][0][0]->smartyEscape($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
?>
</td>
	</tr>
	<tr valign="top">
		<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.biography"), $this);
?>
</td>
		<td class="value"><?php 
echo is_array($_tmp = is_array($_tmp = is_array($_tmp = $this->_tpl_vars['user']->getUserBiography()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp)) ? $this->_run_mod_handler('default', true, $_tmp, "&mdash;") : smarty_modifier_default($_tmp, "&mdash;");
?>
</td>
	</tr>
	<tr valign="top">
		<td class="label"><?php 
echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "user.workingLanguages"), $this);
?>
</td>
		<td class="value"><?php 
$_from = $this->_tpl_vars['user']->getLocales();
if (!is_array($_from) && !is_object($_from)) {
    settype($_from, 'array');
}
$this->_foreach['workingLanguages'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['workingLanguages']['total'] > 0) {
開發者ID:LiteratimBi,項目名稱:jupitertfn,代碼行數:31,代碼來源:%%C4^C49^C498A7FD%%userProfile.tpl.php

示例14: submissionOutputFilter

 /**
  * Output filter adds data citation to submission summary.
  * @param $output string
  * @param $templateMgr TemplateManager
  * @return $string
  */
 function submissionOutputFilter($output, &$templateMgr)
 {
     $submission =& $templateMgr->get_template_vars('submission');
     if (!isset($submission)) {
         return $output;
     }
     $dataverseStudyDao =& DAORegistry::getDAO('DataverseStudyDAO');
     $study =& $dataverseStudyDao->getStudyBySubmissionId($submission->getId());
     $dataCitation = '';
     if (isset($study)) {
         $dataCitation = $this->_formatDataCitation($study->getDataCitation(), $study->getPersistentUri());
     } else {
         // There may be an external data citation
         $dataCitation = $submission->getLocalizedData('externalDataCitation');
     }
     if (!$dataCitation) {
         return $output;
     }
     $index = strpos($output, '<td class="label">' . __('submission.submitter'));
     if ($index !== false) {
         $newOutput = substr($output, 0, $index);
         $newOutput .= '<td class="label">' . __('plugins.generic.dataverse.dataCitation') . '</td>';
         $newOutput .= '<td class="value" colspan="2">' . String::stripUnsafeHtml($dataCitation) . '</td></tr><tr>';
         $newOutput .= substr($output, $index);
         $output = $newOutput;
     }
     $templateMgr->unregister_outputfilter('submissionSummaryOutputFilter');
     return $output;
 }
開發者ID:farhanabbas1983,項目名稱:ojs-1,代碼行數:35,代碼來源:DataversePlugin.inc.php

示例15: unset

                        <?php 
}
unset($_from);
?>
		</td>
	</tr>
	<?php 
if ($this->_tpl_vars['submission']->getCommentsToEditor()) {
    ?>
	<tr valign="top">
		<td width="20%" class="label"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "article.commentsToEditor"), $this);
    ?>
</td>
		<td width="80%" colspan="2" class="data"><?php 
    echo is_array($_tmp = is_array($_tmp = $this->_tpl_vars['submission']->getCommentsToEditor()) ? $this->_run_mod_handler('strip_unsafe_html', true, $_tmp) : String::stripUnsafeHtml($_tmp)) ? $this->_run_mod_handler('nl2br', true, $_tmp) : smarty_modifier_nl2br($_tmp);
    ?>
</td>
	</tr>
	<?php 
}
?>
	<?php 
if ($this->_tpl_vars['publishedArticle']) {
    ?>
	<tr>
		<td class="label"><?php 
    echo $this->_plugins['function']['translate'][0][0]->smartyTranslate(array('key' => "submission.abstractViews"), $this);
    ?>
</td>
		<td><?php 
開發者ID:EreminDm,項目名稱:water-cao,代碼行數:31,代碼來源:%%F8^F88^F88D9440%%management.tpl.php


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