1
0
Fork 0

Merge pull request #11681 from Quix0r/fixes/item-guidfromuri-allow-null

Allowing Item::getFromUri()'s 2nd parameter a null value
This commit is contained in:
Hypolite Petovan 2022-06-24 10:15:26 -04:00 committed by GitHub
commit c5b46fe748
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 12 deletions

View file

@ -1830,11 +1830,11 @@ class Item
* Posts that are created on this system are using System::createUUID.
* Received ActivityPub posts are using Processor::getGUIDByURL.
*
* @param string $uri uri of an item entry
* @param string $host hostname for the GUID prefix
* @return string unique guid
* @param string $uri uri of an item entry
* @param string|null $host hostname for the GUID prefix
* @return string Unique guid
*/
public static function guidFromUri(string $uri, string $host): string
public static function guidFromUri(string $uri, string $host = null): string
{
// Our regular guid routine is using this kind of prefix as well
// We have to avoid that different routines could accidentally create the same value