mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 08:47:45 +02:00
fixing some bugs
git-svn-id: file:///svn/phpbb/trunk@7805 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -469,8 +469,8 @@ class custom_profile
|
||||
// case 'datetime':
|
||||
case 'date':
|
||||
$date = explode('-', $value);
|
||||
$month = (isset($date[0])) ? (int) $date[0] : 0;
|
||||
$day = (isset($date[1])) ? (int) $date[1] : 0;
|
||||
$day = (isset($date[0])) ? (int) $date[0] : 0;
|
||||
$month = (isset($date[1])) ? (int) $date[1] : 0;
|
||||
$year = (isset($date[2])) ? (int) $date[2] : 0;
|
||||
|
||||
if (!$day && !$month && !$year)
|
||||
@@ -479,7 +479,8 @@ class custom_profile
|
||||
}
|
||||
else if ($day && $month && $year)
|
||||
{
|
||||
return sprintf('%4d-%02d-%02d', $year, $month, $day);
|
||||
global $user;
|
||||
return $user->format_date(mktime(0, 0, 0, $month, $day, $year), $user->lang['DATE_FORMAT'], true);
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
@@ -1229,7 +1229,7 @@ class parse_message extends bbcode_firstpass
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
// (assertion)
|
||||
$match[] = '#(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)#';
|
||||
$match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)';
|
||||
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
@@ -1239,7 +1239,7 @@ class parse_message extends bbcode_firstpass
|
||||
{
|
||||
if ($max_smilies)
|
||||
{
|
||||
$num_matches = preg_match_all('#' . str_replace('#', '', implode('|', $match)) . '#', $this->message, $matches);
|
||||
$num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches);
|
||||
unset($matches);
|
||||
|
||||
if ($num_matches !== false && $num_matches > $max_smilies)
|
||||
@@ -1249,6 +1249,9 @@ class parse_message extends bbcode_firstpass
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure the delimiter # is added in front and at the end of every element within $match
|
||||
$match = explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#');
|
||||
|
||||
$this->message = trim(preg_replace($match, $replace, $this->message));
|
||||
}
|
||||
}
|
||||
|
@@ -1627,9 +1627,18 @@ class user extends session
|
||||
// - add appropriate variables here, name them as they are used within the language file...
|
||||
if (!$use_db)
|
||||
{
|
||||
if ((include($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx")) === false)
|
||||
if ($use_help && strpos($lang_file, '/') !== false)
|
||||
{
|
||||
trigger_error("Language file {$this->lang_path}" . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx couldn't be opened.", E_USER_ERROR);
|
||||
$language_filename = $this->lang_path . substr($lang_file, 0, stripos($lang_file, '/') + 1) . 'help_' . substr($lang_file, stripos($lang_file, '/') + 1) . '.' . $phpEx;
|
||||
}
|
||||
else
|
||||
{
|
||||
$language_filename = $this->lang_path . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx;
|
||||
}
|
||||
|
||||
if ((include($language_filename)) === false)
|
||||
{
|
||||
trigger_error("Language file $language_filename couldn't be opened.", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
else if ($use_db)
|
||||
|
Reference in New Issue
Block a user