Fix merge print placeholders for only links to a certain app

This commit is contained in:
Nathan Gray 2016-04-26 17:07:42 +00:00
parent 260efdaa5f
commit 7bb134b273

View File

@ -376,7 +376,7 @@ abstract class Merge
protected function get_all_links($app, $id, $prefix, &$content)
{
$array = array();
$pattern = '@\$(link|links|attachments|links_attachments)\/?(title|href|link)?\/?([a-z]*)\$@';
$pattern = '@\$(links_attachments|links|attachments|link)\/?(title|href|link)?\/?([a-z]*)\$@';
static $link_cache=null;
$matches = null;
if(preg_match_all($pattern, $content, $matches))
@ -418,7 +418,8 @@ abstract class Merge
$array[($prefix?$prefix.'/':'').$placeholder] = Api\Html::a_href(Api\Html::htmlspecialchars($title), $link);
break;
case 'links':
$array[($prefix?$prefix.'/':'').$placeholder] = $this->get_links($app, $id, '!'.Api\Link::VFS_APPNAME, array(),$matches[2][$i]);
$link_app = $matches[3][$i] ? $matches[3][$i] : '!'.Api\Link::VFS_APPNAME;
$array[($prefix?$prefix.'/':'').$placeholder] = $this->get_links($app, $id, $link_app, array(),$matches[2][$i]);
break;
case 'attachments':
$array[($prefix?$prefix.'/':'').$placeholder] = $this->get_links($app, $id, Api\Link::VFS_APPNAME,array(),$matches[2][$i]);