[geeklog-cvs] Geeklog-1.x/public_html lib-common.php,1.676,1.677

Michael Jervis mjervis at qs1489.pair.com
Mon Feb 18 14:42:15 EST 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html
In directory qs1489.pair.com:/tmp/cvs-serv21576/public_html

Modified Files:
	lib-common.php 
Log Message:
Support for [raw][/raw] in HTML stories for painless HTML managing.

Index: lib-common.php
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/lib-common.php,v
retrieving revision 1.676
retrieving revision 1.677
diff -C2 -d -r1.676 -r1.677
*** lib-common.php	15 Feb 2008 19:10:28 -0000	1.676
--- lib-common.php	18 Feb 2008 19:42:12 -0000	1.677
***************
*** 2944,2948 ****
      }
      while( $start_pos !== false );
! 
  
      if( isset( $_CONF['skip_html_filter_for_root'] ) &&
--- 2944,2980 ----
      }
      while( $start_pos !== false );
!     
!     // handle [raw] ... [/raw]
!     do
!     {
!         $start_pos = MBYTE_strpos( MBYTE_strtolower( $str ), '[raw]' );
!         if( $start_pos !== false )
!         {
!             $end_pos = MBYTE_strpos( MBYTE_strtolower( $str ), '[/raw]' );
!             if( $end_pos !== false )
!             {
!                 $encoded = COM_handleCode( MBYTE_substr( $str, $start_pos + 6,
!                         $end_pos - ( $start_pos + 6 )));
!                 // [raw2] to avoid infinite loop. Not HTML comment as we strip
!                 // them later.
!                 $encoded = '[raw2]' . $encoded . '[/raw2]';
!                 $str = MBYTE_substr( $str, 0, $start_pos ) . $encoded
!                      . MBYTE_substr( $str, $end_pos + 7 );
!             }
!             else // missing [/raw]
!             {
!                 // Treat the rest of the text as raw (so as not to lose any
!                 // special characters). However, the calling entity should
!                 // better be checking for missing [/raw] before calling this
!                 // function ...
!                 $encoded = COM_handleCode( MBYTE_substr( $str, $start_pos + 6 ));
!                 // [raw2] to avoid infinite loop. Not HTML comment as we strip
!                 // them later.
!                 $encoded = '[raw2]' . $encoded . '[/raw2]';
!                 $str = MBYTE_substr( $str, 0, $start_pos ) . $encoded;
!             }
!         }
!     }
!     while( $start_pos !== false );
  
      if( isset( $_CONF['skip_html_filter_for_root'] ) &&
***************
*** 2981,2985 ****
          $filter->AddHTML( $tag, $attr );
      }
!     return $filter->Parse( $str );
  }
  
--- 3013,3023 ----
          $filter->AddHTML( $tag, $attr );
      }
!     /* Replace [raw][/raw] with <!--raw--><!--/raw-->, note done "late" because
!      * of the above noted // strip_tags() gets confused by HTML comments ...
!      */
!     $str = $filter->Parse( $str );
!     $str = str_replace('[raw2]','<!--raw--><span class="raw">', $str);
!     $str = str_replace('[/raw2]','</span><!--/raw-->', $str);
!     return $str;
  }
  
***************
*** 3689,3693 ****
          $content = COM_makeList($articles, 'list-feed');
          $content = preg_replace("/(\015\012)|(\015)|(\012)/", '', $content);
!        
          if (strlen($content) > 65000) {
              $content = $LANG21[68];
--- 3727,3731 ----
          $content = COM_makeList($articles, 'list-feed');
          $content = preg_replace("/(\015\012)|(\015)|(\012)/", '', $content);
! 
          if (strlen($content) > 65000) {
              $content = $LANG21[68];




More information about the geeklog-cvs mailing list