Перестал работать RelatedItemsPro после обновления. Ошибку вызывает элемент цены.
- Warning: preg_replace(): Compilation failed: missing ) at offset 310 in ****/docs/plugins/system/zlframework/zlframework/helpers/zlfw.php on line 779
- public function replaceShortCodes($string, $args=array())
- {
- // expression to search for
- $regex = '/{\S*}/';
- $matches = array();
- // find all instances of plugin and put in $matches
- preg_match_all($regex, $string, $matches, PREG_SET_ORDER);
- foreach($matches as $match)
- {
- $string = preg_replace("|$match[0]|", $this->shortCode($match[0], $args), $string, 1);
- }
- return $string;
- }
- /*
- Function: shortCode
- Variables:
- $shortcode - ex {PHP_MAX_UPLOAD} the length of the output string
- Return :
- string
- */
- public function shortCode($shortcode, $args=array())
- {
- // extract the arguments
- extract($args, EXTR_OVERWRITE);
- switch ($shortcode) {
- case '{PHP-MAX_UPLOAD}':
- return $this->app->zlfw->filesystem->getUploadValue();
- break;
- case '{ITEM-URL}':
- return isset($item) ? $this->app->route->item($item) : '';
- break;
- case '{ITEM-NAME}':
- return isset($item) ? $item->name : '';
- break;
- case '{ITEM-ALIAS}':
- return isset($item) ? $item->alias : '';
- break;
- default:
- return $shortcode;
- break;
- }
- }