فهرست منبع

Ticket #4751 - Timeline: Auto embeds returns Array.

AntonLV 2 سال پیش
والد
کامیت
73fdb9685a
1فایلهای تغییر یافته به همراه10 افزوده شده و 8 حذف شده
  1. 10 8
      template/scripts/BxBaseEmbedSystem.php

+ 10 - 8
template/scripts/BxBaseEmbedSystem.php

@@ -28,21 +28,23 @@ class BxBaseEmbedSystem extends BxDolEmbed
     public function getLinkHTML ($sLink, $sTitle = '', $sMaxWidth = '')
     {
         $aData = $this->getData($sLink, '');
-        
-        if (bx_get('mode') == 'alt')
-             return json_encode($aData);
-        
-        return $aData;
-        
+
+        if(bx_is_api()) {
+            if(bx_get('mode') == 'alt')
+                return json_encode($aData);
+
+            return $aData;
+        }
+
         $aAttrs = [
             'title' => bx_html_attribute($sTitle),
         ];
 
         // check for external link
-        if (strncmp(BX_DOL_URL_ROOT, $sLink, strlen(BX_DOL_URL_ROOT)) !== 0) {
+        if(strncmp(BX_DOL_URL_ROOT, $sLink, strlen(BX_DOL_URL_ROOT)) !== 0) {
             $aAttrs['target'] = '_blank';
 
-            if (getParam('sys_add_nofollow') == 'on')
+            if(getParam('sys_add_nofollow') == 'on')
                 $aAttrs['rel'] = 'nofollow';
         }