當前位置: 首頁>>代碼示例>>PHP>>正文


PHP IPSText::stripUrls方法代碼示例

本文整理匯總了PHP中IPSText::stripUrls方法的典型用法代碼示例。如果您正苦於以下問題:PHP IPSText::stripUrls方法的具體用法?PHP IPSText::stripUrls怎麽用?PHP IPSText::stripUrls使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在IPSText的用法示例。


在下文中一共展示了IPSText::stripUrls方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _makeNameSafe

 /**
  * Make the name used for the quote safe for regex parsing
  *
  * @access	protected
  * @param	array 		preg_replace_callback Matches
  * @return	string		Output
  * @note	This looks complicated (and is somewhat) but it's done this way to try to quote correctly users with ' in their names
  * @link 	http://community.invisionpower.com/tracker/issue-18588-bbcode-mistake-when-quoting-users-with-a-in-their-name
  */
 protected function _makeNameSafe($matches)
 {
     $quote = $matches[1];
     $name = $matches[2];
     $next = '';
     if (strpos($name, 'post=') !== false) {
         $next = substr($name, strpos($name, 'post='));
         $name = substr($name, 0, strpos($name, 'post=') - 1);
     }
     if (strpos($name, 'date=') !== false) {
         $next = $next . ' ' . substr($name, strpos($name, 'date='));
         $name = substr($name, 0, strpos($name, 'date=') - 1);
     }
     if (strpos($name, 'timestamp=') !== false) {
         $next = $next . ' ' . substr($name, strpos($name, 'timestamp='));
         $name = substr($name, 0, strpos($name, 'timestamp=') - 1);
     }
     $name = substr($name, 0, -strlen($quote));
     # Squeeze past the parser...
     $name = str_replace(array(''', "'"), "'", $name);
     $_last = $next ? ' ' . $next : '';
     return 'name=' . $quote . IPSText::getTextClass('bbcode')->xssHtmlClean($this->_parent->stripAllTags(IPSText::stripUrls($name))) . $quote . $_last . ']';
 }
開發者ID:mover5,項目名稱:imobackup,代碼行數:32,代碼來源:defaults.php


注:本文中的IPSText::stripUrls方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。