Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# iForum - a discussion forum for ImpressCMS
More documentation for the iForum module is available on https://iforummodule.github.io/iforum/

## Requirements
- ImpressCMS 1.3+
- PHP 5.6.x (not yet tested under PHP7)
#iForum

iForum is now being developed by David Janssens (fiammybe), this module has earlier been developed by Sina Asghari (stranger),
Marko Schmuck (predator) and D.J. (phppp) under the name of newbb (CBB).
9 changes: 4 additions & 5 deletions admin/admin_cat_manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@

$op = !empty($_GET['op'])? $_GET['op'] :
(!empty($_POST['op'])?$_POST['op']:"");
$cat_id = intval(!empty($_GET['cat_id'])? $_GET['cat_id'] : (!empty($_POST['cat_id'])?$_POST['cat_id']:0) );
$cat_id = (int)(!empty($_GET['cat_id']) ? $_GET['cat_id'] : (!empty($_POST['cat_id']) ? $_POST['cat_id'] : 0));

$category_handler = icms_getmodulehandler('category', basename(dirname(dirname(__FILE__ ) ) ), 'iforum' );
$category_handler = icms_getmodulehandler('category', basename(dirname(__DIR__) ), 'iforum' );

/**
* newCategory()
Expand All @@ -50,7 +50,7 @@ function newCategory()
*/
function editCategory($cat_id = 0)
{
$category_handler =icms_getmodulehandler('category', basename(dirname(dirname(__FILE__ ) ) ), 'iforum' );
$category_handler =icms_getmodulehandler('category', basename(dirname(__DIR__) ), 'iforum' );
if ($cat_id > 0)
{
$fc = $category_handler->get($cat_id);
Expand Down Expand Up @@ -232,5 +232,4 @@ function editCategory($cat_id = 0)
echo "</fieldset>";
}

icms_cp_footer();
?>
icms_cp_footer();
2 changes: 0 additions & 2 deletions admin/admin_digest.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,3 @@
break;
}
icms_cp_footer();

?>
4 changes: 1 addition & 3 deletions admin/admin_forum_prune.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,4 @@

echo"</td></tr></table>";
echo "</fieldset>";
icms_cp_footer();

?>
icms_cp_footer();
77 changes: 36 additions & 41 deletions class/art/functions.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,37 @@
<?php
/**
* common functions
*
* @copyright The XOOPS project http://www.xoops.org/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
* @since 1.00
* @version $Id$
* @package Frameworks::art
*/

if (!defined("FRAMEWORKS_ART_FUNCTIONS")):
define("FRAMEWORKS_ART_FUNCTIONS", true);

defined("FRAMEWORKS_ART_FUNCTIONS_INI") || include_once (dirname(__FILE__)."/functions.ini.php");
load_functions("cache");
load_functions("user");
load_functions("admin");


/**
* get MySQL server version
*
* In some cases mysql_get_client_info is required instead
*
* @return string
*/
function mod_getMysqlVersion($conn = null)
{
/* static $mysql_version;
if (isset($mysql_version)) return $mysql_version;
if (!is_null($conn)) {
$version = mysql_get_server_info($conn);
} else {
$version = mysql_get_server_info();
}
return $mysql_version;*/
return 11;
}

<?php
/**
* common functions
*
* @copyright The XOOPS project http://www.xoops.org/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
* @since 1.00
* @version $Id$
* @package Frameworks::art
*/

if (!defined("FRAMEWORKS_ART_FUNCTIONS")):
define("FRAMEWORKS_ART_FUNCTIONS", true);

defined("FRAMEWORKS_ART_FUNCTIONS_INI") || include_once (dirname(__FILE__)."/functions.ini.php");
load_functions("cache");
load_functions("user");
load_functions("admin");


/**
* get MySQL server version
*
* In some cases mysql_get_client_info is required instead
*
* @return string
*/
function mod_getMysqlVersion($conn = null)
{

static $mysql_version;

return "6.0.0";
}

endif;
132 changes: 66 additions & 66 deletions class/art/functions.sanitizer.php
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
<?php
/**
* Text sanitizing handlers
*
* @copyright The XOOPS project http://www.xoops.org/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
* @since 1.00
* @version $Id$
* @package Frameworks::art
*/
if (!defined("FRAMEWORKS_ART_FUNCTIONS_SANITIZER")):
define("FRAMEWORKS_ART_FUNCTIONS_SANITIZER", true);
/*
* Filter out possible malicious text
* kses project at SF could be a good solution to check
*
* @param string $text text to filter
* @param bool $force flag indicating to force filtering
* @return string filtered text
*/
function text_filter(&$text, $force = false)
{
global $icmsConfig;
if (empty($force) && icms::$user->isAdmin()) {
return $text;
}
if (@include_once dirname(dirname(__FILE__))."/PEAR/HTML/Safe.php") {
$safehtml = new HTML_Safe();
$text = $safehtml->parse($text);
return $text;
}
// For future applications
$tags = empty($icmsConfig["filter_tags"]) ? array() : explode(",", $icmsConfig["filter_tags"]);
$tags = array_map("trim", $tags);
// Set embedded tags
$tags[] = "SCRIPT";
$tags[] = "VBSCRIPT";
$tags[] = "JAVASCRIPT";
foreach ($tags as $tag) {
$search[] = "/<".$tag."[^>]*?>.*?<\/".$tag.">/si";
$replace[] = " [!".strtoupper($tag)." FILTERED!] ";
}
// Set meta refresh tag
$search[]= "/<META[^>\/]*HTTP-EQUIV=(['\"])?REFRESH(\\1)[^>\/]*?\/>/si";
$replace[]="";
// Sanitizing scripts in IMG tag
//$search[]= "/(<IMG[\s]+[^>\/]*SOURCE=)(['\"])?(.*)(\\2)([^>\/]*?\/>)/si";
//$replace[]="";
// Set iframe tag
$search[]= "/<IFRAME[^>\/]*SRC=(['\"])?([^>\/]*)(\\1)[^>\/]*?\/>/si";
$replace[]=" [!IFRAME FILTERED! \\2] ";
$search[]= "/<IFRAME[^>]*?>([^<]*)<\/IFRAME>/si";
$replace[]=" [!IFRAME FILTERED! \\1] ";
// action
$text = preg_replace($search, $replace, $text);
return $text;
}
<?php
/**
* Text sanitizing handlers
*
* @copyright The XOOPS project http://www.xoops.org/
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
* @since 1.00
* @version $Id$
* @package Frameworks::art
*/
if (!defined("FRAMEWORKS_ART_FUNCTIONS_SANITIZER")):
define("FRAMEWORKS_ART_FUNCTIONS_SANITIZER", true);

/*
* Filter out possible malicious text
* kses project at SF could be a good solution to check
*
* @param string $text text to filter
* @param bool $force flag indicating to force filtering
* @return string filtered text
*/
function text_filter(&$text, $force = false)
{
global $icmsConfig;

if (empty($force) && icms::$user->isAdmin()) {
return $text;
}

if (@include_once dirname(dirname(__FILE__))."/PEAR/HTML/Safe.php") {
$safehtml = new HTML_Safe();
$text = $safehtml->parse($text);
return $text;
}

// For future applications
$tags = empty($icmsConfig["filter_tags"]) ? array() : explode(",", $icmsConfig["filter_tags"]);
$tags = array_map("trim", $tags);

// Set embedded tags
$tags[] = "SCRIPT";
$tags[] = "VBSCRIPT";
$tags[] = "JAVASCRIPT";
foreach ($tags as $tag) {
$search[] = "/<".$tag."[^>]*?>.*?<\/".$tag.">/si";
$replace[] = " [!".strtoupper($tag)." FILTERED!] ";
}
// Set meta refresh tag
$search[]= "/<META[^>\/]*HTTP-EQUIV=(['\"])?REFRESH(\\1)[^>\/]*?\/>/si";
$replace[]="";

// Sanitizing scripts in IMG tag
//$search[]= "/(<IMG[\s]+[^>\/]*SOURCE=)(['\"])?(.*)(\\2)([^>\/]*?\/>)/si";
//$replace[]="";

// Set iframe tag
$search[]= "/<IFRAME[^>\/]*SRC=(['\"])?([^>\/]*)(\\1)[^>\/]*?\/>/si";
$replace[]=" [!IFRAME FILTERED! \\2] ";
$search[]= "/<IFRAME[^>]*?>([^<]*)<\/IFRAME>/si";
$replace[]=" [!IFRAME FILTERED! \\1] ";
// action
$text = preg_replace($search, $replace, $text);
return $text;
}

endif;
Loading