Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
9e046d2
Merge pull request #1 from sefrengo-cms/master
Gesundheitsminister Nov 17, 2017
7449464
* fixed wrong mysqli in rewrite
Gesundheitsminister Nov 17, 2017
2d88c3b
* switched frontend session back to cookie
Gesundheitsminister Nov 22, 2017
d3ed75d
* fixed wrong mysqli links
Gesundheitsminister Nov 30, 2017
a9453c5
* fixed wrong mysqli links
Gesundheitsminister Nov 30, 2017
7b25070
* php7 adaptions
Gesundheitsminister Dec 8, 2017
3cfedcb
* switched backend session to cookie because of problems with diverse…
Gesundheitsminister Dec 15, 2017
aae6c4e
* fixed mod_test function for php7
Gesundheitsminister Jan 5, 2018
c02cc5b
* fixed escaping bug in session
Gesundheitsminister Jan 7, 2018
fb234e6
* added CMSPHP:CACHE to mod_test
Gesundheitsminister Jan 7, 2018
d10d2d3
* base64 encode modules in session to prevent problems with complex q…
Gesundheitsminister Jan 7, 2018
7a15504
* test module code in anonymous function. Prevents function already e…
Gesundheitsminister Jan 7, 2018
8c6bf85
* changed modul config fron text to medium text because text is to small
Gesundheitsminister Feb 8, 2018
088a23e
* changed modul config fron text to medium text because text is to small
Gesundheitsminister Feb 8, 2018
ecec267
* BUGFIX: No SQL Encoding of metasocial fields ins insert statements
Gesundheitsminister Apr 2, 2018
0437154
* BUGFIX: No SQL Encoding of metasocial fields ins insert statements
Gesundheitsminister Apr 2, 2018
1678095
* CHANGE: Disabled function mod_test in class.repository.php because …
Gesundheitsminister Apr 18, 2018
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
26 changes: 13 additions & 13 deletions backend/API/GUI/class.SF_GUI_ContentStylerPlain.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function _getDynamicValString($type_config)
* @Return String Content
* @Access public
*/
function getText($mod_content, $type_config = "") {
function getText($mod_content, $type_config = []) {
return $mod_content;
}

Expand All @@ -162,7 +162,7 @@ function getText($mod_content, $type_config = "") {
* @Return String Content
* @Access public
*/
function getTextarea($mod_content, $type_config = "") {
function getTextarea($mod_content, $type_config = []) {
return $mod_content;
}

Expand All @@ -178,7 +178,7 @@ function getTextarea($mod_content, $type_config = "") {
* @Return String Content
* @Access public
*/
function getWysiwyg2($mod_content, $type_config = "")
function getWysiwyg2($mod_content, $type_config = [])
{
return $mod_content;
}
Expand All @@ -195,7 +195,7 @@ function getWysiwyg2($mod_content, $type_config = "")
* @Return String Content
* @Access public
*/
function getWysiwyg($mod_content, $type_config = "")
function getWysiwyg($mod_content, $type_config = [])
{
return $mod_content;
}
Expand All @@ -212,7 +212,7 @@ function getWysiwyg($mod_content, $type_config = "")
* @Return String Content
* @Access public
*/
function getImage($mod_content, $mod_descr, $type_config = "") {
function getImage($mod_content, $mod_descr, $type_config = []) {
return $mod_content;
}

Expand All @@ -228,7 +228,7 @@ function getImage($mod_content, $mod_descr, $type_config = "") {
* @Return String Content
* @Access public
*/
function getLink($link_url, $link_desc, $link_target, $type_config = "")
function getLink($link_url, $link_desc, $link_target, $type_config = [])
{
return $mod_content;
}
Expand All @@ -245,7 +245,7 @@ function getLink($link_url, $link_desc, $link_target, $type_config = "")
* @Return String Content
* @Access public
*/
function getFile($file_id, $file_desc, $file_target, $type_config = "")
function getFile($file_id, $file_desc, $file_target, $type_config = [])
{
return $mod_content;
}
Expand All @@ -262,7 +262,7 @@ function getFile($file_id, $file_desc, $file_target, $type_config = "")
* @Return String Content
* @Access public
*/
function getSourcecode($mod_content, $type_config = "")
function getSourcecode($mod_content, $type_config = [])
{
return $mod_content;
}
Expand All @@ -279,7 +279,7 @@ function getSourcecode($mod_content, $type_config = "")
* @Return String Content
* @Access public
*/
function getSelect($mod_content, $type_config = "") {
function getSelect($mod_content, $type_config = []) {
return $mod_content;
}

Expand All @@ -295,7 +295,7 @@ function getSelect($mod_content, $type_config = "") {
* @Return String Content
* @Access public
*/
function getHidden($mod_content, $type_config = "")
function getHidden($mod_content, $type_config = [])
{
return $mod_content;
}
Expand All @@ -312,7 +312,7 @@ function getHidden($mod_content, $type_config = "")
* @Return String Content
* @Access public
*/
function getCheckbox($mod_content, $type_config = "") {
function getCheckbox($mod_content, $type_config = []) {
return $mod_content;
}

Expand All @@ -328,7 +328,7 @@ function getCheckbox($mod_content, $type_config = "") {
* @Return String Content
* @Access public
*/
function getRadio($mod_content, $type_config = "") {
function getRadio($mod_content, $type_config = []) {
return $mod_content;
}

Expand All @@ -344,7 +344,7 @@ function getRadio($mod_content, $type_config = "") {
* @Return String Content
* @Access public
*/
function getDate($mod_content, $type_config = "") {
function getDate($mod_content, $type_config = []) {
return $mod_content;
}

Expand Down
2 changes: 1 addition & 1 deletion backend/API/PAGE/class.SF_PAGE_Cat.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ function _copyTemplateConfig($idcat_from, $idcat_to) {

//echo $sql2 .'<br />';
$db2->query($sql2);
$current_idtplconf = mysqli_insert_id($this->db->Link_ID);
$current_idtplconf = mysqli_insert_id($db2->Link_ID);

$sql2 = "UPDATE
".$cms_db['cat_lang']."
Expand Down
2 changes: 1 addition & 1 deletion backend/external/pear.php.net/Mail/RFC822.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function _hasUnclosedBracketsSub($string, &$num, $char)
* Function to begin checking the address.
*
* @access private
* @param string $address The address to validate.
* @param array $address The address to validate.
* @return mixed False on failure, or a structured array of address information on success.
*/
function _validateAddress($address)
Expand Down
2 changes: 1 addition & 1 deletion backend/external/pear.php.net/Pager/Sliding.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function getPageRangeByPageId($pageid = null)
* @return array back/pages/next/first/last/all links
* @access public
*/
function getLinks($pageID = null)
function getLinks($pageID=null, $next_html='')
{
if ($pageID != null) {
$_sav = $this->_currentPage;
Expand Down
8 changes: 4 additions & 4 deletions backend/external/phplib/local.php
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ class cms_Backend_Session extends Session
var $cookiename = 'sefrengo'; // Name des Cookies
var $name = 'cms';
var $magic = 'backend_Session'; // beliebiger Name zur Verschl?sselung
var $mode = 'get'; // default Modus der Session-ID
var $fallback_mode = 'cookie'; // falls default Modus abgelehnt wird
var $mode = 'cookie'; // default Modus der Session-ID
var $fallback_mode = 'get'; // falls default Modus abgelehnt wird
var $lifetime = '0'; // 0 = do session cookies, else minutes
var $refresh = '0'; // 0 = no refresh, else minutes
var $that_class = 'cms_CT_Sql'; // name of data storage container
Expand All @@ -594,8 +594,8 @@ class cms_Frontend_Session extends Session
var $cookiename = 'sid'; // Name des Cookies
var $name = 'sid';
var $magic = 'frontend_Session'; // beliebiger Name zur Verschl?sselung
var $mode = 'get'; // default Modus der Session-ID
var $fallback_mode = 'cookie'; // falls default Modus abgelehnt wird
var $mode = 'cookie'; // default Modus der Session-ID
var $fallback_mode = ''; // falls default Modus abgelehnt wird
var $lifetime = '0'; // 0 = do session cookies, else minutes
var $refresh = '0'; // 0 = no refresh, else minutes
var $that_class = 'cms_CT_Sql'; // name of data storage container
Expand Down
4 changes: 2 additions & 2 deletions backend/external/phplib/session.inc
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ class Session {
$str .= "\$$var = array(); ";
while ( "array" == $l ) {
// Structural recursion
$this->serialize( $var . "['" . preg_replace( "#([\\'])#", "\\\\1", $k ) . "']", $str );
$this->serialize( $var . "['" . preg_replace( "#([\\'])#", "\\\\$1", $k ) . "']", $str );
eval( "\$l = gettype(list(\$k)=each(\$$var));" );
}

Expand All @@ -348,7 +348,7 @@ class Session {
default:
// $$var is an atom. Extract it to $l, then generate code.
eval( "\$l = \$$var;" );
$str .= "\$$var = '" . preg_replace( "#([\\'])#", "\\\\1", $l ) . "'; ";
$str .= "\$$var = '" . preg_replace( "#([\\'])#", "\\\\$1", $l ) . "'; ";
break;
}
}
Expand Down
8 changes: 4 additions & 4 deletions backend/inc/class.fileaccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function get_directory_name($iddirectory) {
// -> else: only $directory is used as ID
//
function get_directory($directory, $idclient = '', $type = 1 ) {
if (empty($directory)) return ''; // missing directory information
if (empty($directory)) return []; // missing directory information
if ($this->use_cache && $this->tmp_directorydata[$directory]) return $this->tmp_directorydata[$directory];
// set variables
$tmp_dir = array( 'dirname', 'iddirectory', 'str', 'num');
Expand All @@ -254,7 +254,7 @@ function get_directory($directory, $idclient = '', $type = 1 ) {
// save data in cache
$tmp = $this->db->select_record($table, $parameter, $type);
if ($this->use_cache && $tmp) $this->tmp_directorydata[(int)$tmp['iddirectory']] = $tmp;
return ((!empty($tmp)) ? $tmp: '');
return ((!empty($tmp)) ? $tmp: []);
}

//
Expand Down Expand Up @@ -356,7 +356,7 @@ function get_parent_directories($iddirectory, $idclient) {
// -> else: only $file is used as ID
//
function get_file($file, $idclient = '', $iddirectory = '', $type = 1) {
if (empty($file)) return ''; // missing fileid
if (empty($file)) return array(); // missing fileid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use array() instead of [] in this file (2 times)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to be compatible to php < 5.4. I dont know if this still makes sense.

if ($this->use_cache && $this->tmp_filedata[$file]) return $this->tmp_filedata[$file];
// get data for a single file
$tmp_file = array( 'filename', 'idupl', 'str', 'num');
Expand Down Expand Up @@ -386,7 +386,7 @@ function get_file($file, $idclient = '', $iddirectory = '', $type = 1) {
// save data in cache
$tmp = $this->db->select_record($table, $parameter, $type);
if ($this->use_cache && $tmp) $this->tmp_filedata[$tmp['idupl']] = $tmp;
return ((!empty($tmp)) ? $tmp: '');
return ((!empty($tmp)) ? $tmp: array());
}

//
Expand Down
4 changes: 2 additions & 2 deletions backend/inc/class.filemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ function scan_directory( $iddirectory, $nosubdirscan ) {
$newdirs2scan = array();
$this->edit_dirs = array();
$content_found = false;
$currentdir = '';
$currentdir = [];
$scandir = '';

// get scan directory
Expand Down Expand Up @@ -1109,7 +1109,7 @@ function scan_files( $iddirectory, $updatethumbs = 0 ) {
// scan files in directory
$found_files_id = array();
$this->edit_files = array();
$currentdir = '';
$currentdir = [];
$scandir = '';

// get scan dir
Expand Down
57 changes: 25 additions & 32 deletions backend/inc/class.repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,9 @@ function run_php($code) {
*
*/
function mod_test ($code, $id) {
// js@left4web.de - disabled mod_test because it produces more trouble than it helps
return false;

global $db, $auth, $cms_db, $cfg_cms, $rep, $mod, $perm, $client, $lang, $con_tree, $con_side;
static $_id;
$_strict = explode(',',($_dis = @ini_get('disable_functions')));
Expand All @@ -918,53 +921,43 @@ function mod_test ($code, $id) {
$idcatside = 1;
// include the Mipforms
include_once('inc/fnc.mipforms.php');
$mod_test_var = 0;

// spezial for 'Druckmodul'
$list['id'][] = 1;
// add constant __cmsMODTEST
$code .= '<?php define(\'__cmsMODTEST\', true); ?>';
// replaces
$code = str_replace('<CMSPHP>', '', $code);
$code = str_replace('</CMSPHP>', '', $code);
$code = str_replace('<CMSPHP>', '<?php', $code);
$code = str_replace('</CMSPHP>', '?>', $code);
$code = str_replace('<CMSPHP:CACHE>', '<?php', $code);
$code = str_replace('</CMSPHP:CACHE>', '?>', $code);
//todo: 2remove
$code = str_replace('<DEDIPHP>', '', $code);
$code = str_replace('</DEDIPHP>', '', $code);
$code = str_replace('<DEDIPHP>', '<?php', $code);
$code = str_replace('</DEDIPHP>', '?>', $code);
// replaces
$code = str_replace('MOD_VALUE', '$MOD_VALUE', $code);
$code = str_replace('MOD_VAR', '$MOD_VAR', $code);
$code = preg_replace ('/(<(cms|dedi):[\/\!]*?[^<>]*?>)/si', '""', $code);
// Init the Box
$code = "function mod_test_" . $id . " () {" . $code;
$code .= "\n}\n";
$code .= '$mod_test_var = $id;';
// Ini Set
@ini_set("error_prepend_string", "<mod_test_error>");
@ini_set("error_append_string", "</mod_test_error>");
// Debug Me! print_r($code);
$code = "\$_testFunction = function () { ?>" . $code . "\n<?php\n};\n";

// Run the code in a Box
ob_start();
eval(' ?>' . $code);
$output = ob_get_contents();
// Later Parse! call_user_func("function mod_test_" . $id,'');
ob_end_clean();
// Ini Restore
@ini_restore("error_prepend_string");
@ini_restore("error_append_string");
// Strip <mod_test_error>
$start = strpos($output, "<mod_test_error>");
$end = strpos($output, "</mod_test_error>");
if ($start !== false) {
$start = strpos($output, "eval()");
$error = substr($output, $start, $end - $start);
preg_match ('/<b>(\d+)<\/b>/i', $error, $match);
$error_line = (int) $match['1'] - 1;
ob_start();
try {
eval( $code );
} catch(ParseError $e) {
$error_line = $e->getLine();
}
if ($mod_test_var != $id) {
return $error_line;
unset($_testFunction);
ob_end_clean();

if (!empty($error_line)) {
return $error_line - 2;
} else {
return false;
}
}

/**
* repository::gen_new_mod()
*
Expand Down Expand Up @@ -1086,7 +1079,7 @@ function gen_new_plug($name, $force = false) {
* { Description }
*
*/
var $_rep_var = '';
var $_rep_var = [];
/**
* repository::$_cms_var
*
Expand All @@ -1100,7 +1093,7 @@ function gen_new_plug($name, $force = false) {
* { Description }
*
*/
var $_lang_var = '';
var $_lang_var = [];
/**
* repository::$_service
*
Expand Down
2 changes: 1 addition & 1 deletion backend/inc/class.user_perms.php
Original file line number Diff line number Diff line change
Expand Up @@ -1793,7 +1793,7 @@ function _get_mask($permission) {
* Rechtewerte.
*
* @param string $type Anzuzeigender Rechtetyp
* @param string $rights Array mit Gruppennamen, Gruppenids und Gruppenrechte
* @param array $rights Array mit Gruppennamen, Gruppenids und Gruppenrechte
* @param string $countRights Referenz zur Aufnahme der Anzahl der ausgelesenen Rechte
* @param string $prefix Prefix f�r Formularvariablen, damit mehrere Formulare auf einer Seite dargestellt werden k�nnen
*
Expand Down
2 changes: 1 addition & 1 deletion backend/inc/class.values_ct_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class values_ct_edit extends values_ct
* KONSTRUKTOR - Konfiguration
*
*/
function __construct($mixed = '')
function __construct($mixed = [])
{
global $cms_lang, $vid;

Expand Down
Loading