1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 12:20:44 +02:00

Code cleanup

This commit is contained in:
Cameron
2020-12-20 19:42:09 -08:00
parent 0f4b3d29cb
commit 9880a68d4b
10 changed files with 18 additions and 22 deletions

View File

@@ -91,9 +91,6 @@ foreach($filtered as $key => $value)
// $ns->tablerender($caption, $mes->render() . $text); // $ns->tablerender($caption, $mes->render() . $text);
$check = TRUE;
//$check = $emote -> installCheck();
$check = $emote->installCheck($one_pack); $check = $emote->installCheck($one_pack);
if($check!==FALSE) if($check!==FALSE)
{ {

View File

@@ -863,7 +863,7 @@ class eurl_admin_form_ui extends e_admin_form_ui
$label = vartrue($section['label'], $index == 0 ? LAN_EURL_DEFAULT : eHelper::labelize(ltrim(strstr($location, '/'), '/'))); $label = vartrue($section['label'], $index == 0 ? LAN_EURL_DEFAULT : eHelper::labelize(ltrim(strstr($location, '/'), '/')));
$cssClass = $checked ? 'e-showme' : 'e-hideme'; // $cssClass = $checked ? 'e-showme' : 'e-hideme';
$cssClass = 'e-hideme'; // always hidden for now, some interface changes could come after pre-alpha $cssClass = 'e-hideme'; // always hidden for now, some interface changes could come after pre-alpha
$exampleUrl = array(); $exampleUrl = array();

View File

@@ -578,13 +578,13 @@ class media_form_ui extends e_admin_form_ui
$pref = e107::getPref(); $pref = e107::getPref();
$options = array( // $options = array(
// "news-image" => LAN_IMA_O_001, // "news-image" => LAN_IMA_O_001,
// "news-bbcode" => LAN_IMA_O_002, // "news-bbcode" => LAN_IMA_O_002,
// "page-bbcode" => LAN_IMA_O_003, // "page-bbcode" => LAN_IMA_O_003,
// "featurebox-image" => LAN_IMA_O_004, // "featurebox-image" => LAN_IMA_O_004,
// "featurebox-bbcode" => LAN_IMA_O_005, // "featurebox-bbcode" => LAN_IMA_O_005,
); // );
$options = $pref['resize_dimensions']; $options = $pref['resize_dimensions'];
@@ -3265,10 +3265,10 @@ class media_admin_ui extends e_admin_ui
if(is_readable($xmlFile)) if(is_readable($xmlFile))
{ {
$data = file_get_contents($xmlFile); $data = file_get_contents($xmlFile);
$tmp = preg_match("/<author name=(?:'|\")([^'\"]*)/i",$data,$authorName); preg_match("/<author name=(?:'|\")([^'\"]*)/i",$data,$authorName);
$tmp = preg_match("/email=(?:'|\")([^'\"]*)/i",$data,$authorEmail); preg_match("/email=(?:'|\")([^'\"]*)/i",$data,$authorEmail);
$tmp = preg_match("/<title>(.*)<\/title>/i",$data,$title); preg_match("/<title>(.*)<\/title>/i",$data,$title);
$tmp = preg_match("/<description>(.*)<\/description>/i",$data,$diz); preg_match("/<description>(.*)<\/description>/i",$data,$diz);
return array( return array(
'title' => $title[1], 'title' => $title[1],

View File

@@ -359,8 +359,7 @@ class signup_shortcodes extends e_shortcode
$options = array('size'=>30); $options = array('size'=>30);
$options['required'] = ($pref==2) ? 1 : 0; $options['required'] = ($pref==2) ? 1 : 0;
$options['class'] = 'tbox input-text e-email'; $options['class'] = vartrue($parm['class'],'tbox input-text e-email');
$options['class'] = vartrue($parm['class'],'tbox input-text e-email');
$options['placeholder'] = vartrue($parm['placeholder'],''); $options['placeholder'] = vartrue($parm['placeholder'],'');
$val = !empty($_POST['email_confirm']) ? filter_var($_POST['email_confirm'], FILTER_SANITIZE_EMAIL) : ''; $val = !empty($_POST['email_confirm']) ? filter_var($_POST['email_confirm'], FILTER_SANITIZE_EMAIL) : '';

View File

@@ -773,11 +773,11 @@ class user_shortcodes extends e_shortcode
foreach($ueCatList as $catnum => $cat) foreach($ueCatList as $catnum => $cat)
{ {
$key = $cat[0]['user_extended_struct_text'] ? $cat[0]['user_extended_struct_text'] : $cat[0]['user_extended_struct_name']; $key = $cat[0]['user_extended_struct_text'] ? $cat[0]['user_extended_struct_text'] : $cat[0]['user_extended_struct_name'];
$cat_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$this->var['user_id']}}", TRUE); //XXX FIXME Fails // $cat_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$this->var['user_id']}}", TRUE); //XXX FIXME Fails
// $cat_name = true; //XXX TEMP Fix.
$cat_name = true; //XXX TEMP Fix. if(/*$cat_name != FALSE && */isset($ueFieldList[$catnum]) && count($ueFieldList[$catnum]))
if($cat_name != FALSE && isset($ueFieldList[$catnum]) && count($ueFieldList[$catnum]))
{ {
$ret .= str_replace("{EXTENDED_NAME}", $key, $EXTENDED_CATEGORY_START); $ret .= str_replace("{EXTENDED_NAME}", $key, $EXTENDED_CATEGORY_START);

View File

@@ -2375,7 +2375,7 @@ class eRouter
if ('' === $pathInfo) return; if ('' === $pathInfo) return;
if ($equal != $ampersand) $pathInfo = str_replace($equal, $ampersand, $pathInfo); if ($equal != $ampersand) $pathInfo = str_replace($equal, $ampersand, $pathInfo);
$segs = explode($ampersand, $pathInfo.$ampersand); // $segs = explode($ampersand, $pathInfo.$ampersand);
$segs = explode('/', $pathInfo); $segs = explode('/', $pathInfo);
$ret = array(); $ret = array();

View File

@@ -445,7 +445,7 @@ class e_array {
$first2Chars = substr($ArrayData,0,2); $first2Chars = substr($ArrayData,0,2);
if($first2Chars === 'a:' || $first2Chars === 's:') // php serialize. if($first2Chars === 'a:' || $first2Chars === 's:') // php serialize.
{ {
$dat = unserialize($ArrayData); $dat = unserialize($ArrayData, ['allowed_classes' => false]);
$ArrayData = $this->WriteArray($dat,FALSE); $ArrayData = $this->WriteArray($dat,FALSE);
} }
elseif(strpos($ArrayData,'{') === 0 || strpos($ArrayData,'[') === 0) // json elseif(strpos($ArrayData,'{') === 0 || strpos($ArrayData,'[') === 0) // json

View File

@@ -904,7 +904,7 @@ class db_verify
// print_a($sql_data); // print_a($sql_data);
// $regex = "/CREATE TABLE `?([\w]*)`?\s*?\(([\s\w\+\-_\(\),'\. `]*)\)\s*(ENGINE|TYPE)\s*?=\s?([\w]*)[\w =]*;/i"; // $regex = "/CREATE TABLE `?([\w]*)`?\s*?\(([\s\w\+\-_\(\),'\. `]*)\)\s*(ENGINE|TYPE)\s*?=\s?([\w]*)[\w =]*;/i";
$regex = "/CREATE TABLE (?:IF NOT EXISTS )?`?([\w]*)`?\s*?\(([\s\w\+\-_\(\),:'\. `]*)\)\s*(ENGINE|TYPE)\s*?=\s?([\w]*)[\w =]*;/i"; // $regex = "/CREATE TABLE (?:IF NOT EXISTS )?`?([\w]*)`?\s*?\(([\s\w\+\-_\(\),:'\. `]*)\)\s*(ENGINE|TYPE)\s*?=\s?([\w]*)[\w =]*;/i";
// also support non-alphanumeric chars. // also support non-alphanumeric chars.
$regex = "/CREATE TABLE (?:IF NOT EXISTS )?`?([\w]*)`?\s*?\(([^;]*)\)\s*(ENGINE|TYPE)\s*?=\s?([\w]*)[\w =]*;/i"; $regex = "/CREATE TABLE (?:IF NOT EXISTS )?`?([\w]*)`?\s*?\(([^;]*)\)\s*(ENGINE|TYPE)\s*?=\s?([\w]*)[\w =]*;/i";

View File

@@ -3231,7 +3231,7 @@ class themeHandler
/** /**
* Set the Theme layouts, as found in theme.xml * Set the Theme layouts, as found in theme.xml
*/ */
function setLayouts($name='') function setLayouts()
{ {
$name = $this->id; $name = $this->id;
$layout = is_array($this->themeArray[$name]['layouts']) ? $this->themeArray[$name]['layouts'] : array(); $layout = is_array($this->themeArray[$name]['layouts']) ? $this->themeArray[$name]['layouts'] : array();

View File

@@ -216,8 +216,8 @@ class gallery_shortcodes extends e_shortcode
{ {
// we passs both fields, the router will convert one of them to 'cat' variable, based on the current URL config // we passs both fields, the router will convert one of them to 'cat' variable, based on the current URL config
$url = 'route::gallery/index/list?media_cat_category=' . $this->curCat . '--AMP--media_cat_sef=' . $this->var['media_cat_sef'] . '--AMP--frm=--FROM--::full=1'; $url = 'route::gallery/index/list?media_cat_category=' . $this->curCat . '--AMP--media_cat_sef=' . $this->var['media_cat_sef'] . '--AMP--frm=--FROM--::full=1';
$parm = 'total=' . $this->total . '&amount=' . $this->amount . '&current=' . $this->from . '&url=' . rawurlencode($url); // .'&url='.$url; $param = 'total=' . $this->total . '&amount=' . $this->amount . '&current=' . $this->from . '&url=' . rawurlencode($url); // .'&url='.$url;
$text = e107::getParser()->parseTemplate("{NEXTPREV=" . $parm . "}"); $text = e107::getParser()->parseTemplate("{NEXTPREV=" . $param . "}");
return $text; return $text;
} }