Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 757
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/script-loader.php on line 758
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/load.php on line 926
Notice: Trying to access array offset on value of type bool in /var/www/html/ticnews.com.br/web/wp-includes/theme.php on line 2360
Notice: Trying to access array offset on value of type bool in /var/www/html/ticnews.com.br/web/wp-content/plugins/download-monitor/src/DLM.php on line 236
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
Deprecated: Function get_magic_quotes_gpc() is deprecated in /var/www/html/ticnews.com.br/web/wp-includes/formatting.php on line 4768
encoded_uri( $url ) {
$particles = preg_split(
'|(%[a-f0-9]{2})|',
$url,
-1,
PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY
);
$state = false;
$output = '';
foreach ( $particles as $particle ) {
if ( '%' === $particle ) {
$state = true;
} else {
if ( ! $state && '%' === $particle{0} ) {
$particle = strtoupper( $particle );
}
$state = false;
}
$output .= $particle;
}
return $output;
}
/**
* Register rewrite rule to enable work with pretty URIs
*/
public function register_rewrite( $rewrite_to ) {
if (
! $this->_calendar_base &&
! $this->_query_manager->rewrite_enabled()
) {
return $this;
}
$base = basename( $this->_calendar_base );
if ( false !== strpos( $base, '?' ) ) {
return $this;
}
$base = $this->_fix_encoded_uri( $base );
$base = '(?:.+/)?' . $base;
$named_args = str_replace(
'[:DS:]',
preg_quote( Ai1ec_Uri::DIRECTION_SEPARATOR ),
'[a-z][a-z0-9\-_[:DS:]\/]*[:DS:][a-z0-9\-_[:DS:]\/]'
);
$regexp = $base . '(\/' . $named_args . ')';
$clean_base = trim( $this->_calendar_base, '/' );
$clean_site = trim( $this->get_site_url(), '/' );
if ( 0 === strcmp( $clean_base, $clean_site ) ) {
$regexp = '(' . $named_args . ')';
$rewrite_to = remove_query_arg( 'pagename', $rewrite_to );
}
$this->_query_manager->register_rule(
$regexp,
$rewrite_to
);
$this->_rewrite = array(
'mask' => $regexp,
'target' => $rewrite_to,
);
add_filter(
'rewrite_rules_array',
array( $this, 'rewrite_rules_array' )
);
return $this;
}
/**
* Initiate internal variables
*/
public function __construct( Ai1ec_Registry_Object $registry ) {
parent::__construct( $registry );
$this->_query_manager = $registry->get( 'query.helper' );
}
/**
* Checks if calendar rewrite rule is registered.
*
* @param array $rules Rewrite rules.
*
* @return array Rewrite rules.
*/
public function rewrite_rules_array( $rules ) {
if ( null !== $this->_rewrite ) {
$newrules[$this->_rewrite['mask']] = $this->_rewrite['target'];
$rules = array_merge( $newrules, $rules );
}
return $rules;
}
}