mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Various bug fixes
This commit is contained in:
parent
37ee3f132a
commit
2bdcceab9c
@ -3949,7 +3949,7 @@ class eResponse
|
||||
$attrData .= '<meta';
|
||||
foreach ($attr as $p => $v)
|
||||
{
|
||||
$attrData .= ' '.preg_replace('/[^\w\pL\-]/u', '', $p).'="'.str_replace(array('"', '<'), '', $v).'"';
|
||||
$attrData .= ' '.preg_replace('/[^\w\-]/', '', $p).'="'.str_replace(array('"', '<'), '', $v).'"';
|
||||
}
|
||||
$attrData .= ' />'."\n";
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ class convert
|
||||
$tdata['tm_hour'],
|
||||
$tdata['tm_min'],
|
||||
$tdata['tm_sec'],
|
||||
$tdata['tm_mon'] + 1,
|
||||
$tdata['tm_mon'],
|
||||
$tdata['tm_mday'],
|
||||
($tdata['tm_year'] + 1900)
|
||||
);
|
||||
|
@ -1207,10 +1207,10 @@ class e_parse extends e_parser
|
||||
// it should work for any characters encoding
|
||||
|
||||
// FIXME - INVESTIGATE this one, switch to utf8 aware methods
|
||||
$leftAmp = $this->ustrrpos($this->usubstr($ret, -8), '&');
|
||||
$leftAmp = strrpos(substr($ret, -8), '&');
|
||||
if($leftAmp)
|
||||
{
|
||||
$ret = $this->usubstr($ret, 0, $this->ustrlen($ret) - 8 + $leftAmp);
|
||||
$ret = substr($ret, 0, strlen($ret) - 8 + $leftAmp);
|
||||
}
|
||||
|
||||
return $ret.$more;
|
||||
|
@ -687,30 +687,14 @@ class e_form
|
||||
{
|
||||
if(!is_array($options)) parse_str($options, $options);
|
||||
|
||||
$default_name = vartrue($default_name, '');
|
||||
$default_id = vartrue($default_id, 0);
|
||||
$default_name = vartrue($default_name,USERNAME);
|
||||
$default_id = vartrue($default_id,USERID);
|
||||
|
||||
//TODO Auto-calculate $name_fld from $id_fld ie. append "_usersearch" here ?
|
||||
|
||||
$fldid = $this->name2id($name_fld);
|
||||
$hidden_fldid = $this->name2id($id_fld);
|
||||
|
||||
$ret = $this->text($name_fld,$default_name,20, "class=e-tip&title=Type name of user&typeahead=users&readonly=".vartrue($options['readonly']))
|
||||
.$this->hidden($id_fld,$default_id, array('id' => $this->name2id($id_fld)))." id# <span id='{$fldid}-id'>".$default_id.'</span>';
|
||||
$ret .= " <a href='#' id='{$fldid}-reset'>reset</a>";
|
||||
return $this->text($name_fld,$default_name,20, "class=e-tip&title=Type name of user&typeahead=users&readonly=".vartrue($options['readonly']))
|
||||
.$this->hidden($id_fld,$default_id, array('id' => $this->name2id($id_fld)))." id# ".$default_id;
|
||||
|
||||
e107::getJs()->footerInline("
|
||||
\$('#{$fldid}').blur(function () {
|
||||
\$('#{$fldid}-id').html(\$('#{$hidden_fldid}').val());
|
||||
});
|
||||
\$('#{$fldid}-reset').click(function () {
|
||||
\$('#{$fldid}-id').html('0');
|
||||
\$('#{$hidden_fldid}').val(0);
|
||||
\$('#{$fldid}').val('');
|
||||
});
|
||||
");
|
||||
|
||||
return $ret;
|
||||
/*
|
||||
$label_fld = str_replace('_', '-', $name_fld).'-upicker-lable';
|
||||
|
||||
|
@ -1453,11 +1453,10 @@ class e_model extends e_object
|
||||
|
||||
/**
|
||||
* Generic load data from DB
|
||||
* @param mixed $id
|
||||
* @param boolean $force
|
||||
* @return e_model
|
||||
*/
|
||||
public function load($id = null, $force = false)
|
||||
public function load($id, $force = false)
|
||||
{
|
||||
if(!$force && $this->getId())
|
||||
{
|
||||
@ -1469,8 +1468,8 @@ class e_model extends e_object
|
||||
$this->setData(array())
|
||||
->_clearCacheData();
|
||||
}
|
||||
if($id) $id = e107::getParser()->toDB($id);
|
||||
if(!$id && !$this->getParam('db_query'))
|
||||
$id = e107::getParser()->toDB($id);
|
||||
if(!$id)
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
@ -2659,7 +2658,7 @@ class e_front_model extends e_model
|
||||
return 0;
|
||||
}
|
||||
$sql = e107::getDb();
|
||||
$res = $sql->db_Update($this->getModelTable(), $this->toSqlQuery('update'), $this->getParam('db_debug', false));
|
||||
$res = $sql->db_Update($this->getModelTable(), $this->toSqlQuery('update'));
|
||||
if(!$res)
|
||||
{
|
||||
$this->_db_errno = $sql->getLastErrorNumber();
|
||||
@ -2846,7 +2845,7 @@ class e_admin_model extends e_front_model
|
||||
return false;
|
||||
}
|
||||
$sql = e107::getDb();
|
||||
$res = $sql->db_Insert($this->getModelTable(), $this->toSqlQuery('create'), $this->getParam('db_debug', false));
|
||||
$res = $sql->db_Insert($this->getModelTable(), $this->toSqlQuery('create'));
|
||||
if(!$res)
|
||||
{
|
||||
$this->_db_errno = $sql->getLastErrorNumber();
|
||||
@ -3422,7 +3421,7 @@ class e_front_tree_model extends e_tree_model
|
||||
}
|
||||
$idstr = implode(', ', $ids);
|
||||
|
||||
$res = $sql->db_Update($this->getModelTable(), "{$field}={$value} WHERE ".$this->getFieldIdName().' IN ('.$idstr.')', $this->getParam('db_debug', false));
|
||||
$res = $sql->db_Update($this->getModelTable(), "{$field}={$value} WHERE ".$this->getFieldIdName().' IN ('.$idstr.')');
|
||||
$this->_db_errno = $sql->getLastErrorNumber();
|
||||
$this->_db_errmsg = $sql->getLastErrorText();
|
||||
if(!$res)
|
||||
|
@ -393,7 +393,7 @@ class e_db_mysql
|
||||
|
||||
if ($debug == 'now')
|
||||
{
|
||||
echo "<pre>** $query</pre><br />\n";
|
||||
echo "** $query<br />\n";
|
||||
}
|
||||
if ($debug !== FALSE || strstr($_SERVER['QUERY_STRING'], 'showsql'))
|
||||
{
|
||||
|
@ -306,9 +306,9 @@ class redirection
|
||||
}
|
||||
|
||||
|
||||
public function redirect($url, $replace = TRUE, $http_response_code = NULL, $preventCache)
|
||||
public function redirect($url, $replace = TRUE, $http_response_code = NULL)
|
||||
{
|
||||
return $this->go($url, $replace, $http_response_code, $preventCache);
|
||||
return $this->go($url, $replace, $http_response_code);
|
||||
}
|
||||
|
||||
|
||||
@ -318,20 +318,14 @@ class redirection
|
||||
* @param string $url
|
||||
* @param boolean $replace - default TRUE
|
||||
* @param integer|null $http_response_code - default NULL
|
||||
* @param boolean $preventCache
|
||||
* @return void
|
||||
*/
|
||||
public function go($url, $replace = TRUE, $http_response_code = NULL, $preventCache = true)
|
||||
public function go($url, $replace = TRUE, $http_response_code = NULL)
|
||||
{
|
||||
if(session_id())
|
||||
{
|
||||
e107::getSession()->end();
|
||||
}
|
||||
if($preventCache)
|
||||
{
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0', true);
|
||||
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT', true);
|
||||
}
|
||||
if(null === $http_response_code)
|
||||
{
|
||||
header('Location: '.$url, $replace);
|
||||
|
@ -338,7 +338,7 @@ class UserHandler
|
||||
*/
|
||||
public function generateRandomString($pattern, $seed = '')
|
||||
{
|
||||
if (empty($pattern))
|
||||
if (strlen($pattern) < 6)
|
||||
$pattern = '##....';
|
||||
|
||||
$newname = '';
|
||||
|
@ -119,7 +119,7 @@ class login_menu_class
|
||||
if(($tmp = getcachedvars('loginbox_elist')) !== FALSE) return $tmp;
|
||||
|
||||
$ret = array();
|
||||
//$lbox_admin = varsettrue($eplug_admin, false);
|
||||
$lbox_admin = varsettrue($eplug_admin, false);
|
||||
$coreplugs = $this->get_coreplugs();
|
||||
|
||||
$lprefs = varsettrue($this->loginPrefs['external_links']) ? explode(',', $this->loginPrefs['external_links']) : array();
|
||||
|
Loading…
x
Reference in New Issue
Block a user