本文整理汇总了PHP中PMA_Message::sanitize方法的典型用法代码示例。如果您正苦于以下问题:PHP PMA_Message::sanitize方法的具体用法?PHP PMA_Message::sanitize怎么用?PHP PMA_Message::sanitize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PMA_Message
的用法示例。
在下文中一共展示了PMA_Message::sanitize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PMA_getWarningMessages
/**
* get the warning messages array
*
* @return array $warning_essages
*/
function PMA_getWarningMessages()
{
$warning_essages = array();
foreach ($GLOBALS['dbi']->getWarnings() as $warning) {
$warning_essages[] = PMA_Message::sanitize($warning['Level'] . ': #' . $warning['Code'] . ' ' . $warning['Message']);
}
return $warning_essages;
}
示例2: PMA_DBI_insert_id
$insert_id = PMA_DBI_insert_id();
if ($insert_id != 0) {
// insert_id is id of FIRST record inserted in one insert, so if we
// inserted multiple rows, we had to increment this
if ($total_affected_rows > 0) {
$insert_id = $insert_id + $total_affected_rows - 1;
}
$last_message = PMA_Message::notice(__('Inserted row id: %1$d'));
$last_message->addParam($insert_id);
$last_messages[] = $last_message;
}
PMA_DBI_free_result($result);
}
// end if
foreach (PMA_DBI_get_warnings() as $warning) {
$warning_messages[] = PMA_Message::sanitize($warning['Level'] . ': #' . $warning['Code'] . ' ' . $warning['Message']);
}
unset($result);
}
unset($single_query, $query);
if ($is_insert && count($value_sets) > 0) {
$message = PMA_Message::inserted_rows($total_affected_rows);
} else {
$message = PMA_Message::affected_rows($total_affected_rows);
}
$message->addMessages($last_messages, '<br />');
if (!empty($warning_messages)) {
$message->addMessages($warning_messages, '<br />');
$message->isError(true);
}
if (!empty($error_messages)) {
示例3: sanitize
/**
* Sanitizes $message
*
* @param mixed $message the message(s)
*
* @return mixed the sanitized message(s)
* @access public
* @static
*/
public static function sanitize($message)
{
if (is_array($message)) {
foreach ($message as $key => $val) {
$message[$key] = PMA_Message::sanitize($val);
}
return $message;
}
return htmlspecialchars($message);
}
示例4: testSanitize
/**
* testing sanitize method
*
* @return void
*/
public function testSanitize()
{
$this->object->setString('test&string<>', false);
$this->assertEquals('test&string<>', PMA_Message::sanitize($this->object));
$this->assertEquals(array('test&string<>', 'test&string<>'), PMA_Message::sanitize(array($this->object, $this->object)));
}