[xoops-cvslog 3392] CVS update: xoops2jp/html/kernel

Back to archive index

Minahito minah****@users*****
2006年 7月 1日 (土) 13:17:28 JST


Index: xoops2jp/html/kernel/block.php
diff -u xoops2jp/html/kernel/block.php:1.2.8.7 xoops2jp/html/kernel/block.php:1.2.8.8
--- xoops2jp/html/kernel/block.php:1.2.8.7	Sun Apr 16 11:35:38 2006
+++ xoops2jp/html/kernel/block.php	Sat Jul  1 13:17:28 2006
@@ -1,5 +1,5 @@
 <?php
-// $Id: block.php,v 1.2.8.7 2006/04/16 02:35:38 minahito Exp $
+// $Id: block.php,v 1.2.8.8 2006/07/01 04:17:28 minahito Exp $
 //  ------------------------------------------------------------------------ //
 //                XOOPS - PHP Content Management System                      //
 //                    Copyright (c) 2000 XOOPS.org                           //
@@ -104,6 +104,10 @@
     /**
      * return the content of the block for output
      *
+     * [ToDo]
+     * Why does this function return reference? Perhaps, it isn't needed even
+     * if it's at compatibility also.
+     *
      * @param string $format
      * @param string $c_type type of content<br>
      * Legal value for the type of content<br>
@@ -115,36 +119,41 @@
      **/
     function &getContent($format = 'S', $c_type = 'T')
     {
+		$ret = null;
+
         switch ( $format ) {
         case 'S':
+		
             // check the type of content
             // H : custom HTML block
             // P : custom PHP block
             // S : use text sanitizater (smilies enabled)
             // T : use text sanitizater (smilies disabled)
             if ( $c_type == 'H' ) {
-                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $this->getVar('content', 'N'));
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $this->getVar('content', 'N'));
             } elseif ( $c_type == 'P' ) {
                 ob_start();
                 echo eval($this->getVar('content', 'N'));
                 $content = ob_get_contents();
                 ob_end_clean();
-                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $content);
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $content);
             } elseif ( $c_type == 'S' ) {
                 $myts =& MyTextSanitizer::getInstance();
-                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 1, 1));
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 1, 1));
             } else {
                 $myts =& MyTextSanitizer::getInstance();
-                return str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 1, 0));
+                $ret = str_replace('{X_SITEURL}', XOOPS_URL.'/', $myts->displayTarea($this->getVar('content', 'N'), 1, 0));
             }
             break;
         case 'E':
-            return $this->getVar('content', 'E');
+            $ret = $this->getVar('content', 'E');
             break;
         default:
-            return $this->getVar('content', 'N');
+            $ret = $this->getVar('content', 'N');
             break;
         }
+		
+		return $ret;
     }
 
     function &buildBlock()


xoops-cvslog メーリングリストの案内
Back to archive index