3 if (!defined(
'OXTAGCLOUD_MINTAGLENGTH')) {
4 define(
'OXTAGCLOUD_MINTAGLENGTH', 4);
24 'admin',
'application',
'core',
'export',
'modules',
'out',
'setup',
'tmp'
55 protected $_aMetaChars = array(
'+',
'-',
'>',
'<',
'(',
')',
'~',
'*',
'"',
'\'',
'\\',
'[',
']',
'{',
'}',
';',
':',
'.',
'/',
'|',
'!',
'@',
'#',
'$',
'%',
'^',
'&',
'?',
'=',
'`');
65 if ( $sTag !== null ) {
79 $this->_iTagMaxLength = $iTagMaxLength;
100 public function set( $sTag, $blPrepare = true )
102 $this->_sTag = $blPrepare? $this->
prepare( $sTag ) : $sTag;
111 public function get()
125 $this->_iHitCount = $iHitCount;
155 $blValid = strlen($this->_sTag) > 0?
true :
false;
156 if ( $blValid && in_array( $this->_sTag, $this->_aForbiddenTags ) ) {
169 if ( is_null($this->_sTagLink) ) {
170 $this->_sTagLink = $this->
formLink( $this->
get() );
184 $this->_sTagLink = $sTagLink;
194 return getStr()->htmlentities( $this->
get() );
219 $iLen = $oStr->strlen( $sTag );
221 $sTag = trim( $oStr->substr( $sTag, 0, $this->getMaxLength() ) );
223 return $oStr->strtolower( $sTag );
238 $sText = str_replace($this->_aMetaChars,
' ', $sText);
241 $sText = $oStr->preg_replace(
"/\s+/",
" ", trim( $sText ) );
261 $sUrl = $oSeoEncoderTag->getTagUrl( $sTag, $iLang );
263 return $sUrl ? $sUrl : $this->
getConfig()->getShopUrl() . $oSeoEncoderTag->getStdTagUri( $sTag ) .
"&lang=" . $iLang;
274 $aTagParts = explode(
' ', $this->
get() );
275 foreach ($aTagParts as &$sTagPart) {
276 if ( $oStr->strlen( $sTagPart ) < OXTAGCLOUD_MINTAGLENGTH ) {
277 $sTagPart .= str_repeat(
"_", OXTAGCLOUD_MINTAGLENGTH - $oStr->strlen( $sTagPart ) );
281 $this->
set( implode(
' ', $aTagParts ), false );
294 if ( $oStr->preg_match_all(
"/([\s\-]?)([^\s\-]+)([\s\-]?)/", $this->get(), $aMatches ) ) {
295 foreach ( $aMatches[2] as $iKey => $sMatch ) {
296 if ( $oStr->strlen( $sMatch ) <= OXTAGCLOUD_MINTAGLENGTH ) {
297 $sMatch = rtrim( $sMatch,
"_" );
299 $sRes .= $aMatches[1][$iKey] . $sMatch . $aMatches[3][$iKey];
302 $this->
set( $sRes, false );