parent
9977c418d6
commit
d6327389fc
1 changed files with 7 additions and 7 deletions
12
index.php
12
index.php
|
@ -1207,15 +1207,15 @@ function renderPage($conf, $pluginManager, $LINKSDB)
|
||||||
$needle = trim($_POST['fromtag']);
|
$needle = trim($_POST['fromtag']);
|
||||||
// True for case-sensitive tag search.
|
// True for case-sensitive tag search.
|
||||||
$linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true);
|
$linksToAlter = $LINKSDB->filterSearch(array('searchtags' => $needle), true);
|
||||||
foreach($linksToAlter as $key=>$value)
|
foreach($linksToAlter as $key=>$value) {
|
||||||
{
|
$tags = preg_split('/\s+/', trim($value['tags']));
|
||||||
$tags = explode(' ',trim($value['tags']));
|
// Replace tags value.
|
||||||
$tags[array_search($needle,$tags)] = trim($_POST['totag']); // Replace tags value.
|
$tags[array_search($needle, $tags)] = trim($_POST['totag']);
|
||||||
$value['tags']=trim(implode(' ',$tags));
|
$value['tags'] = implode(' ', array_unique($tags));
|
||||||
$LINKSDB[$key] = $value;
|
$LINKSDB[$key] = $value;
|
||||||
}
|
}
|
||||||
$LINKSDB->save($conf->get('resource.page_cache')); // Save to disk.
|
$LINKSDB->save($conf->get('resource.page_cache')); // Save to disk.
|
||||||
echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode($_POST['totag']).'\';</script>';
|
echo '<script>alert("Tag was renamed in '.count($linksToAlter).' links.");document.location=\'?searchtags='.urlencode(escape($_POST['totag'])).'\';</script>';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue