]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #1085 from virtualtam/docker/multi-stage
authorVirtualTam <virtualtam+github@flibidi.net>
Sat, 24 Feb 2018 12:36:55 +0000 (13:36 +0100)
committerGitHub <noreply@github.com>
Sat, 24 Feb 2018 12:36:55 +0000 (13:36 +0100)
docker: introduce multi-stage image build (master, latest)

README.md
application/NetscapeBookmarkUtils.php
application/config/ConfigManager.php
doc/md/Directory-structure.md
doc/md/Plugins.md
doc/md/Troubleshooting.md
doc/md/Upgrade-and-migration.md
inc/languages/fr/LC_MESSAGES/shaarli.po
index.php
tests/NetscapeBookmarkUtils/BookmarkImportTest.php
tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm [new file with mode: 0644]

index da324abc6e4774f4b5b9d42ecfb139cc2bc20714..106384d8475773b1a44a8a9ac73ade8825a5e051 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ _Do you want to share the links you discover?_
 _Shaarli is a minimalist link sharing service that you can install on your own server._
 _It is designed to be personal (single-user), fast and handy._
 
-[![](https://img.shields.io/badge/stable-v0.8.5-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.8.5)
+[![](https://img.shields.io/badge/stable-v0.8.6-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.8.6)
 [![](https://img.shields.io/travis/shaarli/Shaarli/stable.svg?label=stable)](https://travis-ci.org/shaarli/Shaarli)
 &bull;
 [![](https://img.shields.io/badge/latest-v0.9.5-blue.svg)](https://github.com/shaarli/Shaarli/releases/tag/v0.9.5)
index dd7057f80e5bd25e1d5fce7bb984644b7c9e2689..2aa2da3b379958b2378e57d24467cf0cac50db5a 100644 (file)
@@ -108,7 +108,7 @@ class NetscapeBookmarkUtils
         $filesize = $files['filetoupload']['size'];
         $data = file_get_contents($files['filetoupload']['tmp_name']);
 
-        if (strpos($data, '<!DOCTYPE NETSCAPE-Bookmark-file-1>') === false) {
+        if (preg_match('/<!DOCTYPE NETSCAPE-Bookmark-file-1>/i', $data) === 0) {
             return self::importStatus($filename, $filesize);
         }
 
@@ -160,7 +160,7 @@ class NetscapeBookmarkUtils
             } else if ($post['privacy'] == 'public') {
                 // all imported links are public
                 $private = 0;
-            }                
+            }
 
             $newLink = array(
                 'title' => $bkm['title'],
index 9e4c9f6328d113d4de7dc1af370e6f8a26058a7f..82f4a368e669d57316884a1deec581841813214f 100644 (file)
@@ -123,7 +123,7 @@ class ConfigManager
      * Supports nested settings with dot separated keys.
      *
      * @param string $setting    Asked setting, keys separated with dots.
-     * @param string $value      Value to set.
+     * @param mixed  $value      Value to set.
      * @param bool   $write      Write the new setting in the config file, default false.
      * @param bool   $isLoggedIn User login state, default false.
      *
index eb50965b124c4e15172b1d8cea8e9ae4a64663b4..937a076d0c6646c8e53069748af033b1ef5d0723 100644 (file)
@@ -1,4 +1,4 @@
-TODO: This page is out of date
+## Directory structure
 
 Here is the directory structure of Shaarli and the purpose of the different files:
 
@@ -6,10 +6,16 @@ Here is the directory structure of Shaarli and the purpose of the different file
        index.php        # Main program
        application/     # Shaarli classes
                ├── LinkDB.php
+
+        ...
+
                └── Utils.php
-       tests/       # Shaarli unitary & functional tests
+       tests/           # Shaarli unitary & functional tests
                ├── LinkDBTest.php
-               ├── utils  # utilities to ease testing
+
+        ...
+
+               ├── utils    # utilities to ease testing
                │   └── ReferenceLinkDB.php
                └── UtilsTest.php
     COPYING          # Shaarli license
@@ -18,17 +24,18 @@ Here is the directory structure of Shaarli and the purpose of the different file
        ├── blazy.*                # picture wall lazy image loading library
         ├── shaarli.css, reset.css # Shaarli stylesheet.
         ├── qr.*                   # qr code generation library
-        └──rain.tpl.class.php      # RainTPL templating library
-    tpl/             # RainTPL templates for Shaarli. They are used to build the pages.
+        └── rain.tpl.class.php     # RainTPL templating library
     images/          # Images and icons used in Shaarli
-    data/            # data storage: bookmark database, configuration, logs, banlist
-        ├── config.php             # Shaarli configuration (login, password, timezone, title…)
+    data/            # data storage: bookmark database, configuration, logs, banlist...
+        ├── config.json.php        # Shaarli configuration (login, password, timezone, title...)
         ├── datastore.php          # Your link database (compressed).
         ├── ipban.php              # IP address ban system data
         ├── lastupdatecheck.txt    # Update check timestamp file
-        └──log.txt                 # login/IPban log.
+        └── log.txt                # login/IPban log.
+    tpl/             # RainTPL templates for Shaarli. They are used to build the pages.
     cache/           # thumbnails cache
                      # This directory is automatically created. You can erase it anytime you want.
     tmp/             # Temporary directory for compiled RainTPL templates.
                      # This directory is automatically created. You can erase it anytime you want.
+    vendor/          # Third-party dependencies. This directory is created by Composer
 ```
index 463dae170e37dc3791f1376e3b0f6668f8c0be5e..954442e2789db64355641a1a9d5a324342b41427 100644 (file)
@@ -37,7 +37,7 @@ This is important in case plugins are depending on each other. Read plugins READ
 
 ## File mode
 
-Enabled plugin are stored in your `config.php` parameters file, under the `array`:
+Enabled plugin are stored in your `config.json.php` parameters file, under the `array`:
 
 ```php
 $GLOBALS['config']['ENABLED_PLUGINS']
@@ -48,7 +48,7 @@ Example:
 
 ```php
 $GLOBALS['config']['ENABLED_PLUGINS'] = array(
-    'qrcode', 
+    'qrcode',
     'archiveorg',
     'wallabag',
     'markdown',
index b2d86d40f3802a73a6b7d3c9de773804be36c46c..570f6956c6a79e48d7b731936212798fc67b15bf 100644 (file)
@@ -63,7 +63,7 @@ Related threads:
 
 ### I forgot my password!
 
-Delete the file `data/config.php` and display the page again. You will be asked for a new login/password.
+Delete the file `data/config.json.php` and display the page again. You will be asked for a new login/password.
 
 ### I'm locked out - Login bruteforce protection
 
@@ -97,7 +97,7 @@ php56 1
 
 ```php
 //list($status,$headers,$data) = getHTTP($url,4); // Short timeout to keep the application responsive.
-// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) <head> in html 
+// FIXME: Decode charset according to charset specified in either 1) HTTP response headers or 2) <head> in html
 //if (strpos($status,'200 OK')) $title=html_extract_title($data);
 ```
 
@@ -106,11 +106,11 @@ php56 1
 
 ### Dates are not properly formatted
 
-Shaarli tries to sniff the language of the browser (using HTTP_ACCEPT_LANGUAGE headers) and choose a date format accordingly. But Shaarli can only use the date formats (and more generaly speaking, the locales) provided by the webserver. So even if you have a browser in French, you may end up with dates in US format (it's the case on sebsauvage.net :-( )
-
-### Problems on CentOS servers
-
-On **CentOS**/RedHat derivatives, you may need to install the `php-mbstring` package.
+Shaarli tries to sniff the language of the browser (using `HTTP_ACCEPT_LANGUAGE` headers)
+and choose a date format accordingly. But Shaarli can only use the date formats
+(and more generally speaking, the locales) provided by the webserver.
+So even if you have a browser in French, you may end up with dates in US format
+(it's the case on sebsauvage.net :-( )
 
 ### My session expires! I can't stay logged in
 
@@ -126,7 +126,3 @@ This can be caused by several things:
 ## Sessions do not seem to work correctly on your server
 
 Follow the instructions in the error message. Make sure you are accessing shaarli via a direct IP address or a proper hostname. If you have **no dots** in the hostname (e.g. `localhost` or `http://my-webserver/shaarli/`), some browsers will not store cookies at all (this respects the [HTTP cookie specification](http://curl.haxx.se/rfc/cookie_spec.html)).
-
-### pubsubhubbub support
-
-Download [publisher.php](https://pubsubhubbub.googlecode.com/git/publisher_clients/php/library/publisher.php) at the root of your Shaarli installation and set `$GLOBALS['config']['PUBSUBHUB_URL']` in your `config.php`
index 1dc073398fa190c8c3aaa71deded5e0ace7c5246..f666be751034c9b6d6e2f842c89435892b92e7dc 100644 (file)
@@ -2,14 +2,14 @@
 
 ### Note your current version
 
-If anything goes wrong, it's important for us to know which version you're upgrading from.  
+If anything goes wrong, it's important for us to know which version you're upgrading from.
 The current version is present in the `version.php` file.
 
 ### Backup your data
 
 Shaarli stores all user data under the `data` directory:
 
-- `data/config.php` - main configuration file
+- `data/config.json.php` (or `data/config.php` for older Shaarli versions) - main configuration file
 - `data/datastore.php` - bookmarked links
 - `data/ipbans.php` - banned IP addresses
 - `data/updates.txt` - contains all automatic update to the configuration and datastore files already run
@@ -39,7 +39,7 @@ We recommend that you use the latest release tarball with the `-full` suffix. It
 
 Once downloaded, extract the archive locally and update your remote installation (e.g. via FTP) -be sure you keep the content of the `data` directory!
 
-If you use translations in gettext mode - meaning you manually changed the default mode -, 
+If you use translations in gettext mode - meaning you manually changed the default mode -,
 reload your web server.
 
 After upgrading, access your fresh Shaarli installation from a web browser; the configuration and data store will then be automatically updated, and new settings added to `data/config.json.php` (see [Shaarli configuration](Shaarli configuration) for more details).
@@ -192,7 +192,10 @@ Total 3317 (delta 2050), reused 3301 (delta 2034)to
 
 #### Step 3: configuration
 
-After migrating, access your fresh Shaarli installation from a web browser; the configuration will then be automatically updated, and new settings added to `data/config.php` (see [Shaarli configuration](Shaarli-configuration) for more details).
+After migrating, access your fresh Shaarli installation from a web browser; the
+configuration will then be automatically updated, and new settings added to
+`data/config.json.php` (see [Shaarli configuration](Shaarli-configuration) for more
+details).
 
 ## Troubleshooting
 
index 857b13c72173912471ee8ec8ea18f5066f0abd70..fd47217efb2ce5a79f8d528e0148e11f677f3069 100644 (file)
@@ -1,8 +1,9 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: Shaarli\n"
-"POT-Creation-Date: 2018-01-24 18:43+0100\n"
-"PO-Revision-Date: 2018-01-24 18:44+0100\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-02-24 12:39+0100\n"
+"PO-Revision-Date: 2018-02-24 12:43+0100\n"
 "Last-Translator: \n"
 "Language-Team: Shaarli\n"
 "Language: fr_FR\n"
@@ -15,6 +16,8 @@ msgstr ""
 "X-Poedit-SourceCharset: UTF-8\n"
 "X-Poedit-KeywordsList: t:1,2;t\n"
 "X-Poedit-SearchPath-0: .\n"
+"X-Poedit-SearchPathExcluded-0: node_modules\n"
+"X-Poedit-SearchPathExcluded-1: vendor\n"
 
 #: application/ApplicationUtils.php:153
 #, php-format
@@ -66,15 +69,15 @@ msgstr "Le fichier d'historique n'est pas accessible en lecture ou en écriture"
 msgid "Could not parse history file"
 msgstr "Format incorrect pour le fichier d'historique"
 
-#: application/Languages.php:159
+#: application/Languages.php:161
 msgid "Automatic"
 msgstr "Automatique"
 
-#: application/Languages.php:160
+#: application/Languages.php:162
 msgid "English"
 msgstr "Anglais"
 
-#: application/Languages.php:161
+#: application/Languages.php:163
 msgid "French"
 msgstr "Français"
 
@@ -249,62 +252,135 @@ msgstr "Vous n'êtes pas autorisé à modifier la configuration."
 msgid "Error accessing"
 msgstr "Une erreur s'est produite en accédant à"
 
-#: index.php:135
+#: index.php:142
 msgid "Shared links on "
 msgstr "Liens partagés sur "
 
-#: index.php:157
+#: index.php:164
 msgid "Insufficient permissions:"
 msgstr "Permissions insuffisantes :"
 
-#: index.php:384
+#: index.php:303
 msgid "I said: NO. You are banned for the moment. Go away."
 msgstr "NON. Vous êtes banni pour le moment. Revenez plus tard."
 
-#: index.php:449
+#: index.php:368
 msgid "Wrong login/password."
 msgstr "Nom d'utilisateur ou mot de passe incorrects."
 
-#: index.php:1103
+#: index.php:576 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:42
+msgid "Daily"
+msgstr "Quotidien"
+
+#: index.php:681 tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
+#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
+#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:71
+#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:95
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:71
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:95
+msgid "Login"
+msgstr "Connexion"
+
+#: index.php:722 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:39
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:39
+msgid "Picture wall"
+msgstr "Mur d'images"
+
+#: index.php:770 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:36
+#: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
+msgid "Tag cloud"
+msgstr "Nuage de tags"
+
+#: index.php:803 tmp/tag.list.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
+msgid "Tag list"
+msgstr "Liste des tags"
+
+#: index.php:1028 tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:31
+msgid "Tools"
+msgstr "Outils"
+
+#: index.php:1037
 msgid "You are not supposed to change a password on an Open Shaarli."
 msgstr ""
 "Vous n'êtes pas censé modifier le mot de passe d'un Shaarli en mode ouvert."
 
-#: index.php:1108 index.php:1149 index.php:1225 index.php:1255 index.php:1355
+#: index.php:1042 index.php:1084 index.php:1162 index.php:1193 index.php:1293
 msgid "Wrong token."
 msgstr "Jeton invalide."
 
-#: index.php:1113
+#: index.php:1047
 msgid "The old password is not correct."
 msgstr "L'ancien mot de passe est incorrect."
 
-#: index.php:1133
+#: index.php:1067
 msgid "Your password has been changed"
 msgstr "Votre mot de passe a été modifié"
 
-#: index.php:1186
+#: index.php:1072
+#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
+msgid "Change password"
+msgstr "Modification du mot de passe"
+
+#: index.php:1121
 msgid "Configuration was saved."
 msgstr "La configuration a été sauvegardé."
 
-#: index.php:1237
+#: index.php:1145 tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
+msgid "Configure"
+msgstr "Configurer"
+
+#: index.php:1156 tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
+msgid "Manage tags"
+msgstr "Gérer les tags"
+
+#: index.php:1174
 #, php-format
 msgid "The tag was removed from %d link."
 msgid_plural "The tag was removed from %d links."
 msgstr[0] "Le tag a été supprimé de %d lien."
 msgstr[1] "Le tag a été supprimé de %d liens."
 
-#: index.php:1238
+#: index.php:1175
 #, php-format
 msgid "The tag was renamed in %d link."
 msgid_plural "The tag was renamed in %d links."
 msgstr[0] "Le tag a été renommé dans %d lien."
 msgstr[1] "Le tag a été renommé dans %d liens."
 
-#: index.php:1454
+#: index.php:1183 tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
+msgid "Shaare a new link"
+msgstr "Partager un nouveau lien"
+
+#: index.php:1353 tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
+#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170
+msgid "Edit"
+msgstr "Modifier"
+
+#: index.php:1353 index.php:1418
+#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
+#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
+#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:26
+msgid "Shaare"
+msgstr "Shaare"
+
+#: index.php:1387
 msgid "Note: "
 msgstr "Note : "
 
-#: index.php:1563
+#: index.php:1427 tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:65
+msgid "Export"
+msgstr "Exporter"
+
+#: index.php:1489 tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:83
+msgid "Import"
+msgstr "Importer"
+
+#: index.php:1499
 #, php-format
 msgid ""
 "The file you are trying to upload is probably bigger than what this "
@@ -314,7 +390,16 @@ msgstr ""
 "le serveur web peut accepter (%s). Merci de l'envoyer en parties plus "
 "légères."
 
-#: index.php:1983
+#: index.php:1538 tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
+#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
+msgid "Plugin administration"
+msgstr "Administration des extensions"
+
+#: index.php:1703
+msgid "Search: "
+msgstr "Recherche : "
+
+#: index.php:1930
 #, php-format
 msgid ""
 "<pre>Sessions do not seem to work correctly on your server.<br>Make sure the "
@@ -333,7 +418,7 @@ msgstr ""
 "cookies. Nous vous recommandons d'accéder à votre serveur depuis son adresse "
 "IP ou un <em>Fully Qualified Domain Name</em>.<br>"
 
-#: index.php:1993
+#: index.php:1940
 msgid "Click to try again."
 msgstr "Cliquer ici pour réessayer."
 
@@ -358,7 +443,7 @@ msgstr "Voir sur archive.org"
 msgid "For each link, add an Archive.org icon."
 msgstr "Pour chaque lien, ajoute une icône pour Archive.org."
 
-#: plugins/demo_plugin/demo_plugin.php:469
+#: plugins/demo_plugin/demo_plugin.php:465
 msgid ""
 "A demo plugin covering all use cases for template designers and plugin "
 "developers."
@@ -383,19 +468,19 @@ msgstr ""
 msgid "Isso server URL (without 'http://')"
 msgstr "URL du serveur Isso (sans 'http://')"
 
-#: plugins/markdown/markdown.php:159
+#: plugins/markdown/markdown.php:158
 msgid "Description will be rendered with"
 msgstr "La description sera générée avec"
 
-#: plugins/markdown/markdown.php:160
+#: plugins/markdown/markdown.php:159
 msgid "Markdown syntax documentation"
 msgstr "Documentation sur la syntaxe Markdown"
 
-#: plugins/markdown/markdown.php:161
+#: plugins/markdown/markdown.php:160
 msgid "Markdown syntax"
 msgstr "la syntaxe Markdown"
 
-#: plugins/markdown/markdown.php:340
+#: plugins/markdown/markdown.php:339
 msgid ""
 "Render shaare description with Markdown syntax.<br><strong>Warning</"
 "strong>:\n"
@@ -507,19 +592,10 @@ msgstr[1] "Rechercher"
 msgid "Sorry, nothing to see here."
 msgstr "Désolé, il y a rien à voir ici."
 
-#: tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
-msgid "Shaare a new link"
-msgstr "Partager un nouveau lien"
-
 #: tmp/addlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
 msgid "URL or leave empty to post a note"
 msgstr "URL ou laisser vide pour créer une note"
 
-#: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
-msgid "Change password"
-msgstr "Modification du mot de passe"
-
 #: tmp/changepassword.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
 msgid "Current password"
 msgstr "Mot de passe actuel"
@@ -532,11 +608,6 @@ msgstr "Nouveau mot de passe"
 msgid "Change"
 msgstr "Changer"
 
-#: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:13
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
-msgid "Manage tags"
-msgstr "Gérer les tags"
-
 #: tmp/changetag.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
 #: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:77
 msgid "Tag"
@@ -568,10 +639,6 @@ msgstr "Vous pouvez aussi modifier les tags dans la"
 msgid "tag list"
 msgstr "liste des tags"
 
-#: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:24
-msgid "Configure"
-msgstr "Configurer"
-
 #: tmp/configure.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
 msgid "title"
 msgstr "titre"
@@ -697,17 +764,6 @@ msgstr "Tous les liens d'un jour sur une page."
 msgid "Next day"
 msgstr "Jour suivant"
 
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:14
-#: tmp/linklist.b91ef64efc3688266305ea9b42e5017e.rtpl.php:170
-msgid "Edit"
-msgstr "Modifier"
-
-#: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:26
-msgid "Shaare"
-msgstr "Shaare"
-
 #: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:25
 msgid "Created:"
 msgstr "Création :"
@@ -740,7 +796,7 @@ msgstr "Privé"
 
 #: tmp/editlink.b91ef64efc3688266305ea9b42e5017e.rtpl.php:74
 msgid "Apply Changes"
-msgstr "Appliquer les changements"
+msgstr "Appliquer"
 
 #: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
 msgid "Export Database"
@@ -766,10 +822,6 @@ msgstr "Préfixer les liens de notes avec l'URL de l'instance de Shaarli"
 msgid "Useful to import bookmarks in a web browser"
 msgstr "Utile pour importer les marques-pages dans un navigateur"
 
-#: tmp/export.b91ef64efc3688266305ea9b42e5017e.rtpl.php:65
-msgid "Export"
-msgstr "Exporter"
-
 #: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:16
 msgid "Import Database"
 msgstr "Importer des données"
@@ -807,10 +859,6 @@ msgstr "Les doublons s'appuient sur les URL"
 msgid "Add default tags"
 msgstr "Ajouter des tags par défaut"
 
-#: tmp/import.b91ef64efc3688266305ea9b42e5017e.rtpl.php:83
-msgid "Import"
-msgstr "Importer"
-
 #: tmp/install.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
 msgid "Install Shaarli"
 msgstr "Installation de Shaarli"
@@ -967,15 +1015,6 @@ msgstr ""
 "Vous avez été banni après trop d'échec d'authentification. Merci de "
 "réessayer plus tard."
 
-#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:28
-#: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:44
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:71
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:95
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:71
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:95
-msgid "Login"
-msgstr "Connexion"
-
 #: tmp/loginform.b91ef64efc3688266305ea9b42e5017e.rtpl.php:41
 #: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:151
 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:151
@@ -1009,27 +1048,6 @@ msgstr "Déplier tout"
 msgid "Are you sure you want to delete this link?"
 msgstr "Êtes-vous sûr de vouloir supprimer ce lien ?"
 
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:31
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:31
-msgid "Tools"
-msgstr "Outils"
-
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:36
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:36
-#: tmp/tag.cloud.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
-msgid "Tag cloud"
-msgstr "Nuage de tags"
-
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:39
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:39
-msgid "Picture wall"
-msgstr "Mur d'images"
-
-#: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:42
-#: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:42
-msgid "Daily"
-msgstr "Quotidien"
-
 #: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:61
 #: tmp/page.header.b91ef64efc3688266305ea9b42e5017e.rtpl.php:86
 #: tmp/page.header.cedf684561d925457130839629000a81.rtpl.php:61
@@ -1067,11 +1085,6 @@ msgid "You need to enable Javascript to change plugin loading order."
 msgstr ""
 "Vous devez activer Javascript pour pouvoir modifier l'ordre des extensions."
 
-#: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:26
-#: tmp/tools.b91ef64efc3688266305ea9b42e5017e.rtpl.php:22
-msgid "Plugin administration"
-msgstr "Administration des extensions"
-
 #: tmp/pluginsadmin.b91ef64efc3688266305ea9b42e5017e.rtpl.php:29
 msgid "Enabled Plugins"
 msgstr "Extensions activées"
@@ -1137,10 +1150,6 @@ msgstr "tags"
 msgid "List all links with those tags"
 msgstr "Lister tous les liens avec ces tags"
 
-#: tmp/tag.list.b91ef64efc3688266305ea9b42e5017e.rtpl.php:19
-msgid "Tag list"
-msgstr "List des tags"
-
 #: tmp/tag.sort.b91ef64efc3688266305ea9b42e5017e.rtpl.php:3
 #: tmp/tag.sort.cedf684561d925457130839629000a81.rtpl.php:3
 msgid "Sort by:"
@@ -1289,6 +1298,21 @@ msgstr ""
 "Glisser ce lien dans votre barre de favoris ou cliquer droit dessus et « "
 "Ajouter aux favoris »"
 
+#, fuzzy
+#~| msgid "Change"
+#~ msgid "range"
+#~ msgstr "Changer"
+
+#, fuzzy
+#~| msgid "Description"
+#~ msgid "Declaration"
+#~ msgstr "Description"
+
+#, fuzzy
+#~| msgid "for"
+#~ msgid "foo"
+#~ msgstr "pour"
+
 #~ msgid "Filter links by visibility"
 #~ msgstr "Filtrer les liens par visibilité"
 
index 91c3f07e8f90ef50efc5efeb480046a172c61874..bd34c0cd05aeab499d26fc8b650218544adf53b1 100644 (file)
--- a/index.php
+++ b/index.php
@@ -573,6 +573,7 @@ function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager)
         $pageBuilder->assign($key, $value);
     }
 
+    $pageBuilder->assign('pagetitle', t('Daily') .' - '. $conf->get('general.title', 'Shaarli'));
     $pageBuilder->renderPage('daily');
     exit;
 }
@@ -677,6 +678,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         // add default state of the 'remember me' checkbox
         $PAGE->assign('remember_user_default', $conf->get('privacy.remember_user_default'));
         $PAGE->assign('user_can_login', $loginManager->canLogin($_SERVER));
+        $PAGE->assign('pagetitle', t('Login') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('loginform');
         exit;
     }
@@ -717,6 +719,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign($key, $value);
         }
 
+        $PAGE->assign('pagetitle', t('Picture wall') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('picwall');
         exit;
     }
@@ -752,8 +755,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             );
         }
 
+        $searchTags = implode(' ', escape($filteringTags));
         $data = array(
-            'search_tags' => implode(' ', escape($filteringTags)),
+            'search_tags' => $searchTags,
             'tags' => $tagList,
         );
         $pluginManager->executeHooks('render_tagcloud', $data, array('loggedin' => isLoggedIn()));
@@ -762,6 +766,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign($key, $value);
         }
 
+        $searchTags = ! empty($searchTags) ? $searchTags .' - ' : '';
+        $PAGE->assign('pagetitle', $searchTags. t('Tag cloud') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('tag.cloud');
         exit;
     }
@@ -782,8 +788,9 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             alphabetical_sort($tags, false, true);
         }
 
+        $searchTags = implode(' ', escape($filteringTags));
         $data = [
-            'search_tags' => implode(' ', escape($filteringTags)),
+            'search_tags' => $searchTags,
             'tags' => $tags,
         ];
         $pluginManager->executeHooks('render_taglist', $data, ['loggedin' => isLoggedIn()]);
@@ -792,6 +799,8 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign($key, $value);
         }
 
+        $searchTags = ! empty($searchTags) ? $searchTags .' - ' : '';
+        $PAGE->assign('pagetitle', $searchTags . t('Tag list') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('tag.list');
         exit;
     }
@@ -1016,6 +1025,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign($key, $value);
         }
 
+        $PAGE->assign('pagetitle', t('Tools') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('tools');
         exit;
     }
@@ -1059,6 +1069,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         }
         else // show the change password form.
         {
+            $PAGE->assign('pagetitle', t('Change password') .' - '. $conf->get('general.title', 'Shaarli'));
             $PAGE->renderPage('changepassword');
             exit;
         }
@@ -1131,6 +1142,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign('api_secret', $conf->get('api.secret'));
             $PAGE->assign('languages', Languages::getAvailableLanguages());
             $PAGE->assign('language', $conf->get('translation.language'));
+            $PAGE->assign('pagetitle', t('Configure') .' - '. $conf->get('general.title', 'Shaarli'));
             $PAGE->renderPage('configure');
             exit;
         }
@@ -1141,6 +1153,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     {
         if (empty($_POST['fromtag']) || (empty($_POST['totag']) && isset($_POST['renametag']))) {
             $PAGE->assign('fromtag', ! empty($_GET['fromtag']) ? escape($_GET['fromtag']) : '');
+            $PAGE->assign('pagetitle', t('Manage tags') .' - '. $conf->get('general.title', 'Shaarli'));
             $PAGE->renderPage('changetag');
             exit;
         }
@@ -1167,6 +1180,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
     // -------- User wants to add a link without using the bookmarklet: Show form.
     if ($targetPage == Router::$PAGE_ADDLINK)
     {
+        $PAGE->assign('pagetitle', t('Shaare a new link') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('addlink');
         exit;
     }
@@ -1336,6 +1350,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign($key, $value);
         }
 
+        $PAGE->assign('pagetitle', t('Edit') .' '. t('Shaare') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('editlink');
         exit;
     }
@@ -1400,6 +1415,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
             $PAGE->assign($key, $value);
         }
 
+        $PAGE->assign('pagetitle', t('Shaare') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('editlink');
         exit;
     }
@@ -1408,6 +1424,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
         // Export links as a Netscape Bookmarks file
 
         if (empty($_GET['selection'])) {
+            $PAGE->assign('pagetitle', t('Export') .' - '. $conf->get('general.title', 'Shaarli'));
             $PAGE->renderPage('export');
             exit;
         }
@@ -1469,6 +1486,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
                     true
                 )
             );
+            $PAGE->assign('pagetitle', t('Import') .' - '. $conf->get('general.title', 'Shaarli'));
             $PAGE->renderPage('import');
             exit;
         }
@@ -1517,6 +1535,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
 
         $PAGE->assign('enabledPlugins', $enabledPlugins);
         $PAGE->assign('disabledPlugins', $disabledPlugins);
+        $PAGE->assign('pagetitle', t('Plugin administration') .' - '. $conf->get('general.title', 'Shaarli'));
         $PAGE->renderPage('pluginsadmin');
         exit;
     }
@@ -1680,6 +1699,16 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
     // If there is only a single link, we change on-the-fly the title of the page.
     if (count($linksToDisplay) == 1) {
         $data['pagetitle'] = $linksToDisplay[$keys[0]]['title'] .' - '. $conf->get('general.title');
+    } elseif (! empty($searchterm) || ! empty($searchtags)) {
+        $data['pagetitle'] = t('Search: ');
+        $data['pagetitle'] .= ! empty($searchterm) ? $searchterm .' ' : '';
+        $bracketWrap = function ($tag) {
+            return '['. $tag .']';
+        };
+        $data['pagetitle'] .= ! empty($searchtags)
+            ? implode(' ', array_map($bracketWrap, preg_split('/\s+/', $searchtags))).' '
+            : '';
+        $data['pagetitle'] .= '- '. $conf->get('general.title');
     }
 
     $pluginManager->executeHooks('render_linklist', $data, array('loggedin' => isLoggedIn()));
index 4961aa2c4f73166d069144776cb574db9a537f67..f0a958cb2e71fed3cd747ef10f906b38b82efc1b 100644 (file)
@@ -126,6 +126,21 @@ class BookmarkImportTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(0, count($this->linkDb));
     }
 
+    /**
+     * Attempt to import bookmarks from a file with a lowercase Doctype
+     */
+    public function testImportLowecaseDoctype()
+    {
+        $files = file2array('lowercase_doctype.htm');
+        $this->assertStringMatchesFormat(
+            'File lowercase_doctype.htm (386 bytes) was successfully processed in %d seconds:'
+            .' 2 links imported, 0 links overwritten, 0 links skipped.',
+            NetscapeBookmarkUtils::import(null, $files, $this->linkDb, $this->conf, $this->history)
+        );
+        $this->assertEquals(2, count($this->linkDb));
+    }
+
+
     /**
      * Ensure IE dumps are supported
      */
diff --git a/tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm b/tests/NetscapeBookmarkUtils/input/lowercase_doctype.htm
new file mode 100644 (file)
index 0000000..8911ad1
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE netscape-bookmark-file-1>
+<TITLE>Bookmarks</TITLE>
+<H1>Bookmarks</H1>
+<DL><p>
+<DT><A HREF="https://private.tld" ADD_DATE="10/Oct/2000:13:55:36 +0300" PRIVATE="1" TAGS="private secret">Secret stuff</A>
+<DD>Super-secret stuff you're not supposed to know about
+<DT><A HREF="http://public.tld" ADD_DATE="1456433748" PRIVATE="0" TAGS="public hello world">Public stuff</A>
+</DL><p>