Skip to content

Commit 880b828

Browse files
authored
Merge pull request #6 from fiammybe/fixes-php-7.3
Fixes for php 7.3
2 parents c0d74bd + 8fc3f30 commit 880b828

22 files changed

Lines changed: 3668 additions & 3679 deletions

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
# iForum - a discussion forum for ImpressCMS
2-
More documentation for the iForum module is available on https://iforummodule.github.io/iforum/
3-
4-
## Requirements
5-
- ImpressCMS 1.3+
6-
- PHP 5.6.x (not yet tested under PHP7)
1+
#iForum
72

3+
iForum is now being developed by David Janssens (fiammybe), this module has earlier been developed by Sina Asghari (stranger),
4+
Marko Schmuck (predator) and D.J. (phppp) under the name of newbb (CBB).

admin/admin_cat_manager.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@
2828

2929
$op = !empty($_GET['op'])? $_GET['op'] :
3030
(!empty($_POST['op'])?$_POST['op']:"");
31-
$cat_id = intval(!empty($_GET['cat_id'])? $_GET['cat_id'] : (!empty($_POST['cat_id'])?$_POST['cat_id']:0) );
31+
$cat_id = (int)(!empty($_GET['cat_id']) ? $_GET['cat_id'] : (!empty($_POST['cat_id']) ? $_POST['cat_id'] : 0));
3232

33-
$category_handler = icms_getmodulehandler('category', basename(dirname(dirname(__FILE__ ) ) ), 'iforum' );
33+
$category_handler = icms_getmodulehandler('category', basename(dirname(__DIR__) ), 'iforum' );
3434

3535
/**
3636
* newCategory()
@@ -50,7 +50,7 @@ function newCategory()
5050
*/
5151
function editCategory($cat_id = 0)
5252
{
53-
$category_handler =icms_getmodulehandler('category', basename(dirname(dirname(__FILE__ ) ) ), 'iforum' );
53+
$category_handler =icms_getmodulehandler('category', basename(dirname(__DIR__) ), 'iforum' );
5454
if ($cat_id > 0)
5555
{
5656
$fc = $category_handler->get($cat_id);
@@ -232,5 +232,4 @@ function editCategory($cat_id = 0)
232232
echo "</fieldset>";
233233
}
234234

235-
icms_cp_footer();
236-
?>
235+
icms_cp_footer();

admin/admin_digest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,3 @@
8989
break;
9090
}
9191
icms_cp_footer();
92-
93-
?>

admin/admin_forum_prune.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,4 @@
243243

244244
echo"</td></tr></table>";
245245
echo "</fieldset>";
246-
icms_cp_footer();
247-
248-
?>
246+
icms_cp_footer();

class/art/functions.php

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,37 @@
1-
<?php
2-
/**
3-
* common functions
4-
*
5-
* @copyright The XOOPS project http://www.xoops.org/
6-
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
7-
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
8-
* @since 1.00
9-
* @version $Id$
10-
* @package Frameworks::art
11-
*/
12-
13-
if (!defined("FRAMEWORKS_ART_FUNCTIONS")):
14-
define("FRAMEWORKS_ART_FUNCTIONS", true);
15-
16-
defined("FRAMEWORKS_ART_FUNCTIONS_INI") || include_once (dirname(__FILE__)."/functions.ini.php");
17-
load_functions("cache");
18-
load_functions("user");
19-
load_functions("admin");
20-
21-
22-
/**
23-
* get MySQL server version
24-
*
25-
* In some cases mysql_get_client_info is required instead
26-
*
27-
* @return string
28-
*/
29-
function mod_getMysqlVersion($conn = null)
30-
{
31-
/* static $mysql_version;
32-
if (isset($mysql_version)) return $mysql_version;
33-
if (!is_null($conn)) {
34-
$version = mysql_get_server_info($conn);
35-
} else {
36-
$version = mysql_get_server_info();
37-
}
38-
return $mysql_version;*/
39-
return 11;
40-
}
41-
1+
<?php
2+
/**
3+
* common functions
4+
*
5+
* @copyright The XOOPS project http://www.xoops.org/
6+
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
7+
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
8+
* @since 1.00
9+
* @version $Id$
10+
* @package Frameworks::art
11+
*/
12+
13+
if (!defined("FRAMEWORKS_ART_FUNCTIONS")):
14+
define("FRAMEWORKS_ART_FUNCTIONS", true);
15+
16+
defined("FRAMEWORKS_ART_FUNCTIONS_INI") || include_once (dirname(__FILE__)."/functions.ini.php");
17+
load_functions("cache");
18+
load_functions("user");
19+
load_functions("admin");
20+
21+
22+
/**
23+
* get MySQL server version
24+
*
25+
* In some cases mysql_get_client_info is required instead
26+
*
27+
* @return string
28+
*/
29+
function mod_getMysqlVersion($conn = null)
30+
{
31+
32+
static $mysql_version;
33+
34+
return "6.0.0";
35+
}
36+
4237
endif;

class/art/functions.sanitizer.php

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
1-
<?php
2-
/**
3-
* Text sanitizing handlers
4-
*
5-
* @copyright The XOOPS project http://www.xoops.org/
6-
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
7-
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
8-
* @since 1.00
9-
* @version $Id$
10-
* @package Frameworks::art
11-
*/
12-
if (!defined("FRAMEWORKS_ART_FUNCTIONS_SANITIZER")):
13-
define("FRAMEWORKS_ART_FUNCTIONS_SANITIZER", true);
14-
15-
/*
16-
* Filter out possible malicious text
17-
* kses project at SF could be a good solution to check
18-
*
19-
* @param string $text text to filter
20-
* @param bool $force flag indicating to force filtering
21-
* @return string filtered text
22-
*/
23-
function text_filter(&$text, $force = false)
24-
{
25-
global $icmsConfig;
26-
27-
if (empty($force) && icms::$user->isAdmin()) {
28-
return $text;
29-
}
30-
31-
if (@include_once dirname(dirname(__FILE__))."/PEAR/HTML/Safe.php") {
32-
$safehtml = new HTML_Safe();
33-
$text = $safehtml->parse($text);
34-
return $text;
35-
}
36-
37-
// For future applications
38-
$tags = empty($icmsConfig["filter_tags"]) ? array() : explode(",", $icmsConfig["filter_tags"]);
39-
$tags = array_map("trim", $tags);
40-
41-
// Set embedded tags
42-
$tags[] = "SCRIPT";
43-
$tags[] = "VBSCRIPT";
44-
$tags[] = "JAVASCRIPT";
45-
foreach ($tags as $tag) {
46-
$search[] = "/<".$tag."[^>]*?>.*?<\/".$tag.">/si";
47-
$replace[] = " [!".strtoupper($tag)." FILTERED!] ";
48-
}
49-
// Set meta refresh tag
50-
$search[]= "/<META[^>\/]*HTTP-EQUIV=(['\"])?REFRESH(\\1)[^>\/]*?\/>/si";
51-
$replace[]="";
52-
53-
// Sanitizing scripts in IMG tag
54-
//$search[]= "/(<IMG[\s]+[^>\/]*SOURCE=)(['\"])?(.*)(\\2)([^>\/]*?\/>)/si";
55-
//$replace[]="";
56-
57-
// Set iframe tag
58-
$search[]= "/<IFRAME[^>\/]*SRC=(['\"])?([^>\/]*)(\\1)[^>\/]*?\/>/si";
59-
$replace[]=" [!IFRAME FILTERED! \\2] ";
60-
$search[]= "/<IFRAME[^>]*?>([^<]*)<\/IFRAME>/si";
61-
$replace[]=" [!IFRAME FILTERED! \\1] ";
62-
// action
63-
$text = preg_replace($search, $replace, $text);
64-
return $text;
65-
}
66-
1+
<?php
2+
/**
3+
* Text sanitizing handlers
4+
*
5+
* @copyright The XOOPS project http://www.xoops.org/
6+
* @license http://www.fsf.org/copyleft/gpl.html GNU public license
7+
* @author Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
8+
* @since 1.00
9+
* @version $Id$
10+
* @package Frameworks::art
11+
*/
12+
if (!defined("FRAMEWORKS_ART_FUNCTIONS_SANITIZER")):
13+
define("FRAMEWORKS_ART_FUNCTIONS_SANITIZER", true);
14+
15+
/*
16+
* Filter out possible malicious text
17+
* kses project at SF could be a good solution to check
18+
*
19+
* @param string $text text to filter
20+
* @param bool $force flag indicating to force filtering
21+
* @return string filtered text
22+
*/
23+
function text_filter(&$text, $force = false)
24+
{
25+
global $icmsConfig;
26+
27+
if (empty($force) && icms::$user->isAdmin()) {
28+
return $text;
29+
}
30+
31+
if (@include_once dirname(dirname(__FILE__))."/PEAR/HTML/Safe.php") {
32+
$safehtml = new HTML_Safe();
33+
$text = $safehtml->parse($text);
34+
return $text;
35+
}
36+
37+
// For future applications
38+
$tags = empty($icmsConfig["filter_tags"]) ? array() : explode(",", $icmsConfig["filter_tags"]);
39+
$tags = array_map("trim", $tags);
40+
41+
// Set embedded tags
42+
$tags[] = "SCRIPT";
43+
$tags[] = "VBSCRIPT";
44+
$tags[] = "JAVASCRIPT";
45+
foreach ($tags as $tag) {
46+
$search[] = "/<".$tag."[^>]*?>.*?<\/".$tag.">/si";
47+
$replace[] = " [!".strtoupper($tag)." FILTERED!] ";
48+
}
49+
// Set meta refresh tag
50+
$search[]= "/<META[^>\/]*HTTP-EQUIV=(['\"])?REFRESH(\\1)[^>\/]*?\/>/si";
51+
$replace[]="";
52+
53+
// Sanitizing scripts in IMG tag
54+
//$search[]= "/(<IMG[\s]+[^>\/]*SOURCE=)(['\"])?(.*)(\\2)([^>\/]*?\/>)/si";
55+
//$replace[]="";
56+
57+
// Set iframe tag
58+
$search[]= "/<IFRAME[^>\/]*SRC=(['\"])?([^>\/]*)(\\1)[^>\/]*?\/>/si";
59+
$replace[]=" [!IFRAME FILTERED! \\2] ";
60+
$search[]= "/<IFRAME[^>]*?>([^<]*)<\/IFRAME>/si";
61+
$replace[]=" [!IFRAME FILTERED! \\1] ";
62+
// action
63+
$text = preg_replace($search, $replace, $text);
64+
return $text;
65+
}
66+
6767
endif;

0 commit comments

Comments
 (0)