Skip to content

Conversation

@simonLeary42
Copy link
Collaborator

@simonLeary42 simonLeary42 commented Dec 11, 2025

closes #32

@simonLeary42 simonLeary42 changed the title getURL getURL(), getHyperlink() Dec 12, 2025
@simonLeary42 simonLeary42 requested a review from Copilot December 12, 2025 13:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors URL generation throughout the codebase by introducing two new utility functions: getURL() and getHyperlink(). These functions centralize the logic for constructing URLs with the site's base URL and prefix, replacing direct usage of CONFIG["site"]["prefix"] concatenation. This change makes URL generation more maintainable and consistent across the application.

  • Adds getURL() and getHyperlink() helper functions to resources/lib/utils.php
  • Replaces manual URL construction using CONFIG["site"]["prefix"] throughout webroot, admin, and template files
  • Removes the now-redundant MSG_LINKREF property from UnityMailer and UnityWebhook classes

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
resources/lib/utils.php Added getURL() and getHyperlink() helper functions for centralized URL generation
resources/lib/UnityMailer.php Removed MSG_LINKREF property and its initialization, now using getURL() instead
resources/lib/UnityWebhook.php Removed MSG_LINKREF property and constructor, now using getURL() instead
resources/lib/UnityHTTPD.php Updated redirect logic to use getURL() instead of pathJoin() with prefix
resources/templates/header.php Refactored CSS/JS includes and navigation links to use getURL() and getHyperlink()
resources/templates/footer.php Refactored asset URLs and script includes to use getURL()
resources/mail/*.php Updated all email templates to use getHyperlink() for links
webroot/panel/*.php Updated all panel pages to use getURL() for redirects and form actions
webroot/panel/modal/*.php Updated modal forms and AJAX calls to use getURL()
webroot/admin/*.php Updated admin pages to use getURL() for redirects and AJAX calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simonLeary42 simonLeary42 marked this pull request as ready for review December 12, 2025 13:27
@simonLeary42 simonLeary42 removed the request for review from bryank-cs December 12, 2025 14:28
@simonLeary42 simonLeary42 marked this pull request as draft December 12, 2025 14:28
@simonLeary42 simonLeary42 marked this pull request as ready for review December 12, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combining links should use a smarter method, not string concat

2 participants