diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_profile_fields.php | 7 | ||||
-rw-r--r-- | phpBB/includes/message_parser.php | 7 | ||||
-rw-r--r-- | phpBB/includes/session.php | 13 |
3 files changed, 20 insertions, 7 deletions
diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 47d3ae03a9..7c5e39c3a7 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -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; diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 1a70a7fd80..649708aff3 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -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)); } } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index e97f3ac8e6..35edf92749 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -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) |