当前位置: 首页>>代码示例>>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;未经允许,请勿转载。