Commit graph

17794 commits

Author SHA1 Message Date
Andre Klapper 1d27fde018 Remove doc references to LiskDAO::loadRelatives()
Summary:
`loadRelatives()` was removed in rP9aa5a52fbd1b4265633df88b337eb95acee9bd85.
Thus remove it from the docs.

Test Plan: None. Optionally, run `./bin/diviner generate`

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25982
2025-04-29 22:59:54 +03:00
Andre Klapper dc32286e4c Correct invalid min-height CSS value
Summary: `min-height: none` is invalid CSS. Assume that `0` was meant instead.

Test Plan:
* Read https://developer.mozilla.org/en-US/docs/Web/CSS/min-height
* Check output on https://jigsaw.w3.org/css-validator/validator
* There is no A/B difference from the page /conference/1/ on mobile.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25973
2025-04-28 23:54:50 +03:00
Andre Klapper bda8034982 Make an IE CSS hack pass W3C CSS validator
Summary:
The W3C CSS validator throws `Value Error : margin-top Too many values or values are not recognized : 1px \9`. It does not complain about `1px\9`.

See https://stackoverflow.com/questions/8004765/what-is-the-meaning-of-9-in-this-width-property-value-declaration, https://stackoverflow.com/questions/18907131/detecting-ie-version-using-css-capability-feature-detection, https://www.w3.org/TR/CSS2/syndata.html#characters

Test Plan: Paste `core.pkg.css` into https://jigsaw.w3.org/css-validator/. Optionally, find some ancient Internet Explorer version and run it (I did not).

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25917
2025-04-28 23:52:23 +03:00
Andre Klapper a52702118e PHPDoc: Correct some param types
Summary: Type in PHPDoc @param versus type in method signature mismatch. Thus correct PHPDoc.

Test Plan: Read the PHPDoc and the signature and compare types.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25977
2025-04-28 23:49:55 +03:00
Andre Klapper 3cf47d2cb6 Remove an unneeded condition in PHUITimelineEventView.php
Summary: Since rP40e9806e3c88500a67d382a5ec07594325f1b000 changing `if ($items || $has_menu)` to `if ($items)`, the ternary operator condition `$items ? 'a' : 'span'` is always true.

Test Plan: Read the code; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25976
2025-04-28 08:31:04 +02:00
Andre Klapper 35e233345c Fix check in PhabricatorMySQLSetupCheck:shouldUseMySQLSearchEngine()
Summary:
Per PHPStan static code analysis, currently
`Instanceof between PhabricatorSearchService and PhabricatorMySQLSearchHost will always evaluate to false`.
Per discussion in the task and per testing, make the check work.

Closes T15891

Test Plan: Probably set up a Phorge instance with recent MariaDB/MySQL, and set up a Phorge instance with ancient DB versions (MySQL 5.6.3 or older; MariaDB 10.0 or older) not supporting FULLTEXT indexes for InnoDB tables?

Reviewers: O1 Blessed Committers, 20after4

Reviewed By: O1 Blessed Committers, 20after4

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15891

Differential Revision: https://we.phorge.it/D25975
2025-04-27 19:11:13 +02:00
Andre Klapper dfe8539c6a Remove IE6/7 non-standard "_zoom" CSS workaround
Summary:
Phorge does not support these browser versions anymore.

Quoting https://css-tricks.com/almanac/properties/z/zoom/: "Many of the rendering bugs in both IE6 and IE7 could be fixed using zoom. [...] Setting zoom: 1 turned on an internal property called hasLayout, which fixed the problem."
See also https://web.archive.org/web/20150906195720/https://developer.mozilla.org/en-US/docs/Web/CSS/zoom

And while `zoom` is recently seeing standardization per https://developer.mozilla.org/en-US/docs/Web/CSS/zoom there still wouldn't be an underscore prefix character.

Test Plan:
Walk up to the library and dive into some dusty books about the wild early days of CSS.

Also, enjoy the conversation about that line using git blame:

https://we.phorge.it/source/phorge/browse/master/webroot/rsrc/css/aphront/typeahead.css;0aa67025f25d30162309d59b4cbe133b6180b2d7$7 - 2011

https://we.phorge.it/source/phorge/browse/master/webroot/rsrc/css/aphront/typeahead.css;7a9d5f8f2de5e44f4014116a47de4ea870361732$7 - 2013

https://we.phorge.it/source/phorge/browse/master/webroot/rsrc/css/aphront/typeahead.css;3cf6f746f0555b4d73d587972d896de99667fb06$7 - 2014

https://we.phorge.it/source/phorge/browse/master/webroot/rsrc/css/aphront/typeahead.css;7aee92b5e95cfc11059e9ff8788e5e53dc88e84d$7 - 2017

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25974
2025-04-25 17:52:11 +02:00
Pppery 4bd591e441 Simplify project regex further
Summary: Fixes T16028

Test Plan:
Assert that `#js-draw-lib` (or any other project name with one or two characters followed by a non-word) links correctly. It was previously parsed as `#js -draw-lib`.

Repeat the test plan for D25838 and observe it still works

Reviewers: aklapper, O1 Blessed Committers, bekay, valerio.bozzolan

Reviewed By: O1 Blessed Committers, bekay, valerio.bozzolan

Subscribers: mainframe98, bekay, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16028

Differential Revision: https://we.phorge.it/D25959
2025-04-25 11:39:04 -04:00
Andre Klapper 7aee92b5e9 Do not create search_documentfield table; update docs
Summary:
Per rP719dd6d3f44245e935b21291a59338a819938c49 and previous rP6cedd4a95cfc23a1679400fb64863c49f24f2306, remove the `search_documentfield` table from initial creation (`quickstart.sql`) and Diviner database docs.

Pointed out in Q82.

Additional context:
MySQL 5.6.4 released 2011-12-20 "now supports FULLTEXT indexes for InnoDB tables" per https://forums.mysql.com/read.php?3,506409 and per https://downloads.mysql.com/docs/mysql-5.6-relnotes-en.pdf pages 230 and 233.
Per https://www.oracle.com/us/support/library/lifetime-support-technology-069183.pdf page 29, "Extended Support Ends" for "MySQL Database 5.6" in "Feb 2021".
MariaDB went for version 10 instead of 5.6 per https://mariadb.org/mariadb-10-0-and-mysql-5-6/; MariaDB 10.0 saw its End of Life date on "31 Mar 2019" per https://mariadb.org/about/#maintenance-policy

Test Plan:
* As an admin, go to `/config/issue/` which triggers `PhabricatorSetupCheck::runNormalChecks()` and thus runs database checks.
* Install a fresh instance of Phorge which runs quickstart.sql, for example setting `"storage.default-namespace": "test"` inside `conf/local/local.json` and see that things still works, like Phriction search by name etc.

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25895
2025-04-25 10:11:40 +02:00
Andre Klapper 7d6c9285c3 Remove vendor-prefixed -moz-transition CSS syntax
Summary:
`-moz-transition` syntax was only supported from Firefox 4 to Firefox 15 according to https://web.archive.org/web/20130827073113/https://developer.mozilla.org/en-US/docs/Web/CSS/transition.

Per https://web.archive.org/web/20130827073113/https://developer.mozilla.org/en-US/docs/Web/CSS/transition and https://caniuse.com/mdn-css_properties_transition, standard `transition` has been supported since Firefox 16 released 08/2012.

Per https://developer.mozilla.org/en-US/docs/Web/CSS/Mozilla_Extensions, `-moz-transition` is not supported anymore and https://developer.mozilla.org/en-US/docs/Web/CSS/transition should be used.

Test Plan: Read CSS docs. Probably install ancient browser versions if you don't trust documentation. Try https://jigsaw.w3.org/css-validator/ and don't spot issues.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25971
2025-04-25 00:12:41 +02:00
Andre Klapper 3fd24004d2 Remove vendor-prefixed background-clip CSS syntax
Summary:
`-moz-background-clip: padding` syntax was only supported until Firefox 3.6 according to https://web.archive.org/web/20130827100732/https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip. Firefox 4.0 released 03/2011 supports standard `background-clip: padding-box`.

The same docs also imply that `-webkit-background-clip: padding-box` currently used by Phorge was never supported by browsers. Per https://caniuse.com/mdn-css_properties_background-clip_padding-box, Chrome 4 released 10/2010 supports standard `background-clip: padding-box`.

Compare current `webroot/rsrc/css/phui/phui-image-mask.css` which does not have this old vendor-prefixed syntax.

Test Plan:
* Open the Conpherence top bar dropdown, select "Persistent Chat", see that its `.jx-scrollbar-handle` based scrollbar still works as expected.
* Read CSS docs. Probably install ancient browser versions if you don't trust documentation. Try https://jigsaw.w3.org/css-validator/ and don't spot issues.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25970
2025-04-24 20:11:10 +02:00
Andre Klapper 367de18e79 Remove orphan CSS rules from phui-timeline-view.css
Summary:
* `.phui-timeline-preview-header` has never been used since introduction in rPdb66cd830d1b.
* Only use of `.phui-timeline-change-details` was removed in direct followup rP4e8e035de006.

Test Plan: Grep the code.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25918
2025-04-24 19:01:17 +02:00
Andre Klapper 3f5f18a8d6 Remove PHP APC support and APC references
Summary:
APC saw its last release in 2012.
It has been discontinued as PHP 5.5+ includes OpCache.
It has been superseded by APCu for object caching.
See https://pecl.php.net/package-info.php?package=APC

Phorge requires PHP 7.2.
Thus remove any references to APC.

Also note that "If APCu is installed, it reports that APC is installed" does not hold true anymore: In PHP 8.3, "php -m" correctly reports "apcu".

Test Plan:
* Make sure APCU is not installed, see `PHP Extension "APCu" Not Installed" under "Unresolved Setup Issues" as an admin
* Apply patch, still see same issue listed.
* Install `php-pecl-apcu` package on Fedora system; see that now the issue is not listed anymore under "Unresolved Setup Issues"

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25950
2025-04-24 17:46:38 +02:00
Andre Klapper e45f29d965 Hide "Audits" section in Email Preferences when uninstalled
Summary:
`PhabricatorEmailPreferencesSettingsPanel::getAllEditorsWithTags()` queries for all classes extending `PhabricatorApplicationTransactionEditor` and having `getMailTagsMap()` to then pull their editor application class. Thus return the correct editor application class.
Followup to rP821708414e.

`grep -r "('PhabricatorApplicationTransactionEditor'" .` shows only a single result in the Phorge codebase (this `PhutilClassMapQuery->setAncestorClass('PhabricatorApplicationTransactionEditor')` call) so I assume there will be no unwanted side effects.

Closes T16002

Test Plan:
* Uninstall Audit on `/applications/view/PhabricatorAuditApplication/`
* Check for `Audits` section on `/settings/panel/emailpreferences/`
* Re-install Audit and try random actions on a commit like: Accept commit, Raise a concern, Change Project Tags, award token, Subscribe, Unsubscribe, Resign as Auditor, no regressions

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16002

Differential Revision: https://we.phorge.it/D25894
2025-04-24 13:10:41 +02:00
Andre Klapper 7ff426a2bd Diviner: Configuring Outbound Mail: Remove incorrect Gmail references
Summary:
Configuring SMTP for Gmail as described will trigger
"535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials"
GMail only supports OAuth and 2FA/App Passwords these days; the "less secure apps" option (which would be needed for the described SMTP setup) has been removed.

Test Plan:
Follow the docs; set up `cluster.mailers` config setting in Phorge; run `./bin/mail send-test --to admin --subject subject < ~/foo` and fail.
Optionally, watch https://www.youtube.com/watch?v=Y_u5KIeXiVI for your personal corporate excitement.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25911
2025-04-24 13:10:10 +02:00
Andre Klapper 372316c998 Fix PHP 8.1 "preg_match(null)" exception for missing User-Agent HTTP Header
Summary:
Passing `null` to `preg_match()` is deprecated behavior since PHP 8.1.
Some clients do not pass a `User-Agent` HTTP header so `$agent` is null.
Thus only call `preg_match()` when `$agent` is set.

```
ERROR 8192: preg_match(): preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated
#0 preg_match(string, NULL) called at [<phorge>/src/view/page/PhabricatorStandardPageView.php:629]
```

Closes T15829

Test Plan: Access a task page etc in a browser which does not set a `User-Agent` HTTP Header string.

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: mainframe98, slip, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15829

Differential Revision: https://we.phorge.it/D25868
2025-04-24 08:08:22 +02:00
Andre Klapper 3acb080f21 Fix invalid CSS cursor value for .phui-oi-grippable
Summary:
The W3C CSS validator throws `Value Error : cursor normal is not a cursor value : normal`.
`normal` is not a valid value for `cursor`; likely `default` was meant.
See https://developer.mozilla.org/en-US/docs/Web/CSS/cursor

Test Plan: Paste `phui-oi-list-view.css` into https://jigsaw.w3.org/css-validator/ and read some CSS docs.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25919
2025-04-24 08:05:19 +02:00
Andre Klapper 403fb8a852 PHPDoc: Fix @return string for methods which can also return null
Summary: Correct docs.

Test Plan: Read the method code, run static code analysis (PHPStan) which complains "should return string but returns null".

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25958
2025-04-24 07:59:11 +02:00
Andre Klapper 6a0e70d716 PHPDoc: Correct marker in one class header
Summary:
This is PHPDoc for a class header. Thus there is no `@param` to pass.
Phorge specific `@task info` was meant here. See other examples in classes.

Test Plan: Read and grep the code.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25954
2025-04-23 16:37:50 +02:00
Andre Klapper e31c3041fa PHPDoc: Replace invalid "obj" with "object"
Summary:
Avoid "has invalid return type obj" errors when running static code analysis (PHPStan).
See https://docs.phpdoc.org/guide/references/phpdoc/types.html

Test Plan: Run PHPStan before and after applying this change (and its corresponding Arcanist change), get 15 errors less.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25952
2025-04-23 16:37:04 +02:00
Andre Klapper cadc00d744 Revert "Fix editing Conpherence rooms on mobile"
Summary:
This reverts commit fd6118bfa6.

Closes T16040

Reopens T15513

Test Plan:
Write text in a Conpherence room and press Enter to send the text.

Test again, as non-participant, on a public chat. Still works.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16040, T15513

Differential Revision: https://we.phorge.it/D25969
2025-04-22 15:16:29 +02:00
Benjamin Kausch 9d52caf19a Disable opening of hovercard if trigger node is inside hovercard
Summary:
If the content of a hovercard contains another hovercard trigger, the initial hovercard will be closed when entering the inside trigger with the mouse. You can see the bug with every differential hovercard which contains reviewers. But there are other cases too: For example if project descriptions use mentions or other project tags.

This fix is pretty easy and returns inside the mousemove handler if the trigger node has a closest ancestor with the class "jx-hovercard-container".

Closes T16029

Test Plan:
See if a hovercard is closed if you enter following inside the hovercard:
- reviewers inside differential hovercard
- people mentions or other project tags inside project hovercard

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16029

Differential Revision: https://we.phorge.it/D25965
2025-04-17 09:55:04 +02:00
mainframe98 bf2dc11947 Replace usages of PhutilProxyException
Summary:
This exception only exists for backwards compatibility with PHP versions
older than 5.3.0.
See https://www.php.net/manual/en/exception.getprevious.php and
https://we.phorge.it/rARC08432f5a24b3ead31c18623785daf5f985c8cfa5

Test Plan: Throw an exception with a nested exception and look at the error page.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15904

Differential Revision: https://we.phorge.it/D25957
2025-04-15 16:45:54 +02:00
Andre Klapper 7a29a6d152 Pass unique CommitterIdentity values to PhabricatorRepositoryIdentityQuery
Summary:
DiffusionCommitQuery passed duplicate CommitterIdentity values to PhabricatorRepositoryIdentityQuery, making logs slightly more noisy.
Thus run `array_unique()` before passing.

Closes T16032

Test Plan: Go to http://phorge.localhost/diffusion/commit/query/all/ and look at SQL query in Dark Console before and after applying patch.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16032

Differential Revision: https://we.phorge.it/D25964
2025-04-14 22:21:13 +02:00
Andre Klapper afd21b8274 Expose time with File upload date
Summary:
Also show the time of a file uploaded, not only the date.
This is consistent for example with exposing the creation time of Maniphest tasks.

Closes T16030

Test Plan: Go to http://phorge.localhost/file/ while logged in and logged out, see that `Uploaded by testadmin on Wed, Apr 9` changed to `Uploaded by user on Wed, Apr 9, 10:48 AM`.

Reviewers: O1 Blessed Committers, mainframe98, valerio.bozzolan

Reviewed By: O1 Blessed Committers, mainframe98, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16030

Differential Revision: https://we.phorge.it/D25961
2025-04-13 23:56:59 +02:00
mainframe98 9c388c65f6 Remove the onboard "mailKey" from Paste
Summary:
See T13065 and rP1e2bc7775bc4.

Intended to cover the gap left by D25899.
The actual amount of impacted installations should
be 0, but the migration makes sure all pastes have
a mail key regardless.

Test Plan:
* Create a paste
* Check `SELECT * FROM phabricator_paste.paste;` and `SELECT * FROM phabricator_metamta.metamta_mailproperties;` on the database
* Run `./bin/storage upgrade`
* Check that the mailKeys have been moved to `mailProperties` in the `phabricator_metamta.metamta_mailproperties` table and the `mailKey` column is gone from the `phabricator_paste.paste` table

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25900
2025-04-13 11:55:55 +02:00
Andre Klapper 08637ce082 Herald Transcripts: Use μs instead of us for microseconds
Summary:
Use Unicode abbreviation `μs` for microseconds instead of ASCII `us` which made me wonder for a while what that is.

`mb_chr` is available since PHP 7.2.0 (which Phorge requires). Entering μ directly makes lint bark about "Bad Charset".

Test Plan:
Go to http://phorge.localhost/herald/transcript/1/profile/ and look at values in the "Cost" column.
Works with PHP 8.3; no clue which prehistoric PHP versions may have problems.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25942
2025-04-13 01:24:19 +02:00
Andre Klapper 4d98c0a455 Replace some AphrontView::setUser() calls with AphrontView::setViewer()
Summary:
See rPaaab1011e5a464ea94c182001a7fe867b19bae5a.
`AphrontView::setUser()` is deprecated.
Save a few CPU cycles and nuclear power plants.

Test Plan:
Read the code.
Even better, intentionally introduce an error in `AphrontView::setUser()`
and browse random Phorge pages and then replace the call accordingly (as
there are numerous `setUser()` methods across the codebase and we don't
want no explosions).

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25880
2025-04-13 00:45:55 +02:00
Benjamin Kausch d3cbfd952e Fix overflowing of AphrontSideNavFilterView on small screens and tidy up nav bar styles
Summary:
Switch the two column layout of AphrontSideNavFilterView (used in pretty much most views) from table to flex display. The former CSS rendering could lead to overflowing of the entire page on small screens if very wide unbreaking content is displayed (example described here: T15809).

While I was at it I have found some unused code. The CSS file `phabricator-nav-view.css` consisted almost only of `.phabricator-side-menu-home` class selectors. This is an ancient class (there at least since 2013) not used anymore:

https://we.phorge.it/source/phorge/browse/master/src/applications/directory/controller/PhabricatorDirectoryController.php;919bd4a03499305093d8882952a9dd3dac1c55a9$169

So I have removed this CSS component and saved the few still used declarations to the main `phui-basic-nav-view.css`.

There was some unused code in `AphrontSideNavFilterView.php` too.

Fixes T15809

Test Plan:
Look at this video to understand the problem:

F2178277

Go in a Task comment and mention a task with a very-long title. Have phd enabled to generate feeds. Visit homepage with feeds:

See that you cannot reproduce anymore.

Browse pages with the right nav bar with many devices and look if the layout looks fine and not broken.

Tested the homepage, scaling from mobile to desktop, using:

- Firefox 124 64bit on GNU/Linux (snap)
- Chromium 124 64bit on GNU/Linux (snap)
- ...

Tested other elements, scaling from mobile to desktop, still working correctly:

- popup dialogs
- right floating menu
- top curtain
    - notifications
    - Conpherence chats
    - unresolved setup issues
    - search omnibox

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15809

Differential Revision: https://we.phorge.it/D25619
2025-04-12 14:12:14 +02:00
Andre Klapper 12991c0d37 Fix overlapping elements in Phame for >1791px width
Summary:
Regression from rP9448e815721c882196b8c541560270734574af8e.

Closes T15985

Test Plan:
For both a viewport width >1791px and below,
* Go to the Phriction wiki page http://phorge.localhost/w/blah which has sections so a table of contents is displayed
* Go to http://phorge.localhost/phame/ and with no blogs visible to the current user or no existing blogposts
* Go to http://phorge.localhost/phame/ with existing/visible blogposts, see no overlap of horizontal lines and Blogs box
* Go to an empty blog at http://phorge.localhost/phame/blog/view/4/
* Go to an existing blogpost at http://phorge.localhost/phame/post/view/1/whatever/
* Go to an existing blogpost at http://phorge.localhost/phame/post/view/1/whatever/ which includes a full width image via `{F1234,size=full}`
* Go to http://phorge.localhost/book/phorge/article/remarkup/
* Go to http://phorge.localhost/w/

Reviewers: O1 Blessed Committers, mturdus, avivey

Reviewed By: O1 Blessed Committers, mturdus, avivey

Subscribers: mturdus, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15985

Differential Revision: https://we.phorge.it/D25873
2025-04-11 10:54:06 +02:00
Merula Turdus 99834dd061 Fix PHP 8.1 "strlen(null)" exception on auth email message body when PhabricatorAuthMessage is unset
Summary:
This is a fix for running Phorge on PHP 8.2+. Other fixes were already merged.

Closes T15536

Test Plan: Unclear.

Reviewers: O1 Blessed Committers, avivey, aklapper

Reviewed By: O1 Blessed Committers, avivey, aklapper

Subscribers: aklapper, avivey, speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Tags: #php_8_support

Maniphest Tasks: T15064, T15536

Differential Revision: https://we.phorge.it/D25256
2025-04-09 09:18:58 +02:00
mainframe98 0f7e76ffe4 Remove support for PHP mysql extension
Summary:
This extension was deprecated in PHP 5.5.0 and removed in PHP 7.0.0.
Given the requirement of PHP 7.2, it makes no sense to support this
extension.

Closes T16024

Test Plan: Grep for both `mysql` and `mysqli` and look for outdated references.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16024

Differential Revision: https://we.phorge.it/D25946
2025-04-08 18:53:59 +02:00
Andre Klapper 75d8c84c13 PHPDoc: Make some parameter types match type in signatures
Summary: For explicitly mentioned Phorge class types in the function signature, use the same type in the PHPDoc for the parameter.

Test Plan: Compare classname type in function signature and in PHPDoc; run static code analysis.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25937
2025-04-08 11:00:33 +02:00
Andre Klapper bf39f021d6 PhabricatorCustomField: Fix a typo in PHPDoc
Summary: Trivial typo fix.

Test Plan: Read slowly.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25941
2025-04-08 11:00:08 +02:00
Andre Klapper ef3e0a75f6 Fix PHP 8.1 "strlen(null)" exception in Feed setting up MFA
Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

```
ERROR 8192: strlen(): Passing null to parameter #1 ($string) of type string is deprecated at [/var/www/html/phorge/phorge/src/applications/auth/xaction/PhabricatorAuthFactorProviderNameTransaction.php:20]
```

Closes T15992

Test Plan: After applying the changes, go to http://phorge.localhost/feed/transactions/ and check the entries related to setting up an MFA provider.

Reviewers: O1 Blessed Committers, slip, avivey

Reviewed By: O1 Blessed Committers, slip, avivey

Subscribers: slip, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15992

Differential Revision: https://we.phorge.it/D25867
2025-04-08 10:59:28 +02:00
Andre Klapper 964b1d4b3d Complete session digest migration from SHA1 to SHA256
Summary:
Followup to 1d34238dc9.
Crossing fingers that nobody complains about a one-time logout after their six year long user session.

Closes T16025

Test Plan:
* Log in, log out, do stuff.
* More specifically, with my session expired, successfully logging in created a database row added to `phabricator_user.phabricator_session` as expected, and logout removed the row.

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16025

Differential Revision: https://we.phorge.it/D25949
2025-04-07 23:46:06 +02:00
Andre Klapper d5ade92fd0 Remove several unused private functions
Summary: These private functions are not called within their class.

Test Plan:
Grep; run static code analysis.

Additionally, this still works:

arc unit src/applications/conpherence/__tests__/ConpherenceRoomTestCase.php

These pages still work:

/conpherence/search/

/differential/

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25933
2025-04-07 22:14:35 +02:00
Andre Klapper 969904e7fa Remove setup check for safe_mode removed in PHP 5.4
Summary:
Phorge requires PHP 7.2 so don't check for stuff removed in PHP 5.4.
See https://www.php.net/releases/5_4_0.php and https://web.archive.org/web/20190217003515/https://php.net/features.safe-mode

Test Plan: Set up Phorge, I'd guess.

Reviewers: O1 Blessed Committers, mainframe98, avivey

Reviewed By: O1 Blessed Committers, mainframe98, avivey

Subscribers: mainframe98, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25947
2025-04-07 22:12:47 +02:00
Andre Klapper adc199eb4a Remove setup check for PHP 7.0
Summary: Phorge requires PHP 7.2 so don't check for PHP 7.0.

Test Plan: Set up Phorge, I guess.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25948
2025-04-05 16:02:54 +02:00
Andre Klapper 17033a1c70 Fix exception handling a numeric git branch ("Call to phutil_nonempty_string() expected null or a string, got: int" in PhabricatorRepository)
Summary:
PHP casts an array key which is a string that contains a decimal integer automatically into int type.
Quoting https://www.php.net/manual/en/language.types.array.php#language.types.array.syntax: "Strings containing valid decimal ints, unless the number is preceded by a + sign, will be cast to the int type."

As we check git branch names via `phutil_nonempty_string($key)`, this throws an exception.
Thus explicitly cast the int to string.

Closes T15640.

Test Plan:
* Have a git repository with a branch whose name consists of digits only and does not start with 0.
* Go to a commit which belongs both to the main/master branch and  such a numeric branch via http://phorge.localhost/diffusion/ABCD/branches/main/;1234567890abcdef1234567890abcdef12345678
* Additionally, visit the commit and see that the "Branches" does not load as it also belongs to a numeric branch.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15640

Differential Revision: https://we.phorge.it/D25945
2025-04-02 15:09:20 +02:00
Andre Klapper def09cf442 PHPDoc: Replace non-existing return type phid with string
Summary:
`phid` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html and https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html.
Thus return `string` and get less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25944
2025-04-02 01:15:03 +02:00
Andre Klapper b302851369 PHPDoc: Replace non-existing param type phid with string
Summary:
`phid` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html.
Thus set the param type to `string` and get a few less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25940
2025-03-31 22:52:42 +02:00
Andre Klapper abb0d6815a PHPDoc: Replace non-existing param type const with string
Summary:
`const` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html and https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html.
Thus set the param type to `string` and get a few less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25938
2025-03-31 22:01:08 +02:00
Cigaryno MD f6639cc09c Update TOTP suggestions to open-source applications
Summary:
Replaces Authy and Google Authenticator, both proprietary with FreeOTP, Bitwarden Authenticator, Aegis, and 2FAS, all free and open-source.
Closes T16018

Test Plan:
- Setup TOTP factor in the Auth app.
- Setup the TOTP factor on your account.
- On both, **double check** the text for any typo or missing app. If any, click on {nav Request Changes}.

Reviewers: O1 Blessed Committers, aklapper

Reviewed By: O1 Blessed Committers, aklapper

Subscribers: aklapper, Cigaryno, tobiaswiese, valerio.bozzolan, Matthew

Tags: #auth, #user-cigaryno

Maniphest Tasks: T16018

Differential Revision: https://we.phorge.it/D25934
2025-03-31 14:53:24 +01:00
Andre Klapper a9c6ea4773 PHPDoc: Replace non-existing return type const with string
Summary:
`const` is not a valid type. See https://docs.phpdoc.org/guide/references/phpdoc/types.html and https://docs.phpdoc.org/guide/references/phpdoc/tags/return.html.
Thus return `string` and get 82 less errors reported by PHPStan.

Test Plan: Read docs; run static code analysis.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25932
2025-03-29 12:38:40 +01:00
xtex a81f20e0f2
Config: Fix git errors when .git does not exist
Summary: Bug: T16023

Test Plan: Delete `.git` and visit `/config/`

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16023

Differential Revision: https://we.phorge.it/D25931
2025-03-28 23:59:40 +08:00
Andre Klapper 06a62b347a Fix invalid CSS overflow value for .phui-oi-name
Summary:
The W3C CSS validator throws `Value Error : overflow normal is not a overflow value : normal`.
`normal` is not a valid value for `overflow`, as browsers currently cannot parse it they fall back to the default `visible`, thus change it to `visible`.
See https://developer.mozilla.org/en-US/docs/Web/CSS/overflow

Test Plan:
Paste `phui-oi-list-view.css` into https://jigsaw.w3.org/css-validator/ and read some CSS docs.

Also, visit a page showing a PHUIObjectItemView, like the /phame/post/ page, and
have a object with a veeeeeery long name, and see absolutely no difference A/B,
both on desktop, medium and small screens.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25921
2025-03-28 11:23:10 +01:00
Andre Klapper 64044ab830 Remove more obsolete IE9 filter CSS syntax
Summary:
Same game as rPe38f5457 but hadn't realized before:
IE5.5 to IE8 released 03/2009 supported the `filter: alpha()` syntax.
(IE8 and IE9 supported `-ms-filter` which was deprecated in IE9 and is unsupported since IE10 released 09/2012.)
See
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532847(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532967(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/ms530752(v=vs.85)
* https://stackoverflow.com/questions/40389599/firefox-declaration-dropped-errors

`filter` is a valid standard CSS3 property unrelated to IE's obsolete `filter: alpha()` syntax.
Standard `filter` does not support `alpha()` per https://developer.mozilla.org/en-US/docs/Web/CSS/filter.
Thus modern browsers throw errors in the console to be avoided by removing this old syntax.

Test Plan: Read the links above, realize it's been 16 years, and agree with me.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25930
2025-03-28 10:57:51 +01:00
Andre Klapper 112174b900 Remove some pre-2013 vendor-prefixed -ms- CSS properties
Summary:
Per https://caniuse.com/ and MDN,
* `-ms-transform` superseded by unprefixed `transform` supported since IE 10 released 09/2012
* `@-ms-keyframes` superseded by unprefixed `@keyframes` supported since IE 10 released 09/2012
* `-ms-transition` superseded by unprefixed `transition` supported since IE 10 released 09/2012

Test Plan: None. Probably installing old browser versions if you don't trust documentation.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25928
2025-03-28 06:57:42 +01:00
Andre Klapper e38f545743 Remove obsolete IE9 filter CSS syntax
Summary:
IE5.5 to IE8 released 03/2009 supported the `filter: progid:DXImageTransform.Microsoft.BasicImage()` syntax.
(IE8 and IE9 supported `-ms-filter` which was deprecated in IE9 and is unsupported since IE10 released 09/2012.)
See
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532847(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms532967(v=vs.85)
* https://learn.microsoft.com/en-us/previous-versions/ms530752(v=vs.85)
* https://stackoverflow.com/a/5705449

`filter` is a valid standard CSS3 property unrelated to IE's obsolete `filter: progid: DXImageTransform.Microsoft.BasicImage()` syntax. Thus modern browsers throw errors in the console to be avoided by removing this old syntax.

Test Plan: Read the links above, realize it's been 16 years, and agree with me.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25929
2025-03-28 06:50:49 +01:00