Skip to content

Commit

Permalink
Fixed a bug in removing tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Tubebaum committed Jun 26, 2012
1 parent 2b8116d commit ed0aab4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion getTagList.php
Expand Up @@ -47,7 +47,7 @@
$cont = false;
}
//For each entry retrieved, the tags are counted and added to the array
foreach($results->objects as $entry) {
foreach($results->objects as $entry) {
$tags = explode(',', $entry->tags);
foreach ($tags as $tag) {
$tag = trim($tag);
Expand Down
5 changes: 3 additions & 2 deletions reloadEntries.php
Expand Up @@ -30,7 +30,8 @@ function escapeChar($input)
$input = '\\'.$input[0];
return $input;
}
$search = preg_replace_callback('|[#-/]|','escapeChar',$search);
$search = preg_replace_callback('|[#-+]|','escapeChar',$search);
$search = preg_replace_callback('|[--/]|','escapeChar',$search);
$search = preg_replace_callback('|!|','escapeChar',$search);
$search = preg_replace_callback('|"|','escapeChar',$search);
$search = preg_replace_callback('|-|','escapeChar',$search);
Expand Down Expand Up @@ -115,7 +116,7 @@ function create_gallery_pager ($pageNumber, $current_page, $pageSize, $count, $
echo '<option value="'.$tag.'"';
//Checks to see if the particular entry has any tags already
//Any tags found are pre-selected in the multiselect field
$pos = strpos(' '.$tagsList[$count].',', ' '.$tag.',');
$pos = strpos(', '.$tagsList[$count].',', ', '.$tag.',');
if($pos === false) {}
else {
echo " selected";
Expand Down
5 changes: 3 additions & 2 deletions removeTags.php
Expand Up @@ -22,8 +22,9 @@ function escapeChar($input)
$input = '\\'.$input[0];
return $input;
}
$tagString = implode(',', $tags);
$tagString = preg_replace_callback('|[#-/]|','escapeChar',$tagString);
$tagString = implode(', ', $tags);
$tagString = preg_replace_callback('|[#-+]|','escapeChar',$tagString);
$tagString = preg_replace_callback('|[--/]|','escapeChar',$tagString);
$tagString = preg_replace_callback('|!|','escapeChar',$tagString);
$tagString = preg_replace_callback('|"|','escapeChar',$tagString);
$tagString = preg_replace_callback('|-|','escapeChar',$tagString);
Expand Down

0 comments on commit ed0aab4

Please sign in to comment.