[geeklog-cvs] geeklog-1.3/public_html/staticpages index.php,1.14,1.15

dhaun at geeklog.net dhaun at geeklog.net
Wed Jan 14 13:05:44 EST 2004


Update of /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages
In directory geeklog_prod:/tmp/cvs-serv29176/public_html/staticpages

Modified Files:
	index.php 
Log Message:
You can now disable PHP in static pages entirely by setting $_SP_CONF['allow_php'] = 0;


Index: index.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages/index.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** index.php	2 Jan 2004 22:10:03 -0000	1.14
--- index.php	14 Jan 2004 18:05:42 -0000	1.15
***************
*** 3,7 ****
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Static Page Geeklog Plugin 1.3                                            |
  // +---------------------------------------------------------------------------+
  // | index.php                                                                 |
--- 3,7 ----
  /* Reminder: always indent with 4 spaces (no tabs). */
  // +---------------------------------------------------------------------------+
! // | Static Page Geeklog Plugin 1.4                                            |
  // +---------------------------------------------------------------------------+
  // | index.php                                                                 |
***************
*** 9,13 ****
  // | This is the main page for the Geeklog Static Page Plugin                  |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2003 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony at tonybibbs.com                            |
--- 9,13 ----
  // | This is the main page for the Geeklog Static Page Plugin                  |
  // +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2004 by the following authors:                         |
  // |                                                                           |
  // | Authors: Tony Bibbs       - tony at tonybibbs.com                            |
***************
*** 45,63 ****
  
  COM_setArgNames (array ('page'));
! $page = COM_getArgument ('page');
  
  if (empty ($page)) {
      $error = 1;
! }
  
! $perms = SP_getPerms ();
! if (!empty ($perms)) {
!     $perms = ' AND ' . $perms;
! }
! $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']} WHERE (sp_id = '$page')" . $perms);
! $count = DB_numRows ($result);
  
! if ($count == 0 || $count > 1) {
!     $error = 1;
  }
  
--- 45,64 ----
  
  COM_setArgNames (array ('page'));
! $page = COM_applyFilter (COM_getArgument ('page'));
  
  if (empty ($page)) {
      $error = 1;
! } else {
  
!     $perms = SP_getPerms ();
!     if (!empty ($perms)) {
!         $perms = ' AND ' . $perms;
!     }
!     $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']} WHERE (sp_id = '$page')" . $perms);
!     $count = DB_numRows ($result);
  
!     if ($count == 0 || $count > 1) {
!         $error = 1;
!     }
  }
  
***************
*** 75,86 ****
          $retval .= COM_startBlock (stripslashes ($A['sp_title']));
      }
!     // Check for type (ie html or php)
!     if ($A['sp_php'] == 1) {
!         $retval .= eval (stripslashes ($A['sp_content']));
!     } else if ($A['sp_php'] == 2) {
!         ob_start ();
!         eval (stripslashes ($A['sp_content']));
!         $retval .= ob_get_contents ();
!         ob_end_clean ();
      } else {
          $retval .= stripslashes ($A['sp_content']);
--- 76,91 ----
          $retval .= COM_startBlock (stripslashes ($A['sp_title']));
      }
!     if ($_SP_CONF['allow_php'] == 1) {
!         // Check for type (ie html or php)
!         if ($A['sp_php'] == 1) {
!             $retval .= eval (stripslashes ($A['sp_content']));
!         } else if ($A['sp_php'] == 2) {
!             ob_start ();
!             eval (stripslashes ($A['sp_content']));
!             $retval .= ob_get_contents ();
!             ob_end_clean ();
!         } else {
!             $retval .= stripslashes ($A['sp_content']);
!         }
      } else {
          $retval .= stripslashes ($A['sp_content']);
***************
*** 115,119 ****
      DB_query ("UPDATE {$_TABLES['staticpage']} SET sp_hits = sp_hits + 1 WHERE sp_id = '$page'"); 
  } else {
!     $failflg = DB_getItem ($_TABLES['staticpage'], 'sp_nf', "sp_id='$page'");
      if ($failflg) {
          $retval = COM_siteHeader ('menu');
--- 120,128 ----
      DB_query ("UPDATE {$_TABLES['staticpage']} SET sp_hits = sp_hits + 1 WHERE sp_id = '$page'"); 
  } else {
!     if (empty ($page)) {
!         $failflg = 0;
!     } else {
!         $failflg = DB_getItem ($_TABLES['staticpage'], 'sp_nf', "sp_id='$page'");
!     }
      if ($failflg) {
          $retval = COM_siteHeader ('menu');





More information about the geeklog-cvs mailing list