本文整理汇总了PHP中htmlspecialchars函数的典型用法代码示例。如果您正苦于以下问题:PHP htmlspecialchars函数的具体用法?PHP htmlspecialchars怎么用?PHP htmlspecialchars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了htmlspecialchars函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: vc_dropdown_form_field
/**
* Dropdown(select with options) shortcode attribute type generator.
*
* @param $settings
* @param $value
*
* @since 4.4
* @return string - html string.
*/
function vc_dropdown_form_field($settings, $value)
{
$output = '';
$css_option = str_replace('#', 'hash-', vc_get_dropdown_option($settings, $value));
$output .= '<select name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select ' . $settings['param_name'] . ' ' . $settings['type'] . ' ' . $css_option . '" data-option="' . $css_option . '">';
if (is_array($value)) {
$value = isset($value['value']) ? $value['value'] : array_shift($value);
}
if (!empty($settings['value'])) {
foreach ($settings['value'] as $index => $data) {
if (is_numeric($index) && (is_string($data) || is_numeric($data))) {
$option_label = $data;
$option_value = $data;
} elseif (is_numeric($index) && is_array($data)) {
$option_label = isset($data['label']) ? $data['label'] : array_pop($data);
$option_value = isset($data['value']) ? $data['value'] : array_pop($data);
} else {
$option_value = $data;
$option_label = $index;
}
$selected = '';
$option_value_string = (string) $option_value;
$value_string = (string) $value;
if ('' !== $value && $option_value_string === $value_string) {
$selected = ' selected="selected"';
}
$option_class = str_replace('#', 'hash-', $option_value);
$output .= '<option class="' . esc_attr($option_class) . '" value="' . esc_attr($option_value) . '"' . $selected . '>' . htmlspecialchars($option_label) . '</option>';
}
}
$output .= '</select>';
return $output;
}
开发者ID:severnrescue,项目名称:web,代码行数:42,代码来源:default_params.php
示例2: dump
function dump($var, $echo = true, $label = null, $strict = true)
{
$label = $label === null ? '' : rtrim($label) . ' ';
if (!$strict) {
if (ini_get('html_errors')) {
$output = print_r($var, true);
$output = "<pre>" . $label . htmlspecialchars($output, ENT_QUOTES) . "</pre>";
} else {
$output = $label . " : " . print_r($var, true);
}
} else {
ob_start();
var_dump($var);
$output = ob_get_clean();
if (!extension_loaded('xdebug')) {
$output = preg_replace("/\\]\\=\\>\n(\\s+)/m", "] => ", $output);
$output = '<pre>' . $label . htmlspecialchars($output, ENT_QUOTES, "GB2312") . '</pre>';
}
}
if ($echo) {
echo $output;
return null;
} else {
return $output;
}
}
开发者ID:winiceo,项目名称:job,代码行数:26,代码来源:lib.php
示例3: submitInfo
public function submitInfo()
{
$this->load->model("settings_model");
// Gather the values
$values = array('nickname' => htmlspecialchars($this->input->post("nickname")), 'location' => htmlspecialchars($this->input->post("location")));
// Change language
if ($this->config->item('show_language_chooser')) {
$values['language'] = $this->input->post("language");
if (!is_dir("application/language/" . $values['language'])) {
die("3");
} else {
$this->user->setLanguage($values['language']);
$this->plugins->onSetLanguage($this->user->getId(), $values['language']);
}
}
// Remove the nickname field if it wasn't changed
if ($values['nickname'] == $this->user->getNickname()) {
$values = array('location' => $this->input->post("location"));
} elseif (strlen($values['nickname']) < 4 || strlen($values['nickname']) > 14 || !preg_match("/[A-Za-z0-9]*/", $values['nickname'])) {
die(lang("nickname_error", "ucp"));
} elseif ($this->internal_user_model->nicknameExists($values['nickname'])) {
die("2");
}
if (strlen($values['location']) > 32 && !ctype_alpha($values['location'])) {
die(lang("location_error", "ucp"));
}
$this->settings_model->saveSettings($values);
$this->plugins->onSaveSettings($this->user->getId(), $values);
die("1");
}
开发者ID:saqar,项目名称:FusionCMS-themes-and-modules,代码行数:30,代码来源:settings.php
示例4: PMA_sanitize
/**
* Sanitizes $message, taking into account our special codes
* for formatting.
*
* If you want to include result in element attribute, you should escape it.
*
* Examples:
*
* <p><?php echo PMA_sanitize($foo); ?></p>
*
* <a title="<?php echo PMA_sanitize($foo, true); ?>">bar</a>
*
* @uses preg_replace()
* @uses strtr()
* @param string the message
* @param boolean whether to escape html in result
*
* @return string the sanitized message
*
* @access public
*/
function PMA_sanitize($message, $escape = false, $safe = false)
{
if (!$safe) {
$message = strtr($message, array('<' => '<', '>' => '>'));
}
$replace_pairs = array('[i]' => '<em>', '[/i]' => '</em>', '[em]' => '<em>', '[/em]' => '</em>', '[b]' => '<strong>', '[/b]' => '</strong>', '[strong]' => '<strong>', '[/strong]' => '</strong>', '[tt]' => '<code>', '[/tt]' => '</code>', '[code]' => '<code>', '[/code]' => '</code>', '[kbd]' => '<kbd>', '[/kbd]' => '</kbd>', '[br]' => '<br />', '[/a]' => '</a>', '[sup]' => '<sup>', '[/sup]' => '</sup>');
$message = strtr($message, $replace_pairs);
$pattern = '/\\[a@([^"@]*)@([^]"]*)\\]/';
if (preg_match_all($pattern, $message, $founds, PREG_SET_ORDER)) {
$valid_links = array('http', './Do', './ur');
foreach ($founds as $found) {
// only http... and ./Do... allowed
if (!in_array(substr($found[1], 0, 4), $valid_links)) {
return $message;
}
// a-z and _ allowed in target
if (!empty($found[2]) && preg_match('/[^a-z_]+/i', $found[2])) {
return $message;
}
}
if (substr($found[1], 0, 4) == 'http') {
$message = preg_replace($pattern, '<a href="' . PMA_linkURL($found[1]) . '" target="\\2">', $message);
} else {
$message = preg_replace($pattern, '<a href="\\1" target="\\2">', $message);
}
}
if ($escape) {
$message = htmlspecialchars($message);
}
return $message;
}
开发者ID:dingdong2310,项目名称:g5_theme,代码行数:52,代码来源:sanitizing.lib.php
示例5: onParseContentBlock
function onParseContentBlock($page, $name, $text, $shortcut)
{
$output = NULL;
if ($name == "fotorama" && $shortcut) {
list($pattern, $style, $nav, $autoplay) = $this->yellow->toolbox->getTextArgs($text);
if (empty($style)) {
$style = $this->yellow->config->get("fotoramaStyle");
}
if (empty($nav)) {
$nav = $this->yellow->config->get("fotoramaNav");
}
if (empty($autoplay)) {
$autoplay = $this->yellow->config->get("fotoramaAutoplay");
}
if (empty($pattern)) {
$files = $page->getFiles(true);
} else {
$images = $this->yellow->config->get("imageDir");
$files = $this->yellow->files->index(true, true)->match("#{$images}{$pattern}#");
}
if (count($files)) {
$page->setLastModified($files->getModified());
$output = "<div class=\"" . htmlspecialchars($style) . "\" data-nav=\"" . htmlspecialchars($nav) . "\" data-autoplay=\"" . htmlspecialchars($autoplay) . "\" data-loop=\"true\">\n";
foreach ($files as $file) {
list($width, $height) = $this->yellow->toolbox->detectImageInfo($file->fileName);
$output .= "<img src=\"" . htmlspecialchars($file->getLocation()) . "\" width=\"" . htmlspecialchars($width) . "\" height=\"" . htmlspecialchars($height) . "\" alt=\"" . basename($file->getLocation()) . "\" title=\"" . basename($file->getLocation()) . "\" />\n";
}
$output .= "</div>";
} else {
$page->error(500, "Fotorama '{$pattern}' does not exist!");
}
}
return $output;
}
开发者ID:rainkarnichi,项目名称:yellow-extensions,代码行数:34,代码来源:fotorama.php
示例6: applyTransformation
/**
* Does the actual work of each specific transformations plugin.
*
* @param string $buffer text to be transformed
* @param array $options transformation options
* @param string $meta meta information
*
* @return string
*/
public function applyTransformation($buffer, $options = array(), $meta = '')
{
$options = $this->getOptions($options, array('', ''));
//just prepend and/or append the options to the original text
$newtext = htmlspecialchars($options[0]) . $buffer . htmlspecialchars($options[1]);
return $newtext;
}
开发者ID:FuhrerMalkovich,项目名称:Blogpost,代码行数:16,代码来源:PreApPendTransformationsPlugin.class.php
示例7: eh
function eh($string)
{
if (!isset($string)) {
return;
}
echo htmlspecialchars($string, ENT_QUOTES);
}
开发者ID:cheyluna,项目名称:board_exercise,代码行数:7,代码来源:html_helper.php
示例8: parse_swf
function parse_swf($tree, $params = array())
{
$size = explode("x", isset($params['size']) ? $params['size'] : '740x480');
$name = $tree->toText();
$href = isset($params['swf']) ? $params['swf'] : $name;
list($w, $h) = $size;
// Can't be too sure
$w = htmlspecialchars($w);
$h = htmlspecialchars($h);
$name = htmlspecialchars($name);
$href = htmlspecialchars($href);
/*if(!$this->swfs) $this->swfs = array();
$count = array_push($this->swfs, array(
"swf" => $href,
"width" => $size[0],
"height" => $size[1]));
$id = $count-1;
return $this->simple_parse($tree, "<p id=\"swf$id\" class=\"swf\">", '</p>');*/
return <<<HTML
<div class="swf" style="width:{$w}px; height:{$h}px">
<div class="collapse">
<object width="{$w}" height="{$h}">
<param name="movie" value="{$href}"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<embed src="{$href}" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="{$w}" height="{$h}"></embed>
</object>
</div>
<a href="{$href}" onclick="showSWF(this); return false">Show {$name}</a>
</div>
HTML;
}
开发者ID:JakeCoxon,项目名称:Pages,代码行数:33,代码来源:ubbextend.php
示例9: e
public function e($var)
{
if (!is_string($var)) {
throw new Exception('$var must be a string.');
}
return htmlspecialchars($var, ENT_QUOTES);
}
开发者ID:JosePathe,项目名称:phpdim2016,代码行数:7,代码来源:PhpRenderer.php
示例10: blog_get_page_content_read
/**
* Get page components to view a blog post.
*
* @param int $guid GUID of a blog entity.
* @return array
*/
function blog_get_page_content_read($guid = NULL)
{
$return = array();
$blog = get_entity($guid);
// no header or tabs for viewing an individual blog
$return['filter'] = '';
if (!elgg_instanceof($blog, 'object', 'blog')) {
$return['content'] = elgg_echo('blog:error:post_not_found');
return $return;
}
$return['title'] = htmlspecialchars($blog->title);
$container = $blog->getContainerEntity();
$crumbs_title = $container->name;
if (elgg_instanceof($container, 'group')) {
elgg_push_breadcrumb($crumbs_title, "blog/group/{$container->guid}/all");
} else {
elgg_push_breadcrumb($crumbs_title, "blog/owner/{$container->username}");
}
elgg_push_breadcrumb($blog->title);
$return['content'] = elgg_view_entity($blog, array('full_view' => true));
//check to see if comment are on
if ($blog->comments_on != 'Off') {
$return['content'] .= elgg_view_comments($blog);
}
return $return;
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:32,代码来源:blog.php
示例11: Create
public static function Create($user_row, $uc = true)
{
if (function_exists('zuitu_uc_register') && $uc) {
$pp = $user_row['password'];
$em = $user_row['email'];
$un = $user_row['username'];
$ret = zuitu_uc_register($em, $un, $pp);
if (!$ret) {
return false;
}
}
$user_row['username'] = htmlspecialchars($user_row['username']);
$user_row['password'] = self::GenPassword($user_row['password']);
$user_row['create_time'] = $user_row['login_time'] = time();
$user_row['ip'] = Utility::GetRemoteIp();
$user_row['secret'] = md5(rand(1000000, 9999999) . time() . $user_row['email']);
$user_row['id'] = DB::Insert('user', $user_row);
$_rid = abs(intval(cookieget('_rid')));
if ($_rid && $user_row['id']) {
$r_user = Table::Fetch('user', $_rid);
if ($r_user) {
ZInvite::Create($r_user, $user_row);
ZCredit::Invite($r_user['id']);
}
}
if ($user_row['id'] == 1) {
Table::UpdateCache('user', $user_row['id'], array('manager' => 'Y', 'secret' => ''));
}
return $user_row['id'];
}
开发者ID:norain2050,项目名称:zuituware,代码行数:30,代码来源:ZUser.class.php
示例12: getCategories
/**
*
*
* @return Mage_Adminhtml_Block_Catalog_Category_Tree
*/
protected function getCategories()
{
$values = $this->getData('option_values');
if (is_null($values)) {
$values = array();
/* @var $categoryCollection Mage_Catalog_Model_Resource_Category_Collection */
$categoryCollection = Mage::getResourceModel('catalog/category_collection')->addAttributeToSelect('name')->addAttributeToSelect('is_active')->addFieldToFilter('is_active', '1')->setOrder('position', 'asc')->load();
/* @var $category Mage_Catalog_Model_Category */
foreach ($categoryCollection as $category) {
$value = array();
$value['id'] = $category->getId();
$value['parent_id'] = $category->getParentId();
if (!$category->getName()) {
continue;
}
foreach ($this->getStores() as $store) {
if ($store->getId()) {
$storeValues = $this->getStoreOptionValues($store->getId());
} else {
$storeValues[$category->getId()] = $category->getName();
}
if (isset($storeValues[$category->getId()])) {
$value[$store->getId()] = htmlspecialchars($storeValues[$category->getId()]);
} else {
$value[$store->getId()] = '';
}
}
$values[] = new Varien_Object($value);
}
$this->setData('option_values', $values);
}
return $values;
}
开发者ID:tschifftner,项目名称:Magento-MEP,代码行数:38,代码来源:Options.php
示例13: Explain
function Explain($sql, $partial = false)
{
$save = $this->conn->LogSQL(false);
if ($partial) {
$sqlq = $this->conn->qstr($sql . '%');
$arr = $this->conn->GetArray("select distinct distinct sql1 from adodb_logsql where sql1 like {$sqlq}");
if ($arr) {
foreach ($arr as $row) {
$sql = reset($row);
if (crc32($sql) == $partial) {
break;
}
}
}
}
$sql = str_replace('?', "''", $sql);
$s = '<p><b>Explain</b>: ' . htmlspecialchars($sql) . '</p>';
$rs = $this->conn->Execute('EXPLAIN ' . $sql);
$this->conn->LogSQL($save);
$s .= '<pre>';
if ($rs) {
while (!$rs->EOF) {
$s .= reset($rs->fields) . "\n";
$rs->MoveNext();
}
}
$s .= '</pre>';
$s .= $this->Tracer($sql, $partial);
return $s;
}
开发者ID:JovanyJeff,项目名称:hrp,代码行数:30,代码来源:perf-postgres.inc.php
示例14: parse
/**
* Parse the correct messages into the template
*/
protected function parse()
{
parent::parse();
// grab the error-type from the parameters
$errorType = $this->getParameter('type');
// set correct headers
switch ($errorType) {
case 'module-not-allowed':
case 'action-not-allowed':
SpoonHTTP::setHeadersByCode(403);
break;
case 'not-found':
SpoonHTTP::setHeadersByCode(404);
break;
}
// querystring provided?
if ($this->getParameter('querystring') !== null) {
// split into file and parameters
$chunks = explode('?', $this->getParameter('querystring'));
// get extension
$extension = SpoonFile::getExtension($chunks[0]);
// if the file has an extension it is a non-existing-file
if ($extension != '' && $extension != $chunks[0]) {
// set correct headers
SpoonHTTP::setHeadersByCode(404);
// give a nice error, so we can detect which file is missing
echo 'Requested file (' . htmlspecialchars($this->getParameter('querystring')) . ') not found.';
// stop script execution
exit;
}
}
// assign the correct message into the template
$this->tpl->assign('message', BL::err(SpoonFilter::toCamelCase(htmlspecialchars($errorType), '-')));
}
开发者ID:nickmancol,项目名称:forkcms-rhcloud,代码行数:37,代码来源:index.php
示例15: edit
function edit()
{
$db = new sql();
$db->connect();
$res = $db->query("select * from chapters where id=" . $this->id);
$data = $db->fetch_array($res);
$data["text"] = htmlspecialchars($data["text"]);
$true = $data["type"] == 4 ? " && true" : " && false";
$db = new sql();
$db->connect();
$res1 = $db->query("select * from types order by id");
while ($data1 = $db->fetch_array($res1)) {
$i++;
$types .= "<option" . ($data["type"] == $data1[id] ? " selected" : "") . " value=\"{$data1['id']}\">{$data1['title']}</option>";
}
$select = admin::getDateSelectOptions($data["time"]);
$chid = $this->chid;
$action = "appendEdit";
$id = '<tr>
<td>№</td>
<td><input maxlength="14" name="fields[id]" size="14" value="' . $this->id . '" readonly="readonly" style="width: auto;" value="' . $this->id . '"></td>
</tr>';
//$res2=$db->query("select id, name, short_text, time from library where id='".$data["article"]."'");
$state_selected[$data["state"]] = " selected";
$header = "Редактирование";
$lid = $this->lid;
eval("\$content=\"" . admin::template("itemAdd", "FORMPOST", array("fields[title]" => "EXISTS", "fields[url]" => "EXISTS")) . "\";");
$this->elements["content"] = $content;
}
开发者ID:BackupTheBerlios,项目名称:sitexs,代码行数:29,代码来源:item.class.php
示例16: medianValue
function medianValue($paramValue, $pName)
{
global $patient;
$txt = '';
$diff = dateDiff("-", date("Y-m-d"), $patient['date_birth']);
switch ($diff) {
case $diff >= 1 and $diff <= 30:
if ($pName->fields['lo_bound_n'] != null && $pName->fields['hi_bound_n'] != null) {
$txt .= htmlspecialchars($pName->fields['hi_bound_n']) . "<p><br>" . htmlspecialchars($pName->fields['lo_bound_n']);
}
break;
case $diff >= 31 and $diff <= 360:
if ($pName->fields['lo_bound__y'] && $pName->fields['hi_bound_y']) {
$txt .= htmlspecialchars($pName->fields['hi_bound_y']) . "<p><br>" . htmlspecialchars($pName->fields['lo_bound_y']);
}
break;
case $diff >= 361 and $diff <= 5040:
if ($pName->fields['lo_bound_c'] && $pName->fields['hi_bound_c']) {
$txt .= htmlspecialchars($pName->fields['hi_bound_c']) . "<p><br>" . htmlspecialchars($pName->fields['lo_bound_c']);
}
break;
case $diff > 5040:
if ($patient['sex'] == 'm') {
if ($pName->fields['lo_bound'] && $pName->fields['hi_bound']) {
$txt .= htmlspecialchars($pName->fields['hi_bound']) . "<p><br>" . htmlspecialchars($pName->fields['lo_bound']);
} elseif ($patient['sex'] == 'f') {
if ($pName->fields['lo_bound_f'] && $pName->fields['hi_bound_f']) {
$txt .= htmlspecialchars($pName->fields['hi_bound_f']) . "<p><br>" . htmlspecialchars($pName->fields['lo_bound_f']);
}
}
}
break;
}
return $txt;
}
开发者ID:patmark,项目名称:care2x-tz,代码行数:35,代码来源:labor-data-makegraph.php
示例17: _lines
function _lines($lines, $prefix = '', $suffix = '', $type = '')
{
if ($type == 'context') {
foreach ($lines as $line) {
$this->orig .= htmlspecialchars($line);
$this->final .= htmlspecialchars($line);
}
} elseif ($type == 'added' || $type == 'change-added') {
$l = "";
foreach ($lines as $line) {
$l .= htmlspecialchars($line);
}
if (!empty($l)) {
$this->final .= '<ins class="diffchar inserted"><strong>' . $l . "</strong></ins>";
}
} elseif ($type == 'deleted' || $type == 'change-deleted') {
$l = "";
foreach ($lines as $line) {
$l .= htmlspecialchars($line);
}
if (!empty($l)) {
$this->orig .= '<del class="diffchar deleted"><strong>' . $l . "</strong></del>";
}
}
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:25,代码来源:renderer_character.php
示例18: FmtPageList
function FmtPageList($fmt, $pagename, $opt)
{
global $GroupPattern, $FmtV, $FPLFunctions;
# if (isset($_REQUEST['q']) && $_REQUEST['q']=='') $_REQUEST['q']="''";
$rq = htmlspecialchars(stripmagic(@$_REQUEST['q']), ENT_NOQUOTES);
$FmtV['$Needle'] = $opt['o'] . ' ' . $rq;
if (preg_match("!^({$GroupPattern}(\\|{$GroupPattern})*)?/!i", $rq, $match)) {
$opt['group'] = @$match[1];
$rq = substr($rq, strlen(@$match[1]) + 1);
}
$opt = array_merge($opt, ParseArgs($opt['o'] . ' ' . $rq), @$_REQUEST);
if (@($opt['req'] && !$opt['-'] && !$opt[''] && !$opt['+'] && !$opt['q'])) {
return;
}
$GLOBALS['SearchIncl'] = array_merge((array) @$opt[''], (array) @$opt['+']);
$GLOBALS['SearchExcl'] = (array) @$opt['-'];
$GLOBALS['SearchGroup'] = @$opt['group'];
$matches = array();
$fmtfn = @$FPLFunctions[$opt['fmt']];
if (!function_exists($fmtfn)) {
$fmtfn = 'FPLByGroup';
}
$out = $fmtfn($pagename, $matches, $opt);
$FmtV['$MatchCount'] = count($matches);
if ($fmt != '$MatchList') {
$FmtV['$MatchList'] = $out;
$out = FmtPageName($fmt, $pagename);
}
if ($out[0] == '<') {
return '<div>' . Keep($out) . '</div>';
}
PRR();
return $out;
}
开发者ID:BogusCurry,项目名称:pmwiki,代码行数:34,代码来源:pagelist.php
示例19: PMA_printGitRevision
/**
* Prints details about the current Git commit revision
*
* @return void
*/
function PMA_printGitRevision()
{
if (!$GLOBALS['PMA_Config']->get('PMA_VERSION_GIT')) {
$response = PMA_Response::getInstance();
$response->isSuccess(false);
return;
}
// load revision data from repo
$GLOBALS['PMA_Config']->checkGitRevision();
// if using a remote commit fast-forwarded, link to GitHub
$commit_hash = substr($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH'), 0, 7);
$commit_hash = '<strong title="' . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_MESSAGE')) . '">' . $commit_hash . '</strong>';
if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTECOMMIT')) {
$commit_hash = '<a href="' . PMA_linkURL('https://github.com/phpmyadmin/phpmyadmin/commit/' . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH')) . '" target="_blank">' . $commit_hash . '</a>';
}
$branch = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH');
if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTEBRANCH')) {
$branch = '<a href="' . PMA_linkURL('https://github.com/phpmyadmin/phpmyadmin/tree/' . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH')) . '" target="_blank">' . $branch . '</a>';
}
if ($branch !== false) {
$branch = sprintf(__('%1$s from %2$s branch'), $commit_hash, $branch);
} else {
$branch = $commit_hash . ' (' . __('no branch') . ')';
}
$committer = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER');
$author = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR');
PMA_printListItem(__('Git revision:') . ' ' . $branch . ',<br /> ' . sprintf(__('committed on %1$s by %2$s'), PMA_Util::localisedDate(strtotime($committer['date'])), '<a href="' . PMA_linkURL('mailto:' . $committer['email']) . '">' . htmlspecialchars($committer['name']) . '</a>') . ($author != $committer ? ', <br />' . sprintf(__('authored on %1$s by %2$s'), PMA_Util::localisedDate(strtotime($author['date'])), '<a href="' . PMA_linkURL('mailto:' . $author['email']) . '">' . htmlspecialchars($author['name']) . '</a>') : ''), 'li_pma_version_git', null, null, null);
}
开发者ID:graurus,项目名称:testgit_t37,代码行数:33,代码来源:display_git_revision.lib.php
示例20: process
public function process($value, array $params = array())
{
$value = explode("||", $value);
$default = explode("||", $this->tv->get('default_text'));
$options = $this->getInputOptions();
$items = array();
$defaults = array();
$i = 0;
foreach ($options as $option) {
$opt = explode("==", $option);
$checked = false;
if (!isset($opt[1])) {
$opt[1] = $opt[0];
}
/* set checked status */
if (in_array($opt[1], $value)) {
$checked = true;
}
/* add checkbox id to defaults if is a default value */
if (in_array($opt[1], $default)) {
$defaults[] = 'tv' . $this->tv->get('id') . '-' . $i;
}
/* do escaping of strings, encapsulate in " so extjs/other systems can
* utilize values correctly in their cast
*/
if (preg_match('/^([-]?(0|0{1}[1-9]+[0-9]*|[1-9]+[0-9]*[\\.]?[0-9]*))$/', $opt[1]) == 0) {
$opt[1] = '"' . str_replace('"', '\\"', $opt[1]) . '"';
}
$items[] = array('text' => htmlspecialchars($opt[0], ENT_COMPAT, 'UTF-8'), 'value' => $opt[1], 'checked' => $checked);
$i++;
}
$this->setPlaceholder('cbdefaults', implode(',', $defaults));
$this->setPlaceholder('opts', $items);
}
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:34,代码来源:checkbox.class.php
注:本文中的htmlspecialchars函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论