refactor: ein Helfer für Gruppen-Kurznamen (NodeSummary::groupShortName), ESCAPED_LETTER_REGEX am UsageQuery-Interface, Docblock DiviComposition::presets; Tests für Muster, Kurzname und Gruppen-Überdeckung

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 17:40:21 +02:00
co-authored by Claude Sonnet 5.5
parent 6d7c59e3fa
commit e7793fd595
13 changed files with 70 additions and 16 deletions
@@ -23,7 +23,7 @@ final class LibraryUsageQuery implements UsageQuery
'(LOWER(post_content) LIKE %s OR LOWER(post_content) LIKE %s OR post_content REGEXP %s)',
'%' . $db->esc_like('globalmodule') . '%',
'%' . $db->esc_like('global_module') . '%',
str_repeat(chr(92), 2) . 'u00[4-7][0-9a-fA-F]'
self::ESCAPED_LETTER_REGEX
);
}
@@ -13,6 +13,12 @@ defined('ABSPATH') || exit;
*/
interface UsageQuery
{
/**
* MySQL REGEXP for a JSON-escaped letter ("\\u004x" … "\\u007x"): a name or ID written that way is not found by
* LIKE, so candidate conditions keep such posts (fail closed, ruling P23).
*/
public const ESCAPED_LETTER_REGEX = '\\\\u00[4-7][0-9a-fA-F]';
/** A condition for "WHERE (…)", already passed through $db->prepare(). */
public function candidateCondition(\wpdb $db): string;