X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=b27c83b600a8038c09d9d90d2ea3e4190d58d217;hb=4d9fd16ddf2a7d6488c4200aca48501e9d5886fe;hp=f736fcf2fe203252aad4377612ee5ac973e9daa4;hpb=8bbf02e0dbc60395a3ec4e8482d652011379fb60;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index f736fcf2..b27c83b6 100644 --- a/index.php +++ b/index.php @@ -13,7 +13,7 @@ * * Licence: http://www.opensource.org/licenses/zlib-license.php * - * Requires: PHP 5.3.x + * Requires: PHP 5.5.x */ // Set 'UTC' as the default timezone if it is not defined in php.ini @@ -83,7 +83,7 @@ use \Shaarli\ThemeUtils; // Ensure the PHP version is supported try { - ApplicationUtils::checkPHPVersion('5.3', PHP_VERSION); + ApplicationUtils::checkPHPVersion('5.5', PHP_VERSION); } catch(Exception $exc) { header('Content-Type: text/plain; charset=utf-8'); echo $exc->getMessage(); @@ -1217,15 +1217,15 @@ function renderPage($conf, $pluginManager, $LINKSDB) $needle = trim($_POST['fromtag']); // True for case-sensitive tag search. $linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true); - foreach($linksToAlter as $key=>$value) - { - $tags = explode(' ',trim($value['tags'])); - $tags[array_search($needle,$tags)] = trim($_POST['totag']); // Replace tags value. - $value['tags']=trim(implode(' ',$tags)); - $LINKSDB[$key]=$value; + foreach($linksToAlter as $key=>$value) { + $tags = preg_split('/\s+/', trim($value['tags'])); + // Replace tags value. + $tags[array_search($needle, $tags)] = trim($_POST['totag']); + $value['tags'] = implode(' ', array_unique($tags)); + $LINKSDB[$key] = $value; } $LINKSDB->save($conf->get('resource.page_cache')); // Save to disk. - echo ''; + echo ''; exit; } }