Fix #135999: Extensions: Remove emails in bl_info['author']

Previously when an addon is expanded on the UI, the "Maintainer" string
would be cut short until a `<` character, to prevent showing e-mail on the
UI, however there could be more than one person/email entries in there
so to prevent cutting short the string, now we use regex to take out the
email part only, so full maintainer string is displayed.

Pull Request: https://projects.blender.org/blender/blender/pulls/136031
This commit is contained in:
YimingWu
2025-03-24 07:35:44 +01:00
committed by YimingWu
parent 2f41aa6a52
commit 68a0e68bcd
3 changed files with 9 additions and 2 deletions

View File

@@ -532,7 +532,7 @@ def addons_panel_draw_items(
del value
if show_expanded:
item_maintainer = value.split("<", 1)[0].rstrip() if (value := bl_info["author"]) else ""
item_maintainer = value if (value := bl_info["author"]) else ""
item_version = ".".join(str(x) for x in value) if (value := bl_info["version"]) else ""
item_doc_url = bl_info["doc_url"]
item_tracker_url = bl_info.get("tracker_url")

View File

@@ -1331,6 +1331,7 @@ class PkgManifest_Normalized(NamedTuple):
error_fn(ex)
return None
import re
return PkgManifest_Normalized(
name=field_name,
tagline=field_tagline,
@@ -1338,7 +1339,7 @@ class PkgManifest_Normalized(NamedTuple):
type=field_type,
# Remove the maintainers email while it's not private, showing prominently
# could cause maintainers to get direct emails instead of issue tracking systems.
maintainer=field_maintainer.split("<", 1)[0].rstrip(),
maintainer=re.sub(r"\s*<.*?>", "", field_maintainer),
license=license_info_to_text(field_license),
# Optional.

View File

@@ -712,6 +712,12 @@ def module_bl_info(mod, *, info_basis=None):
_blender_manual_url_prefix(),
)
# Remove the maintainers email while it's not private, showing prominently
# could cause maintainers to get direct emails instead of issue tracking systems.
import re
if "author" in addon_info:
addon_info["author"] = re.sub(r"\s*<.*?>", "", addon_info["author"])
addon_info["_init"] = None
return addon_info