diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 |
85 | try { | 85 | try { |
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(); |
@@ -1207,15 +1207,15 @@ function renderPage($conf, $pluginManager, $LINKSDB) | |||
1207 | $needle = trim($_POST['fromtag']); | 1207 | $needle = trim($_POST['fromtag']); |
1208 | // True for case-sensitive tag search. | 1208 | // True for case-sensitive tag search. |
1209 | $linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true); | 1209 | $linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true); |
1210 | foreach($linksToAlter as $key=>$value) | 1210 | foreach($linksToAlter as $key=>$value) { |
1211 | { | 1211 | $tags = preg_split('/\s+/', trim($value['tags'])); |
1212 | $tags = explode(' ',trim($value['tags'])); | 1212 | // Replace tags value. |
1213 | $tags[array_search($needle,$tags)] = trim($_POST['totag']); // Replace tags value. | 1213 | $tags[array_search($needle, $tags)] = trim($_POST['totag']); |
1214 | $value['tags']=trim(implode(' ',$tags)); | 1214 | $value['tags'] = implode(' ', array_unique($tags)); |
1215 | $LINKSDB[$key]=$value; | 1215 | $LINKSDB[$key] = $value; |
1216 | } | 1216 | } |
1217 | $LINKSDB->save($conf->get('resource.page_cache')); // Save to disk. | 1217 | $LINKSDB->save($conf->get('resource.page_cache')); // Save to disk. |
1218 | echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>'; | 1218 | echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode(escape($_POST['totag'])).'\';</script>'; |
1219 | exit; | 1219 | exit; |
1220 | } | 1220 | } |
1221 | } | 1221 | } |