-
Notifications
You must be signed in to change notification settings - Fork 11
getURL(), getHyperlink() #385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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()andgetHyperlink()helper functions toresources/lib/utils.php - Replaces manual URL construction using
CONFIG["site"]["prefix"]throughout webroot, admin, and template files - Removes the now-redundant
MSG_LINKREFproperty fromUnityMailerandUnityWebhookclasses
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.
063b8be to
3781c8e
Compare
closes #32