From e47c69dc244da976173a6ed3a10365f7eadd0534 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 26 Feb 2023 11:54:01 +0100 Subject: [PATCH] Make rpsystem contrib not detect /sdesc in urls. Resolves #3070 --- evennia/contrib/rpg/rpsystem/rpsystem.py | 11 +++-------- evennia/contrib/rpg/rpsystem/tests.py | 12 +++++++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/evennia/contrib/rpg/rpsystem/rpsystem.py b/evennia/contrib/rpg/rpsystem/rpsystem.py index 9d984882a1..e3a631fafc 100644 --- a/evennia/contrib/rpg/rpsystem/rpsystem.py +++ b/evennia/contrib/rpg/rpsystem/rpsystem.py @@ -154,18 +154,12 @@ from string import punctuation import inflect from django.conf import settings - from evennia.commands.cmdset import CmdSet from evennia.commands.command import Command from evennia.objects.models import ObjectDB from evennia.objects.objects import DefaultCharacter, DefaultObject from evennia.utils import ansi, logger -from evennia.utils.utils import ( - iter_to_str, - lazy_property, - make_iter, - variable_from_module, -) +from evennia.utils.utils import iter_to_str, lazy_property, make_iter, variable_from_module _INFLECT = inflect.engine() @@ -203,7 +197,8 @@ _RE_PREFIX = re.compile(rf"^{_PREFIX}", re.UNICODE) # separate multimatches from one another and word is the first word in the # marker. So entering "/tall man" will return groups ("", "tall") # and "/2-tall man" will return groups ("2", "tall"). -_RE_OBJ_REF_START = re.compile(rf"{_PREFIX}(?:([0-9]+){_NUM_SEP})*(\w+)", _RE_FLAGS) +# the negative lookbehind for [:/] is to avoid http:// urls being detected as a /sdesc +_RE_OBJ_REF_START = re.compile(rf"(?