2014-11-25 21:43:48 +00:00
|
|
|
<?php
|
2020-09-21 12:25:50 +00:00
|
|
|
/*
|
2024-02-02 18:27:50 +00:00
|
|
|
* Copyright (c) 2020-2024. The Nextcloud Bookmarks contributors.
|
2020-09-21 12:25:50 +00:00
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3 or later. See the COPYING file.
|
|
|
|
*/
|
2014-11-25 21:43:48 +00:00
|
|
|
|
2019-01-27 16:26:08 +00:00
|
|
|
namespace OCA\Bookmarks;
|
2014-11-25 21:43:48 +00:00
|
|
|
|
|
|
|
class Helper {
|
2019-01-27 16:26:08 +00:00
|
|
|
public static function getDomainWithoutExt($name) {
|
2020-09-21 12:17:46 +00:00
|
|
|
$pos = strrpos($name, '.');
|
2014-11-25 21:43:48 +00:00
|
|
|
if ($pos === false) {
|
|
|
|
return $name;
|
|
|
|
}
|
2020-09-21 12:17:46 +00:00
|
|
|
|
|
|
|
return substr($name, 0, $pos);
|
2014-11-25 21:43:48 +00:00
|
|
|
}
|
|
|
|
}
|