diff options
-rw-r--r-- | inc/fetch.functions.php | 29 | ||||
-rw-r--r-- | inc/init.php | 4 | ||||
-rw-r--r-- | lib/plugins/authmysql/lang/ru/settings.php | 3 | ||||
-rw-r--r-- | lib/plugins/authpgsql/lang/ru/settings.php | 3 | ||||
-rw-r--r-- | lib/plugins/extension/lang/fr/lang.php | 2 |
5 files changed, 36 insertions, 5 deletions
diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php index 70becc01e..3c5bdfeee 100644 --- a/inc/fetch.functions.php +++ b/inc/fetch.functions.php @@ -72,9 +72,9 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) { //download or display? if($dl) { - header('Content-Disposition: attachment; filename="'.utf8_basename($orig).'";'); + header('Content-Disposition: attachment;'.rfc2231_encode('filename', utf8_basename($orig)).';'); } else { - header('Content-Disposition: inline; filename="'.utf8_basename($orig).'";'); + header('Content-Disposition: inline;'.rfc2231_encode('filename', utf8_basename($orig)).';'); } //use x-sendfile header to pass the delivery to compatible webservers @@ -91,6 +91,31 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) { } /** + * Try an rfc2231 compatible encoding. This ensures correct + * interpretation of filenames outside of the ASCII set. + * This seems to be needed for file names with e.g. umlauts that + * would otherwise decode wrongly in IE. + * + * There is no additional checking, just the encoding and setting the key=value for usage in headers + * + * @author Gerry Weissbach <gerry.w@gammaproduction.de> + * @param string $name name of the field to be set in the header() call + * @param string $value value of the field to be set in the header() call + * @param string $charset used charset for the encoding of value + * @param string $lang language used. + * @return string in the format " name=value" for values WITHOUT special characters + * @return string in the format " name*=charset'lang'value" for values WITH special characters + */ +function rfc2231_encode($name, $value, $charset='utf-8', $lang='en') { + $internal = preg_replace_callback('/[\x00-\x20*\'%()<>@,;:\\\\"\/[\]?=\x80-\xFF]/', function($match) { return rawurlencode($match[0]); }, $value); + if ( $value != $internal ) { + return ' '.$name.'*='.$charset."'".$lang."'".$internal; + } else { + return ' '.$name.'="'.$value.'"'; + } +} + +/** * Check for media for preconditions and return correct status code * * READ: MEDIA, MIME, EXT, CACHE diff --git a/inc/init.php b/inc/init.php index d0d9101e6..12bb6f588 100644 --- a/inc/init.php +++ b/inc/init.php @@ -429,7 +429,7 @@ function getBaseURL($abs=null){ //if canonical url enabled always return absolute if(is_null($abs)) $abs = $conf['canonical']; - if($conf['basedir']){ + if(!empty($conf['basedir'])){ $dir = $conf['basedir']; }elseif(substr($_SERVER['SCRIPT_NAME'],-4) == '.php'){ $dir = dirname($_SERVER['SCRIPT_NAME']); @@ -456,7 +456,7 @@ function getBaseURL($abs=null){ if(!$abs) return $dir; //use config option if available, trim any slash from end of baseurl to avoid multiple consecutive slashes in the path - if($conf['baseurl']) return rtrim($conf['baseurl'],'/').$dir; + if(!empty($conf['baseurl'])) return rtrim($conf['baseurl'],'/').$dir; //split hostheader into host and port if(isset($_SERVER['HTTP_HOST'])){ diff --git a/lib/plugins/authmysql/lang/ru/settings.php b/lib/plugins/authmysql/lang/ru/settings.php index 2d8f4788e..eefec065b 100644 --- a/lib/plugins/authmysql/lang/ru/settings.php +++ b/lib/plugins/authmysql/lang/ru/settings.php @@ -5,6 +5,7 @@ * * @author Ivan I. Udovichenko (sendtome@mymailbox.pp.ua) * @author Aleksandr Selivanov <alexgearbox@gmail.com> + * @author Type-kun <workwork-1@yandex.ru> */ $lang['server'] = 'Ваш MySQL-сервер'; $lang['user'] = 'Имя пользователя MySQL'; @@ -35,7 +36,7 @@ $lang['UpdateLogin'] = 'Условие для обновления и $lang['UpdatePass'] = 'Условие для обновления пароля пользователя'; $lang['UpdateEmail'] = 'Условие для обновления адреса электронной почты пользователя'; $lang['UpdateName'] = 'Условие для обновления полного имени пользователя'; -$lang['UpdateTarget'] = 'Условие для идентификации пользователя при обновлении'; +$lang['UpdateTarget'] = 'Выражение \'LIMIT\' для идентификации пользователя при обновлении'; $lang['delUserGroup'] = 'Выражение SQL, осуществляющее удаление пользователя из указанной группы'; $lang['getGroupID'] = 'Выражение SQL, обеспечивающее получение первичного ключа указанной группы'; $lang['debug_o_0'] = 'ни один из вариантов'; diff --git a/lib/plugins/authpgsql/lang/ru/settings.php b/lib/plugins/authpgsql/lang/ru/settings.php index 416ea0ec9..2af299172 100644 --- a/lib/plugins/authpgsql/lang/ru/settings.php +++ b/lib/plugins/authpgsql/lang/ru/settings.php @@ -7,6 +7,7 @@ * @author Aleksandr Selivanov <alexgearbox@gmail.com> * @author Aleksandr Selivanov <alexgearbox@yandex.ru> * @author Vitaly Filatenko <kot@hacktest.net> + * @author Type-kun <workwork-1@yandex.ru> */ $lang['server'] = 'Ваш PostgreSQL-сервер'; $lang['port'] = 'Порт вашего PostgreSQL-сервера'; @@ -34,5 +35,7 @@ $lang['updateUser'] = 'Выражение SQL, осуществляю $lang['UpdateLogin'] = 'Измените условие для обновления логина'; $lang['UpdatePass'] = 'Измените условие для обновления пароля'; $lang['UpdateEmail'] = 'Измените условие для обновления email'; +$lang['UpdateName'] = 'Условие для обновления полного имени пользователя'; +$lang['UpdateTarget'] = 'Выражение \'LIMIT\' для идентификации пользователя при обновлении'; $lang['delUserGroup'] = 'Выражение SQL, осуществляющее удаление пользователя из указанной группы'; $lang['getGroupID'] = 'Выражение SQL, обеспечивающее получение первичного ключа указанной группы'; diff --git a/lib/plugins/extension/lang/fr/lang.php b/lib/plugins/extension/lang/fr/lang.php index 88234efd0..6955155e9 100644 --- a/lib/plugins/extension/lang/fr/lang.php +++ b/lib/plugins/extension/lang/fr/lang.php @@ -4,6 +4,7 @@ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * * @author Schplurtz le Déboulonné <schplurtz@laposte.net> + * @author Yves Grandvalet <Yves.Grandvalet@laposte.net> */ $lang['menu'] = 'Gestionnaire d\'extension'; $lang['tab_plugins'] = 'Greffons installés'; @@ -62,6 +63,7 @@ $lang['status_bundled'] = 'fourni'; $lang['msg_enabled'] = 'Greffon %s activé'; $lang['msg_disabled'] = 'Greffon %s désactivé'; $lang['msg_delete_success'] = 'Extension désinstallée'; +$lang['msg_delete_failed'] = 'Echec de la désinstallation de l\'extension %s'; $lang['msg_template_install_success'] = 'Thème %s installée avec succès'; $lang['msg_template_update_success'] = 'Thème %s mis à jour avec succès'; $lang['msg_plugin_install_success'] = 'Greffon %s installé avec succès'; |