CityRP Documentation Repository

core.plugins.billboards.sh.zad_url_validation

Zeros AdvertKit URL Validation (Shared). Validates billboard image URLs on both client and server. The host allowlist itself lives in the shared library at gamemode/core/libraries/sh_imagehosts.lua (cityrp.imageHosts); everything here is a thin wrapper so the addon's own call sites keep working.

Functions

zad.f.IsBlankImageURL(url) → booleanSource ☍

Check whether an image URL slot is empty or still carrying the default placeholder. Uses the same normalisation as the image-host allowlist so trailing slashes and scheme casing cannot make a blank white.png panel look like a real advert to the rotation logic.

Parameters

  • urlanyThe URL stored on the sign or submitted from the config UI.

Returns

  1. booleanwhen the slot should be skipped by rotation.
zad.f.URLValidator.GetFetchUrl(id) → string|nilSource ☍

Convert an ID or URL to a full URL.

Parameters

  • idstringA full URL or hostname/path (https:// will be auto-prepended if missing).

Returns

  1. string|nilfull URL to fetch, or nil if invalid.
zad.f.URLValidator.IsAllowedHost(url) → booleanSource ☍

Check if a URL is from an allowed host.

Parameters

  • urlstringThe URL to check.

Returns

  1. booleanif the URL is from an allowed host.
zad.f.URLValidator.ValidateImageURLs(urls) → boolean, string|nilSource ☍

Validate multiple image URLs.

Parameters

  • urlstableArray of URLs to validate.

Returns

  1. 1booleanTrue if all URLs are valid.
  2. 2string|nilError message if validation failed.

Tables

zad.f.URLValidatorSource ☍