本文整理汇总了PHP中sensitiveIO::sanitizeURLString方法的典型用法代码示例。如果您正苦于以下问题:PHP sensitiveIO::sanitizeURLString方法的具体用法?PHP sensitiveIO::sanitizeURLString怎么用?PHP sensitiveIO::sanitizeURLString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sensitiveIO
的用法示例。
在下文中一共展示了sensitiveIO::sanitizeURLString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getFilename
/**
* Get the page filename.
*
* @return string The filename without path indication, false if never validated or outside of userspace.
* @access private
*/
protected function _getFilename($regenerate = false)
{
if (trim($this->_pageURL) && !$regenerate) {
return $this->_pageURL;
} else {
//check if page has been validated, if so, generate data from title
if ($this->getPublication() != RESOURCE_PUBLICATION_NEVERVALIDATED && $this->getLocation() == RESOURCE_LOCATION_USERSPACE) {
//create new filename
$title = $this->getTitle(true);
if (!$title) {
//no public title found, to avoid error, try to use the edited one.
$title = $this->getTitle(false);
if (!$title) {
$this->raiseError("Can't get page title for page " . $this->getID() . " to create page filename ...");
return false;
}
}
$filename = $this->getID() . '-' . sensitiveIO::sanitizeURLString($title) . '.php';
//and save it
$this->_pageURL = $filename;
$this->writeToPersistence();
return $filename;
}
return false;
}
}