Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Giraffaman committed Mar 23, 2024
1 parent 5ca0097 commit 931f777
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions ext/auto_tagger/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,29 @@ public function onTagSet(TagSetEvent $event): void
{
error_log("auto-tagger: tag set!");
foreach($event->new_tags as $nt) {
error_log("new tag: ".$nt);
error_log("auto-tagger: new tag: ".$nt);
}
foreach($event->old_tags as $ot) {
error_log("old tag: ".$ot);
error_log("auto-tagger: old tag: ".$ot);
}
foreach($event->metatags as $mt) {
error_log("meta tag: ".$mt);
error_log("auto-tagger: meta tag: ".$mt);
}
$results = $this->apply_auto_tags($event->new_tags);
if (!empty($results)) {
$event->new_tags = $results;
error_log("auto-tagger: checking results for metatags...");
# need to check tags again for metatags
foreach ($results as $r) {
if (str_contains($r, ':') || str_contains($r, '=')) {
$ttpe = send_event(new TagTermCheckEvent($r));

//seperate tags from metatags
if ($ttpe->metatag) {
error_log($r." is a meta tag!");
$this->metatags[] = $r;
if (!$ttpe->metatag) {
$event->new_tags = $r;
error_log("auto-tagger: ".$r." is a normal tag.");
} else {
error_log("auto-tagger: ".$r." is a meta tag!");
$event->metatags[] = $r;
}
}
}
Expand Down

0 comments on commit 931f777

Please sign in to comment.