MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / safe_relpath

Function safe_relpath

Scripts/ButSystem.py:3459–3483  ·  view source on GitHub ↗

safe_relpath. Internal helper function. This docstring was added automatically to improve maintainability. Args: p: Parameter. Returns: Varies.

(p: str)

Source from the content-addressed store, hash-verified

3457 links: Parameter.
3458 extras: Parameter.
3459
3460Returns:
3461 Varies.
3462"""
3463 ensure_profile_row(username)
3464 conn = db_connect()
3465
3466 # Build a safe UPDATE that only touches columns that exist (older DBs)
3467 try:
3468 cols = [r[1] for r in conn.execute("PRAGMA table_info(profiles)").fetchall()]
3469 except Exception:
3470 cols = []
3471
3472 set_parts = ["nickname_enc=?", "bio_enc=?", "links_enc=?"]
3473 params: List[object] = [
3474 aesgcm_encrypt_text(nickname),
3475 aesgcm_encrypt_text(bio),
3476 aesgcm_encrypt_text(json.dumps(links, ensure_ascii=False)),
3477 ]
3478
3479 if extras:
3480 for k, v in extras.items():
3481 if v is None:
3482 v = ""
3483 col = PROFILE_EXTRA_MAP.get(k)
3484 if col and col in cols:
3485 set_parts.append(f"{col}=?")
3486 params.append(aesgcm_encrypt_text(str(v)))

Callers 11

abs_user_pathFunction · 0.70
filesFunction · 0.70
mkdirFunction · 0.70
uploadFunction · 0.70
api_upload_initFunction · 0.70
api_upload_chunkFunction · 0.70
deleteFunction · 0.70
downloadFunction · 0.70
view_fileFunction · 0.70
admin_user_filesFunction · 0.70
admin_user_downloadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected