aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/index.php b/index.php
index f736fcf2..b27c83b6 100644
--- a/index.php
+++ b/index.php
@@ -13,7 +13,7 @@
13 * 13 *
14 * Licence: http://www.opensource.org/licenses/zlib-license.php 14 * Licence: http://www.opensource.org/licenses/zlib-license.php
15 * 15 *
16 * Requires: PHP 5.3.x 16 * Requires: PHP 5.5.x
17 */ 17 */
18 18
19// Set 'UTC' as the default timezone if it is not defined in php.ini 19// Set 'UTC' as the default timezone if it is not defined in php.ini
@@ -83,7 +83,7 @@ use \Shaarli\ThemeUtils;
83 83
84// Ensure the PHP version is supported 84// Ensure the PHP version is supported
85try { 85try {
86 ApplicationUtils::checkPHPVersion('5.3', PHP_VERSION); 86 ApplicationUtils::checkPHPVersion('5.5', PHP_VERSION);
87} catch(Exception $exc) { 87} catch(Exception $exc) {
88 header('Content-Type: text/plain; charset=utf-8'); 88 header('Content-Type: text/plain; charset=utf-8');
89 echo $exc->getMessage(); 89 echo $exc->getMessage();
@@ -1217,15 +1217,15 @@ function renderPage($conf, $pluginManager, $LINKSDB)
1217 $needle = trim($_POST['fromtag']); 1217 $needle = trim($_POST['fromtag']);
1218 // True for case-sensitive tag search. 1218 // True for case-sensitive tag search.
1219 $linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true); 1219 $linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true);
1220 foreach($linksToAlter as $key=>$value) 1220 foreach($linksToAlter as $key=>$value) {
1221 { 1221 $tags = preg_split('/\s+/', trim($value['tags']));
1222 $tags = explode(' ',trim($value['tags'])); 1222 // Replace tags value.
1223 $tags[array_search($needle,$tags)] = trim($_POST['totag']); // Replace tags value. 1223 $tags[array_search($needle, $tags)] = trim($_POST['totag']);
1224 $value['tags']=trim(implode(' ',$tags)); 1224 $value['tags'] = implode(' ', array_unique($tags));
1225 $LINKSDB[$key]=$value; 1225 $LINKSDB[$key] = $value;
1226 } 1226 }
1227 $LINKSDB->save($conf->get('resource.page_cache')); // Save to disk. 1227 $LINKSDB->save($conf->get('resource.page_cache')); // Save to disk.
1228 echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>'; 1228 echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode(escape($_POST['totag'])).'\';</script>';
1229 exit; 1229 exit;
1230 } 1230 }
1231 } 1231 }