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


PHP xssafe函数代码示例

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


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

示例1: getXML

 /** Returns proprietary GocDB rendering of the NGI data 
  *  in an XML String
  * @return String
  */
 public function getXML()
 {
     $helpers = $this->helpers;
     $ngis = $this->ngis;
     $xml = new \SimpleXMLElement("<results />");
     foreach ($ngis as $ngi) {
         $xmlNgi = $xml->addChild('NGI');
         $xmlNgi->addAttribute("NAME", $ngi->getName());
         $xmlNgi->addChild("PRIMARY_KEY", $ngi->getId());
         $xmlNgi->addChild("NAME", $ngi->getName());
         $xmlNgi->addChild("OBJECT_ID", $ngi->getId());
         $xmlNgi->addChild("DESCRIPTION", xssafe($ngi->getDescription()));
         $xmlNgi->addChild("EMAIL", $ngi->getEmail());
         $xmlNgi->addChild("GGUS_SU", $ngi->getGgus_Su());
         $xmlNgi->addChild("ROD_EMAIL", $ngi->getRodEmail());
         $xmlNgi->addChild("HELPDESK_EMAIL", $ngi->getHelpdeskEmail());
         $xmlNgi->addChild("SECURITY_EMAIL", $ngi->getSecurityEmail());
         $xmlNgi->addChild("SITE_COUNT", count($ngi->getSites()));
     }
     $dom_sxe = dom_import_simplexml($xml);
     $dom = new \DOMDocument('1.0');
     $dom->encoding = 'UTF-8';
     $dom_sxe = $dom->importNode($dom_sxe, true);
     $dom_sxe = $dom->appendChild($dom_sxe);
     $dom->formatOutput = true;
     $xmlString = $dom->saveXML();
     return $xmlString;
 }
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:32,代码来源:GetNGI.php

示例2: foreach

    //There is dynamic creation of table ids here which are used to show and hide the extra services info
    //when clicked. This sub table by default is hidden
    echo '</tr>';
    echo '<tr class="site_table_row_1"><td colspan="7" style="padding-left:2em">';
    echo '<a href="#b' . $count . '" onclick="showHide(\'tablei_' . $count . '\');toggleMessage(\'divi_' . $count . '\');"/><div id="divi_' . $count . '">+Show Affected Services</div></a>';
    echo '<table name="b' . $count . '" id="tablei_' . $count . '" style="clear: both; width: 100%; display:none;">';
    echo '<tr class="site_table_row_1">';
    echo '<th class="site_table">Sitename</th>';
    echo '<th class="site_table">Hostname</th>';
    echo '<th class="site_table">Production</th>';
    echo '<th class="site_table">Monitored</th>';
    foreach ($dt->getServices() as $se) {
        echo '<tr class="site_table_row_2">';
        $sID = $se->getParentSite()->getId();
        echo $td1 . '<a href="index.php?Page_Type=Site&id=' . $sID . '"/>' . xssafe($se->getParentSite()->getName()) . '</a>' . $td2;
        echo $td1 . '<a href="index.php?Page_Type=Service&id=' . $se->getId() . '"/>' . xssafe($se->getHostName()) . '</a>' . $td2;
        echo $td1 . ($se->getProduction() ? 'Yes' : 'No') . $td2;
        echo $td1 . ($se->getMonitored() ? 'Yes' : 'No') . $td2;
        echo '</tr>';
    }
    echo '</table>';
    echo '</td></tr>';
    $count++;
}
?>
           
            </table>
        </div>
        
    </div>
</div>
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:31,代码来源:downtimes_overview.php

示例3: xecho

<div class="rightPageContainer">
	<h1 class="Success">Success</h1><br />
	<?php 
$Site = $params['NewSite'];
?>
	The following services have been moved to 
	<a href="index.php?Page_Type=Site&id=<?php 
echo $Site->getId();
?>
">
    <?php 
xecho($Site->getShortName());
?>
    </a>:
	<?php 
foreach ($params['Services'] as $sep) {
    echo "<br />" . "<a href=\"index.php?Page_Type=Service&id=" . $sep->getId() . "\">" . xssafe($sep->getHostName()) . "</a> ";
}
?>
</div>
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:20,代码来源:moved_service_end_point.php

示例4: getXML

 /** Returns proprietary GocDB rendering of the downtime data 
  *  in an XML String
  * @return String
  */
 public function getXML()
 {
     $helpers = $this->helpers;
     $query = $this->query;
     $xml = new \SimpleXMLElement("<results />");
     $downtimes = $this->downtimes;
     foreach ($downtimes as $downtime) {
         // duplicate the downtime for each affected service
         foreach ($downtime->getServices() as $se) {
             $xmlDowntime = $xml->addChild('DOWNTIME');
             $xmlDowntime->addAttribute("ID", $downtime->getId());
             // Note, we are preserving the v4 primary keys here.
             $xmlDowntime->addAttribute("PRIMARY_KEY", $downtime->getPrimaryKey());
             $xmlDowntime->addAttribute("CLASSIFICATION", $downtime->getClassification());
             $xmlDowntime->addChild("PRIMARY_KEY", $downtime->getPrimaryKey());
             $xmlDowntime->addChild("SITENAME", $se->getParentSite()->getShortName());
             $xmlDowntime->addChild("HOSTNAME", $se->getHostName());
             $xmlDowntime->addChild("SERVICE_TYPE", $se->getServiceType()->getName());
             $xmlDowntime->addChild("HOSTED_BY", $se->getParentSite()->getShortName());
             $portalUrl = htmlspecialchars('#GOCDB_BASE_PORTAL_URL#/index.php?Page_Type=Downtime&id=' . $downtime->getId());
             $xmlDowntime->addChild('GOCDB_PORTAL_URL', $portalUrl);
             $xmlEndpoints = $xmlDowntime->addChild('AFFECTED_ENDPOINTS');
             if ($this->renderMultipleEndpoints) {
                 foreach ($downtime->getEndpointLocations() as $endpoint) {
                     $xmlEndpoint = $xmlEndpoints->addChild('ENDPOINT');
                     $xmlEndpoint->addChild('ID', $endpoint->getId());
                     $xmlEndpoint->addChild('NAME', $endpoint->getName());
                     // Extensions?
                     $xmlEndpoint->addChild('URL', htmlspecialchars($endpoint->getUrl()));
                     $xmlEndpoint->addChild('INTERFACENAME', $endpoint->getInterfaceName());
                 }
             }
             $xmlDowntime->addChild('SEVERITY', $downtime->getSeverity());
             $xmlDowntime->addChild('DESCRIPTION', xssafe($downtime->getDescription()));
             $xmlDowntime->addChild('INSERT_DATE', $downtime->getInsertDate()->getTimestamp());
             $xmlDowntime->addChild('START_DATE', $downtime->getStartDate()->getTimestamp());
             $xmlDowntime->addChild('END_DATE', $downtime->getEndDate()->getTimestamp());
             $xmlDowntime->addChild('REMINDER_START_DOWNTIME', $downtime->getAnnounceDate()->getTimestamp());
             // Intentionally left blank to duplicate GOCDBv4 PI behaviour
             $xmlDowntime->addChild('BROADCASTING_START_DOWNTIME', "");
         }
     }
     $dom_sxe = dom_import_simplexml($xml);
     $dom = new \DOMDocument('1.0');
     $dom->encoding = 'UTF-8';
     $dom_sxe = $dom->importNode($dom_sxe, true);
     $dom_sxe = $dom->appendChild($dom_sxe);
     $dom->formatOutput = true;
     $xmlString = $dom->saveXML();
     return $xmlString;
 }
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:55,代码来源:GetDowntimesToBroadcast.php

示例5: sizeof

// calculate the size of the impacted SEs appropriately
if (sizeof($sites) > 20) {
    $size = 20;
} else {
    $size = sizeof($sites) + 2;
}
?>
            <select style="width: 99%; margin-right: 1%"
				class="form-control" id="Select_Sites" name="select_sites" size="10"
				onclick="getSitesServices();onSiteSelected();">

                <?php 
foreach ($sites as $site) {
    $siteName = $site->getName();
    $ngiName = $site->getNgi()->getName();
    $label = xssafe($site . "   (" . $ngiName . ")");
    echo "<option value=\"{$site->getId()}\">{$label}</option>";
}
?>
            </select> <br /> <br />
		</div>

		<div id="chooseServices"
			style="width: 50%; float: left; display: inline-block;">
			<!-- Region that will show the services of a chosen site via AJAX-->
		</div>


		<!--  Create a hidden field to pass the confirmed value which at this point is false-->
        <?php 
$confirmed = false;
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:31,代码来源:add_downtime.php

示例6: printf

if (isset($_REQUEST['logout']) && $_REQUEST['logout'] || isset($logout) && $logout) {
    $user->logout($idsession);
}
$link = "?language=" . $lang;
if (!empty($idsession)) {
    $link .= "&amp;idsession=" . $idsession;
}
if ($user->error) {
    printf($html->string_error, $user->error);
}
if ($user->authenticated == 1) {
    if (isset($_REQUEST)) {
        $zonename = $_REQUEST['zonename'];
        $zonetype = $_REQUEST['zonetype'];
        $server = $_REQUEST['server'];
    }
    $zone = new Zone($zonename, $zonetype);
    if ($zone->error) {
        printf($html->string_error, $zone->error);
    } else {
        if ($zone->RetrieveUser() != $user->userid && ($config->usergroups && $zone->RetrieveUser() != $group->groupid)) {
            printf($html->string_error, $l['str_you_dont_own_this_zone']);
        } else {
            $title = sprintf($l['str_zone_content_for_x_on_server_x'], $zone->zonename, xssafe($server));
            $content = sprintf("\n<pre>%s</pre>", xssafe(zoneDig($server, $zonename)));
            print $html->box('digwindow', $title, $content);
        }
    }
}
// print close "window"
print $html->footerlight();
开发者ID:RzeszowPL,项目名称:freedns,代码行数:31,代码来源:digwindow.php

示例7: foreach

<?php

$services = $params['services'];
$configService = \Factory::getConfigService();
?>
<!-- Dynamically create a select list from a sites services -->
<label> Select Affected Services+Endpoints (Ctrl+click to select)</label> 
<select name="IMPACTED_IDS[]" id="Select_Services" size="10" class="form-control" onclick="" style="width:99%; margin-left:1%" onChange="selectServicesEndpoint()" multiple>
<?php 
foreach ($services as $service) {
    $count = 0;
    echo "<option value=\"s" . $service->getId() . "\" id=\"" . $service->getId() . "\" SELECTED>" . '(' . xssafe($service->getServiceType()->getName()) . ') ' . xssafe($service->getHostName()) . "</option>";
    foreach ($service->getEndpointLocations() as $endpoint) {
        if ($endpoint->getName() == '') {
            $name = xssafe('myEndpoint');
        } else {
            $name = xssafe($endpoint->getName());
        }
        //Option styling doesn't work well cross browser so just use 4 spaces to indent the branch
        echo "<option id=\"" . $service->getId() . "\" value=\"e" . $endpoint->getId() . "\" SELECTED>&nbsp&nbsp&nbsp&nbsp-" . $name . "</option>";
        $count++;
    }
}
?>
	
</select>
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:26,代码来源:view_nested_endpoints_list.php

示例8: foreach

    <?php 
if (count($endpoints > 1)) {
    echo "<li><b>Affecting Endpoints:</b>";
} else {
    echo "<li><b>Affecting Endpoint:</b>";
}
?>
     
    	<ul>
    	<?php 
foreach ($endpoints as $id) {
    $endpoint = \Factory::getServiceService()->getEndpoint($id);
    if ($endpoint->getName() != '') {
        $name = xssafe($endpoint->getName());
    } else {
        $name = xssafe("myEndpoint");
    }
    echo "<li>" . $name . "</li>";
}
?>
    	</ul>
    </li>
 	</ul>
 	<!-- Echo out a page type of edit or add downtime depending on type.  -->
 	<?php 
if (!$edit) {
    ?>
    <form name="Add_Downtime" action="index.php?Page_Type=Add_Downtime" 
          method="post" class="inputForm" id="Downtime_Form" name=Downtime_Form 
          onsubmit="document.getElementById('confirmSubmitBtn').disabled=true">
    <?php 
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:31,代码来源:confirm_add_downtime.php

示例9: xssafe

<div class="rightPageContainer">
    <h1>Update Certificate DN</h1>
    <br />
    <br />
    The current certificate DN for 
    <b><?php 
echo xssafe($params['Title']) . " " . xssafe($params['Forename']) . " " . xssafe($params['Surname']);
?>
</b>
    is:
    <br />
    <?php 
xecho($params['CertDN']);
?>
    <br />
    <br />
    <form class="inputForm" method="post" action="index.php?Page_Type=Admin_Edit_User_DN" name="editSType">
        <span class="input_name">New Certificate DN</span>
        <input type="text" value="<?php 
xecho($params['CertDN']);
?>
" name="DN" class="input_input_text">
        <input class="input_input_hidden" type="hidden" name="ID" value="<?php 
echo $params['ID'];
?>
" />
        <br />
        <input type="submit" value="Update DN" class="input_button">
    </form>
</div>
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:30,代码来源:edit_user_dn.php

示例10: human_timing

                    </div>
                <?php 
        } else {
            ?>
                    <div class="fr app-note-time"><?php 
            echo human_timing(intval($note['time']));
            ?>
</div>
                <?php 
        }
        ?>
                <?php 
        if ($note['type'] == 'comment') {
            ?>
                    <div class="app-note-text autolink"><?php 
            echo nl2br(xssafe($note['text']));
            ?>
</div>
                <?php 
        }
        ?>
            </div>
        <?php 
        $prev_reviewer = $note['reviewer'];
        $prev_type = $note['type'];
    }
    ?>
    </div>
</div>
<?php 
}
开发者ID:matthew0x40,项目名称:apply,代码行数:31,代码来源:app.html.php

示例11: getXML

 /** 
  * Returns proprietary GocDB rendering of the certification status change data 
  * in an XML String
  *  
  * @return String
  */
 public function getXML()
 {
     $helpers = $this->helpers;
     $allLogs = $this->allLogs;
     $xml = new \SimpleXMLElement("<results />");
     foreach ($allLogs as $log) {
         $xmlLog = $xml->addChild('result');
         if ($log->getAddedDate() != null) {
             // e.g. <TIME>02-JUL-2013 12.51.58</TIME>
             $xmlLog->addChild('TIME', $log->getAddedDate()->format('d-M-Y H.i.s'));
             // e.g. <UNIX_TIME>1372769518</UNIX_TIME>
             $xmlLog->addChild('UNIX_TIME', $log->getAddedDate()->format('U'));
         }
         $xmlLog->addChild('SITE', $log->getParentSite()->getShortName());
         $xmlLog->addChild('OLD_STATUS', $log->getOldStatus());
         $xmlLog->addChild('NEW_STATUS', $log->getNewStatus());
         $xmlLog->addChild('CHANGED_BY', $log->getAddedBy());
         $xmlLog->addChild('COMMENT', xssafe($log->getReason()));
     }
     $dom_sxe = dom_import_simplexml($xml);
     $dom = new \DOMDocument('1.0');
     $dom->encoding = 'UTF-8';
     $dom_sxe = $dom->importNode($dom_sxe, true);
     $dom_sxe = $dom->appendChild($dom_sxe);
     $dom->formatOutput = true;
     $xmlString = $dom->saveXML();
     return $xmlString;
 }
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:34,代码来源:GetCertStatusChanges.php

示例12: account_desc

function account_desc($email, $nl2br = true)
{
    $desc = account_exists($email) ? account_data($email)['desc'] : '';
    $desc = xssafe($desc);
    return $nl2br ? nl2br($desc) : $desc;
}
开发者ID:matthew0x40,项目名称:apply,代码行数:6,代码来源:account.php

示例13: getXML

 /** Returns proprietary GocDB rendering of the service group data 
  *  in an XML String
  * @return String
  */
 public function getXML()
 {
     $helpers = $this->helpers;
     $xml = new \SimpleXMLElement("<results />");
     $sgs = $this->sgs;
     foreach ($sgs as $sg) {
         $xmlSg = $xml->addChild('SERVICE_GROUP');
         $xmlSg->addAttribute("PRIMARY_KEY", $sg->getId() . "G0");
         $xmlSg->addChild('NAME', $sg->getName());
         $xmlSg->addChild('DESCRIPTION', htmlspecialchars($sg->getDescription()));
         $mon = $sg->getMonitored() ? 'Y' : 'N';
         $xmlSg->addChild('MONITORED', $mon);
         $xmlSg->addChild('CONTACT_EMAIL', $sg->getEmail());
         $url = '#GOCDB_BASE_PORTAL_URL#/index.php?Page_Type=Service_Group&id=' . $sg->getId();
         $url = htmlspecialchars($url);
         $xmlSg->addChild('GOCDB_PORTAL_URL', $url);
         foreach ($sg->getServices() as $service) {
             // maybe Rename SERVICE_ENDPOINT to SERVICE
             $xmlService = $xmlSg->addChild('SERVICE_ENDPOINT');
             $xmlService->addAttribute("PRIMARY_KEY", $service->getId() . "G0");
             $xmlService->addChild('HOSTNAME', $service->getHostName());
             $url = '#GOCDB_BASE_PORTAL_URL#/index.php?Page_Type=Service&id=' . $service->getId();
             $xmlService->addChild('GOCDB_PORTAL_URL', htmlspecialchars($url));
             $xmlService->addChild('SERVICE_TYPE', $service->getServiceType()->getName());
             $xmlService->addChild('HOST_IP', $service->getIpAddress());
             $xmlService->addChild('HOST_IPV6', $service->getIpV6Address());
             $xmlService->addChild('HOSTDN', $service->getDN());
             $prod = $service->getProduction() ? 'Y' : 'N';
             $xmlService->addChild('IN_PRODUCTION', $prod);
             $mon = $service->getMonitored() ? 'Y' : 'N';
             $xmlService->addChild('NODE_MONITORED', $mon);
             if ($this->renderMultipleEndpoints) {
                 $xmlEndpoints = $xmlService->addChild('ENDPOINTS');
                 foreach ($service->getEndpointLocations() as $endpoint) {
                     $xmlEndpoint = $xmlEndpoints->addChild('ENDPOINT');
                     $xmlEndpoint->addChild('ID', $endpoint->getId());
                     $xmlEndpoint->addChild('NAME', htmlspecialchars($endpoint->getName()));
                     // Endpoint Extensions
                     $xmlEndpointExtensions = $xmlEndpoint->addChild('EXTENSIONS');
                     foreach ($endpoint->getEndpointProperties() as $prop) {
                         $xmlProperty = $xmlEndpointExtensions->addChild('EXTENSION');
                         $xmlProperty->addChild('LOCAL_ID', $prop->getId());
                         $xmlProperty->addChild('KEY', xssafe($prop->getKeyName()));
                         $xmlProperty->addChild('VALUE', xssafe($prop->getKeyValue()));
                     }
                     $xmlEndpoint->addChild('URL', htmlspecialchars($endpoint->getUrl()));
                     $xmlEndpoint->addChild('INTERFACENAME', $endpoint->getInterfaceName());
                 }
             }
             // Service Extensions
             $xmlServiceExtensions = $xmlService->addChild('EXTENSIONS');
             foreach ($service->getServiceProperties() as $prop) {
                 $xmlProperty = $xmlServiceExtensions->addChild('EXTENSION');
                 $xmlProperty->addChild('LOCAL_ID', $prop->getId());
                 $xmlProperty->addChild('KEY', xssafe($prop->getKeyName()));
                 $xmlProperty->addChild('VALUE', xssafe($prop->getKeyValue()));
             }
         }
         // SG extensions
         $xmlSGExtensions = $xmlSg->addChild('EXTENSIONS');
         foreach ($sg->getServiceGroupProperties() as $sgProp) {
             $xmlSgProperty = $xmlSGExtensions->addChild('EXTENSION');
             $xmlSgProperty->addChild('LOCAL_ID', $sgProp->getId());
             $xmlSgProperty->addChild('KEY', xssafe($sgProp->getKeyName()));
             $xmlSgProperty->addChild('VALUE', xssafe($sgProp->getKeyValue()));
         }
     }
     $dom_sxe = dom_import_simplexml($xml);
     $dom = new \DOMDocument('1.0');
     $dom->encoding = 'UTF-8';
     $dom_sxe = $dom->importNode($dom_sxe, true);
     $dom_sxe = $dom->appendChild($dom_sxe);
     $dom->formatOutput = true;
     $xmlString = $dom->saveXML();
     return $xmlString;
 }
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:80,代码来源:GetServiceGroup.php

示例14: foreach

    <form name="Move_Site" action="index.php?Page_Type=Admin_Move_Site" method="post" class="inputForm">
    	<h1>Move Site</h1>
    	<br />
    	
    	<span class="input_name">New NGI for selected sites</span>
    	<select class="add_edit_form" name="NewNGI">
    		<?php 
foreach ($params['Ngis'] as $NGI) {
    echo "<option value=\"" . $NGI->getId() . "\">" . xssafe($NGI->getName()) . "</option>";
}
?>
    	</select>
    	
    	<span class="input_name">Please select the site(s) to be moved from 
    	    <?php 
xecho($params['OldNgi']);
?>
</span>
		<select class="Downtime_Select" name="Sites[]" size="20" 
    	 multiple id="Sites" style="margin-left: 0em; width: 38em;">
            <?php 
foreach ($params['sites'] as $site) {
    echo "<option value=\"" . $site->getId() . "\">" . xssafe($site->getShortName()) . "</option>";
}
?>
        </select>
    	
    	<br>
    	<input class="input_button" type="submit" value="Move Site" />
    </form>
</div>
开发者ID:Tom-Byrne,项目名称:gocdb,代码行数:31,代码来源:move_site.php

示例15: xecho

function xecho($data)
{
    if (!isset($data)) {
        return;
    }
    echo xssafe($data);
}
开发者ID:matthew0x40,项目名称:apply,代码行数:7,代码来源:functions.php


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