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


PHP string_html_specialchars函数代码示例

本文整理汇总了PHP中string_html_specialchars函数的典型用法代码示例。如果您正苦于以下问题:PHP string_html_specialchars函数的具体用法?PHP string_html_specialchars怎么用?PHP string_html_specialchars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: print_config_value_as_string

function print_config_value_as_string($p_type, $p_value)
{
    switch ($p_type) {
        case CONFIG_TYPE_INT:
            $t_value = (int) $p_value;
            echo $t_value;
            return;
        case CONFIG_TYPE_STRING:
            $t_value = config_eval($p_value);
            echo string_nl2br(string_html_specialchars("'{$t_value}'"));
            return;
        case CONFIG_TYPE_COMPLEX:
            $t_value = unserialize($p_value);
            break;
        default:
            $t_value = config_eval($p_value);
            break;
    }
    echo '<pre>';
    if (function_exists('var_export')) {
        var_export($t_value);
    } else {
        print_r($t_value);
    }
    echo '</pre>';
}
开发者ID:amjadtbssm,项目名称:website,代码行数:26,代码来源:adm_config_report.php

示例2: menu_manage

 public function menu_manage($event, $user_id)
 {
     if (access_has_global_level(plugin_config_get("manage_customers_threshold"))) {
         $page = plugin_page("manage_customers");
         $label = plugin_lang_get("manage_customers");
         return '<a href="' . string_html_specialchars($page) . '">' . $label . '</a>';
     }
 }
开发者ID:WilfriedMartin,项目名称:customer-management,代码行数:8,代码来源:CustomerManagement.php

示例3: print_document_selection

/**
 * @param $types
 */
function print_document_selection($types)
{
    $project_id = gpc_get_int('project_id', helper_get_current_project());
    $specmanagement_database_api = new specmanagement_database_api();
    echo '<select name="version_id">';
    foreach ($types as $type) {
        $type_string = string_html_specialchars($type);
        $type_id = $specmanagement_database_api->get_type_id($type);
        $version_id_array = get_version_ids($type_id, $project_id);
        foreach ($version_id_array as $version_id) {
            $version_spec_project_id = version_get_field($version_id, 'project_id');
            if (project_includes_user($version_spec_project_id, auth_get_current_user_id()) || user_is_administrator(auth_get_current_user_id())) {
                $version_string = version_full_name($version_id);
                echo '<option value="' . $version_id . '">';
                echo $type_string . " - " . $version_string;
                echo '</option>';
            }
        }
    }
    echo '</select>';
}
开发者ID:Cre-ator,项目名称:Whiteboard.SpecificationManagement-Plugin,代码行数:24,代码来源:choose_document.php

示例4: print_config_value_as_string

function print_config_value_as_string($p_type, $p_value, $p_for_display = true)
{
    $t_corrupted = false;
    switch ($p_type) {
        case CONFIG_TYPE_DEFAULT:
            return;
        case CONFIG_TYPE_FLOAT:
            echo (double) $p_value;
            return;
        case CONFIG_TYPE_INT:
            echo (int) $p_value;
            return;
        case CONFIG_TYPE_STRING:
            $t_value = string_nl2br(string_html_specialchars(config_eval($p_value)));
            if ($p_for_display) {
                $t_value = '<p id="adm-config-value">' . "'{$t_value}'" . '</p>';
            }
            echo $t_value;
            return;
        case CONFIG_TYPE_COMPLEX:
            $t_value = @unserialize($p_value);
            if ($t_value === false) {
                $t_corrupted = true;
            }
            break;
        default:
            $t_value = config_eval($p_value);
            break;
    }
    if ($t_corrupted) {
        $t_output = $p_for_display ? lang_get('configuration_corrupted') : '';
    } else {
        $t_output = var_export($t_value, true);
    }
    if ($p_for_display) {
        echo '<pre id="adm-config-value">' . string_attribute($t_output) . '</pre>';
    } else {
        echo $t_output;
    }
}
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:40,代码来源:adm_config_report.php

示例5: print_config_value_as_string

function print_config_value_as_string($p_type, $p_value)
{
    $t_corrupted = false;
    switch ($p_type) {
        case CONFIG_TYPE_FLOAT:
            $t_value = (double) $p_value;
            echo $t_value;
            return;
        case CONFIG_TYPE_INT:
            $t_value = (int) $p_value;
            echo $t_value;
            return;
        case CONFIG_TYPE_STRING:
            $t_value = config_eval($p_value);
            echo string_nl2br(string_html_specialchars("'{$t_value}'"));
            return;
        case CONFIG_TYPE_COMPLEX:
            $t_value = @unserialize($p_value);
            if ($t_value === false) {
                $t_corrupted = true;
            }
            break;
        default:
            $t_value = config_eval($p_value);
            break;
    }
    echo '<pre>';
    if ($t_corrupted) {
        echo lang_get('configuration_corrupted');
    } else {
        if (function_exists('var_export')) {
            var_export($t_value);
        } else {
            print_r($t_value);
        }
    }
    echo '</pre>';
}
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:38,代码来源:adm_config_report.php

示例6: require_api

require_api('html_api.php');
require_api('lang_api.php');
require_api('print_api.php');
require_api('project_api.php');
require_api('string_api.php');
form_security_validate('manage_config_revert');
auth_reauthenticate();
$f_project_id = gpc_get_int('project', 0);
$f_revert = gpc_get_string('revert', '');
$f_return = gpc_get_string('return');
$t_access = true;
$t_revert_vars = explode(',', $f_revert);
array_walk($t_revert_vars, 'trim');
foreach ($t_revert_vars as $t_revert) {
    $t_access &= access_has_project_level(config_get_access($t_revert), $f_project_id);
}
if (!$t_access) {
    access_denied();
}
if ('' != $f_revert) {
    # Confirm with the user
    helper_ensure_confirmed(lang_get('config_delete_sure') . lang_get('word_separator') . string_html_specialchars(implode(', ', $t_revert_vars)) . lang_get('word_separator') . lang_get('in_project') . lang_get('word_separator') . project_get_name($f_project_id), lang_get('delete_config_button'));
    foreach ($t_revert_vars as $t_revert) {
        config_delete($t_revert, null, $f_project_id);
    }
}
form_security_purge('manage_config_revert');
$t_redirect_url = $f_return;
html_page_top(null, $t_redirect_url);
html_operation_successful($t_redirect_url);
html_page_bottom();
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:31,代码来源:manage_config_revert.php

示例7: tag_stats_related

$t_tags_related = tag_stats_related($f_tag_id);
if (count($t_tags_related)) {
    ?>
	<div class="field-container">
		<span class="display-label"><span><?php 
    echo lang_get('tag_related');
    ?>
</span></span>
		<div class="display-value">
			<table id="related-tags" class="tag-list">
<?php 
    foreach ($t_tags_related as $t_tag) {
        $t_name = string_display_line($t_tag['name']);
        $t_description = string_display_line($t_tag['description']);
        $t_count = $t_tag['count'];
        $t_link = string_html_specialchars('search.php?tag_string=' . urlencode('+' . $t_tag_row['name'] . config_get('tag_separator') . '+' . $t_name));
        $t_label = sprintf(lang_get('tag_related_issues'), $t_tag['count']);
        ?>
			<tr>
				<td><span class="tag-link"><a href="tag_view_page.php?tag_id=<?php 
        echo $t_tag['id'];
        ?>
" title="<?php 
        echo $t_description;
        ?>
"><?php 
        echo $t_name;
        ?>
</a></span></td>
				<td><span class="tag-filter"><a href="<?php 
        echo $t_link;
开发者ID:gtn,项目名称:mantisbt,代码行数:31,代码来源:tag_view_page.php

示例8: string_attribute

/**
 * Process a string for display in a text box
 * @param string $p_string String to be processed.
 * @return string
 */
function string_attribute($p_string)
{
    return string_html_specialchars($p_string);
}
开发者ID:derrickweaver,项目名称:mantisbt,代码行数:9,代码来源:string_api.php

示例9: tag_display_link

/**
 * Display a tag hyperlink.
 * If a bug ID is passed, the tag link will include a detach link if the
 * user has appropriate privileges.
 * @param array Tag row
 * @param integer Bug ID
 */
function tag_display_link($p_tag_row, $p_bug_id = 0)
{
    static $t_security_token = null;
    if (is_null($t_security_token)) {
        $t_security_token = htmlspecialchars(form_security_param('tag_detach'));
    }
    if (auth_get_current_user_id() == $p_tag_row['user_attached'] || auth_get_current_user_id() == $p_tag_row['user_id']) {
        $t_detach = config_get('tag_detach_own_threshold');
    } else {
        $t_detach = config_get('tag_detach_threshold');
    }
    $t_name = string_display_line($p_tag_row['name']);
    $t_description = string_display_line($p_tag_row['description']);
    echo "<a href='tag_view_page.php?tag_id={$p_tag_row['id']}' title='{$t_description}'>{$t_name}</a>";
    if ($p_bug_id > 0 && access_has_bug_level($t_detach, $p_bug_id)) {
        $t_tooltip = string_html_specialchars(sprintf(lang_get('tag_detach'), $t_name));
        echo " <a href='tag_detach.php?bug_id={$p_bug_id}&amp;tag_id={$p_tag_row['id']}{$t_security_token}'><img src='images/delete.png' class='delete-icon' title=\"{$t_tooltip}\" alt=\"X\"/></a>";
    }
    return true;
}
开发者ID:Kirill,项目名称:mantisbt,代码行数:27,代码来源:tag_api.php

示例10: print_project_access_levels_option_list

function print_project_access_levels_option_list($p_val, $p_project_id = null)
{
    $t_current_user_access_level = access_get_project_level($p_project_id);
    $t_access_levels_enum_string = config_get('access_levels_enum_string');
    $t_enum_values = MantisEnum::getValues($t_access_levels_enum_string);
    foreach ($t_enum_values as $t_enum_value) {
        # a user must not be able to assign another user an access level that is higher than theirs.
        if ($t_enum_value > $t_current_user_access_level) {
            continue;
        }
        $t_access_level = get_enum_element('access_levels', $t_enum_value);
        echo '<option value="' . $t_enum_value . '"';
        check_selected($p_val, $t_enum_value);
        echo '>' . string_html_specialchars($t_access_level) . '</option>';
    }
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:16,代码来源:print_api.php

示例11: print_hidden_inputs

function print_hidden_inputs($p_assoc_array)
{
    foreach ($p_assoc_array as $key => $val) {
        $key = string_html_specialchars($key);
        if (is_array($val)) {
            foreach ($val as $val2) {
                $val2 = string_html_specialchars($val2);
                print "<input type=\"hidden\" name=\"{$val}\\[\\]\" value=\"{$val2}\" />\n";
            }
        } else {
            $val = string_html_specialchars($val);
            print "<input type=\"hidden\" name=\"{$key}\" value=\"{$val}\" />\n";
        }
    }
}
开发者ID:jin255ff,项目名称:company_website,代码行数:15,代码来源:print_api.php

示例12: rss

 /**
  * RSS text processing.
  * @param string Event name
  * @param string Unformatted text
  * @return string Formatted text
  */
 function rss($p_event, $p_string)
 {
     static $s_text, $s_urls, $s_buglinks, $s_vcslinks;
     $t_string = $p_string;
     if (null === $s_text) {
         $s_text = plugin_config_get('process_text');
         $s_urls = plugin_config_get('process_urls');
         $s_buglinks = plugin_config_get('process_buglinks');
         $s_vcslinks = plugin_config_get('process_vcslinks');
     }
     if (ON == $s_text) {
         $t_string = string_strip_hrefs($t_string);
         $t_string = string_html_specialchars($t_string);
         $t_string = string_restore_valid_html_tags($t_string);
         $t_string = string_nl2br($t_string);
     }
     if (ON == $s_urls) {
         $t_string = string_insert_hrefs($t_string);
     }
     if (ON == $s_buglinks) {
         $t_string = string_process_bug_link($t_string, true, false, true);
         $t_string = string_process_bugnote_link($t_string, true, false, true);
     }
     if (ON == $s_vcslinks) {
         $t_string = string_process_cvs_link($t_string);
     }
     return $t_string;
 }
开发者ID:nourchene-benslimane,项目名称:mantisV0,代码行数:34,代码来源:MantisCoreFormatting.php

示例13: lang_get

        echo '<img src="' . $t_icon_path . 'protected.gif" width="8" height="15" alt="' . lang_get('private') . '" />';
    }
    ?>
		</span>
	</td>

	<?php 
    # -- Summary --
    ?>
	<td class="left my-buglist-description">
		<?php 
    if (ON == config_get('show_bug_project_links') && helper_get_current_project() != $t_bug->project_id) {
        echo '<span class="small project">[', string_display_line(project_get_name($t_bug->project_id)), '] </span>';
    }
    $t_bug_url = string_get_bug_view_url($t_bug->id, null);
    $t_bug_url_title = string_html_specialchars(sprintf(lang_get('label'), lang_get('issue_id') . $t_bug->id) . lang_get('word_separator') . $t_bug->summary);
    echo "<span class=\"small summary\"><a href=\"{$t_bug_url}\" title=\"{$t_bug_url_title}\">{$t_summary}</a></span><br />";
    ?>
		<?php 
    # type project name if viewing 'all projects' or bug is in subproject
    echo '<span class="small category">', string_display_line(category_full_name($t_bug->category_id, true, $t_bug->project_id)), '</span>';
    echo '<span class="small last-modified"> - ';
    if ($t_bug->last_updated > strtotime('-' . $t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED] . ' hours')) {
        echo '<strong>' . $t_last_updated . '</strong>';
    } else {
        echo $t_last_updated;
    }
    echo '</span>';
    ?>
	</td>
</tr>
开发者ID:N0ctrnl,项目名称:mantisbt,代码行数:31,代码来源:my_view_inc.php

示例14: error_string

					print error_string(ERROR_ACCESS_DENIED);
				} else {
					if ( !is_blank( $u_email ) ) {
						print_email_link( $u_email, $u_email );
					} else {
						echo " - ";
					}
				} ?>
		</span></span>
		<span class="label-style"></span>
	</div>
	<div class="field-container <?php echo helper_alternate_class_no_attribute(); ?>">
		<span class="display-label"><span><?php echo lang_get( 'realname' ) ?></span></span>
		<span class="display-value"><span><?php
			if ( ! ( $t_can_manage || $t_can_see_realname ) ) {
				print error_string(ERROR_ACCESS_DENIED);
			} else {
				echo string_display_line( $u_realname );
			} ?>
		</span></span>
		<span class="label-style"></span>
	</div>
	<span class="section-links">
	<?php if ( $t_can_manage ) { ?>
			<span id="manage-user-link"><a href="<?php echo string_html_specialchars( 'manage_user_edit_page.php?user_id=' . $f_user_id ); ?>"><?php echo lang_get( 'manage_user' ); ?></a></span>
	<?php } ?>
	</span>
</div><?php

html_page_bottom();
开发者ID:rombert,项目名称:mantisbt,代码行数:30,代码来源:view_user_page.php

示例15: log_print_to_page

function log_print_to_page()
{
    if (config_get_global('log_destination') === 'page' && auth_is_user_authenticated() && access_has_global_level(config_get('show_log_threshold'))) {
        global $g_log_events, $g_log_levels;
        echo "\n\n<!--Mantis Debug Log Output-->";
        echo "<hr />\n";
        echo "<table id=\"log-event-list\">\n";
        echo "\t<thead>\n";
        echo "\t\t<tr>\n";
        echo "\t\t\t<th>" . lang_get('log_page_number') . "</th>\n";
        echo "\t\t\t<th>" . lang_get('log_page_time') . "</th>\n";
        echo "\t\t\t<th>" . lang_get('log_page_caller') . "</th>\n";
        echo "\t\t\t<th>" . lang_get('log_page_event') . "</th>\n";
        echo "\t\t</tr>\n";
        echo "\t</thead>\n";
        echo "\t<tbody>\n";
        $t_unique_queries_count = 0;
        $t_total_query_execution_time = 0;
        $t_unique_queries = array();
        $t_total_queries_count = 0;
        $t_total_event_count = count($g_log_events);
        if ($t_total_event_count == 0) {
            echo "\t</tbody>\n\t</table>\n";
            echo "<!--END Mantis Debug Log Output-->\n\n";
            return;
        }
        for ($i = 0; $i < $t_total_event_count; $i++) {
            if ($g_log_events[$i][1] == LOG_DATABASE) {
                if (!in_array($g_log_events[$i][2][0], $t_unique_queries)) {
                    $t_unique_queries_count++;
                    $g_log_events[$i][2][2] = false;
                    array_push($t_unique_queries, $g_log_events[$i][2][0]);
                } else {
                    $g_log_events[$i][2][2] = true;
                }
                $t_total_query_execution_time += $g_log_events[$i][2][1];
            }
        }
        $t_count = array();
        foreach ($g_log_events as $t_log_event) {
            $t_level = $g_log_levels[$t_log_event[1]];
            $t_count[$t_log_event[1]]++;
            switch ($t_log_event[1]) {
                case LOG_DATABASE:
                    $t_total_queries_count++;
                    $t_query_duplicate_class = '';
                    if ($t_log_event[2][2]) {
                        $t_query_duplicate_class = ' class="duplicate-query"';
                    }
                    echo "\t\t<tr{$t_query_duplicate_class}><td>" . $t_level . '-' . $t_count[$t_log_event[1]] . "</td><td>" . $t_log_event[2][1] . "</td><td>" . string_html_specialchars($t_log_event[3]) . "</td><td>" . string_html_specialchars($t_log_event[2][0]) . "</td></tr>\n";
                    break;
                default:
                    echo "\t\t<tr><td>" . $t_level . '-' . $t_count[$t_log_event[1]] . "</td><td>" . $t_log_event[2][1] . "</td><td>" . string_html_specialchars($t_log_event[3]) . "</td><td>" . string_html_specialchars($t_log_event[2][0]) . "</td></tr>\n";
            }
        }
        # output any summary data
        if ($t_unique_queries_count != 0) {
            $t_unique_queries_executed = sprintf(lang_get('unique_queries_executed'), $t_unique_queries_count);
            echo "\t\t<tr><td>" . $g_log_levels[LOG_DATABASE] . '</td><td colspan="3">' . $t_unique_queries_executed . "</td></tr>\n";
        }
        if ($t_total_queries_count != 0) {
            $t_total_queries_executed = sprintf(lang_get('total_queries_executed'), $t_total_queries_count);
            echo "\t\t<tr><td>" . $g_log_levels[LOG_DATABASE] . '</td><td colspan="3">' . $t_total_queries_executed . "</td></tr>\n";
        }
        if ($t_total_query_execution_time != 0) {
            $t_total_query_time = sprintf(lang_get('total_query_execution_time'), $t_total_query_execution_time);
            echo "\t\t<tr><td>" . $g_log_levels[LOG_DATABASE] . '</td><td colspan="3">' . $t_total_query_time . "</td></tr>\n";
        }
        echo "\t</tbody>\n\t</table>\n";
    }
    echo "<!--END Mantis Debug Log Output-->\n\n";
}
开发者ID:nextgens,项目名称:mantisbt,代码行数:72,代码来源:logging_api.php


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