Repository navigation
Optional url-highlight 4.x for links in text; announcement date checks
Links in text: url-highlight 4.x, optional
htmlify(), which turns URLs and email addresses in commit messages and port descriptions into links, can now use url-highlight 4.x from the new www/php-url-highlight package. It is off by default. To turn it on, set this in constants.local.php:
define('HTMLIFY_USE_URL_HIGHLIGHT_PORT', true);It takes precedence over HTMLIFY_USE_URL_HIGHLIGHT and HTMLIFY_USE_LIB_AUTOLINK. (00ebd04)
Compared with the existing code:
- Email addresses are linked, e.g.
Reported by: … <user@example.org>. - A URL which contains an email address is one link. The old regex code nested broken
mailto:links inside the href. &in a link's href is escaped as&.- Links keep
REL="NOFOLLOW"(not on email links) and theURL2LINK_CUTOFF_LEVELshortening of the visible text. - Only URLs with a scheme, and email addresses, are linked. 4.x also matches bare names by top-level domain, which turned file names such as
setup.py,svn_load_dirs.plandpatch-Makefile.ininto links. (996cac8)
Callers already escape text with _forDisplay(), so it is passed to 4.x as HTML-encoded and not escaped again.
htmlify() takes an optional third argument which forces the 4.x path on or off.
Test pages
/htmlify-test.phpalways uses the existing code./htmlify-test-port.phpis new, and always uses 4.x.
Each links to the other.
Announcements
The announcement editor checks the start and end dates before saving. (c9af79a)
- The date fields are
datetime-localinputs. - An invalid date, or an end date before the start date, redisplays the announcement with an error, instead of the raw SQL error from PostgreSQL. A bare time such as
20:51used to cause that error.
Upgrading
- New dependency:
php85-url-highlight(www/php-url-highlight), installed in/usr/local/share/pear/VStelmakh/UrlHighlight/. It is needed only ifHTMLIFY_USE_URL_HIGHLIGHT_PORTis on. With the switch on and the package missing, pages which link text fail with a fatal error. - Configuration:
constants.local.php.sampledocumentsHTMLIFY_USE_URL_HIGHLIGHT_PORTandURL_HIGHLIGHT_PORT_DIR. The second is needed only if the package is installed somewhere else. - Database: no changes.
- nginx: no changes.
- Translations: no new strings.
- Files added:
www/htmlify-test-port.php
- Files deleted or renamed: none.
The 3.0.1 copy in vendor/ stays for now, because the HTMLIFY_USE_URL_HIGHLIGHT path still uses it.
Full Changelog: 2.16.21...2.16.22