@@ -36,103 +36,103 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | interface IURLGenerator { |
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * Regex for matching http(s) urls |
|
| 41 | - * |
|
| 42 | - * This is a copy of the frontend regex in core/src/OCP/comments.js, make sure to adjust both when changing |
|
| 43 | - * |
|
| 44 | - * @since 25.0.0 |
|
| 45 | - */ |
|
| 46 | - public const URL_REGEX = '/' . self::URL_REGEX_NO_MODIFIERS . '/mi'; |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * Regex for matching http(s) urls (without modifiers for client compatibility) |
|
| 50 | - * |
|
| 51 | - * This is a copy of the frontend regex in core/src/OCP/comments.js, make sure to adjust both when changing |
|
| 52 | - * |
|
| 53 | - * @since 25.0.0 |
|
| 54 | - */ |
|
| 55 | - public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; |
|
| 56 | - |
|
| 57 | - /** |
|
| 58 | - * Returns the URL for a route |
|
| 59 | - * @param string $routeName the name of the route |
|
| 60 | - * @param array $arguments an array with arguments which will be filled into the url |
|
| 61 | - * @return string the url |
|
| 62 | - * @since 6.0.0 |
|
| 63 | - */ |
|
| 64 | - public function linkToRoute(string $routeName, array $arguments = []): string; |
|
| 65 | - |
|
| 66 | - /** |
|
| 67 | - * Returns the absolute URL for a route |
|
| 68 | - * @param string $routeName the name of the route |
|
| 69 | - * @param array $arguments an array with arguments which will be filled into the url |
|
| 70 | - * @return string the absolute url |
|
| 71 | - * @since 8.0.0 |
|
| 72 | - */ |
|
| 73 | - public function linkToRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * @param string $routeName |
|
| 77 | - * @param array $arguments |
|
| 78 | - * @return string |
|
| 79 | - * @since 15.0.0 |
|
| 80 | - */ |
|
| 81 | - public function linkToOCSRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Returns an URL for an image or file |
|
| 85 | - * @param string $appName the name of the app |
|
| 86 | - * @param string $file the name of the file |
|
| 87 | - * @param array $args array with param=>value, will be appended to the returned url |
|
| 88 | - * The value of $args will be urlencoded |
|
| 89 | - * @return string the url |
|
| 90 | - * @since 6.0.0 |
|
| 91 | - */ |
|
| 92 | - public function linkTo(string $appName, string $file, array $args = []): string; |
|
| 93 | - |
|
| 94 | - /** |
|
| 95 | - * Returns the link to an image, like linkTo but only with prepending img/ |
|
| 96 | - * @param string $appName the name of the app |
|
| 97 | - * @param string $file the name of the file |
|
| 98 | - * @return string the url |
|
| 99 | - * @since 6.0.0 |
|
| 100 | - */ |
|
| 101 | - public function imagePath(string $appName, string $file): string; |
|
| 102 | - |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * Makes an URL absolute |
|
| 106 | - * @param string $url the url in the ownCloud host |
|
| 107 | - * @return string the absolute version of the url |
|
| 108 | - * @since 6.0.0 |
|
| 109 | - */ |
|
| 110 | - public function getAbsoluteURL(string $url): string; |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * @param string $key |
|
| 114 | - * @return string url to the online documentation |
|
| 115 | - * @since 8.0.0 |
|
| 116 | - */ |
|
| 117 | - public function linkToDocs(string $key): string; |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * Returns the URL of the default page based on the system configuration |
|
| 121 | - * and the apps visible for the current user |
|
| 122 | - * @return string |
|
| 123 | - * @since 23.0.0 |
|
| 124 | - */ |
|
| 125 | - public function linkToDefaultPageUrl(): string; |
|
| 126 | - |
|
| 127 | - /** |
|
| 128 | - * @return string base url of the current request |
|
| 129 | - * @since 13.0.0 |
|
| 130 | - */ |
|
| 131 | - public function getBaseUrl(): string; |
|
| 132 | - |
|
| 133 | - /** |
|
| 134 | - * @return string webroot part of the base url |
|
| 135 | - * @since 23.0.0 |
|
| 136 | - */ |
|
| 137 | - public function getWebroot(): string; |
|
| 39 | + /** |
|
| 40 | + * Regex for matching http(s) urls |
|
| 41 | + * |
|
| 42 | + * This is a copy of the frontend regex in core/src/OCP/comments.js, make sure to adjust both when changing |
|
| 43 | + * |
|
| 44 | + * @since 25.0.0 |
|
| 45 | + */ |
|
| 46 | + public const URL_REGEX = '/' . self::URL_REGEX_NO_MODIFIERS . '/mi'; |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * Regex for matching http(s) urls (without modifiers for client compatibility) |
|
| 50 | + * |
|
| 51 | + * This is a copy of the frontend regex in core/src/OCP/comments.js, make sure to adjust both when changing |
|
| 52 | + * |
|
| 53 | + * @since 25.0.0 |
|
| 54 | + */ |
|
| 55 | + public const URL_REGEX_NO_MODIFIERS = '(\s|\n|^)(https?:\/\/)((?:[-A-Z0-9+_]+\.)+[-A-Z]+(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|\n|$)'; |
|
| 56 | + |
|
| 57 | + /** |
|
| 58 | + * Returns the URL for a route |
|
| 59 | + * @param string $routeName the name of the route |
|
| 60 | + * @param array $arguments an array with arguments which will be filled into the url |
|
| 61 | + * @return string the url |
|
| 62 | + * @since 6.0.0 |
|
| 63 | + */ |
|
| 64 | + public function linkToRoute(string $routeName, array $arguments = []): string; |
|
| 65 | + |
|
| 66 | + /** |
|
| 67 | + * Returns the absolute URL for a route |
|
| 68 | + * @param string $routeName the name of the route |
|
| 69 | + * @param array $arguments an array with arguments which will be filled into the url |
|
| 70 | + * @return string the absolute url |
|
| 71 | + * @since 8.0.0 |
|
| 72 | + */ |
|
| 73 | + public function linkToRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * @param string $routeName |
|
| 77 | + * @param array $arguments |
|
| 78 | + * @return string |
|
| 79 | + * @since 15.0.0 |
|
| 80 | + */ |
|
| 81 | + public function linkToOCSRouteAbsolute(string $routeName, array $arguments = []): string; |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Returns an URL for an image or file |
|
| 85 | + * @param string $appName the name of the app |
|
| 86 | + * @param string $file the name of the file |
|
| 87 | + * @param array $args array with param=>value, will be appended to the returned url |
|
| 88 | + * The value of $args will be urlencoded |
|
| 89 | + * @return string the url |
|
| 90 | + * @since 6.0.0 |
|
| 91 | + */ |
|
| 92 | + public function linkTo(string $appName, string $file, array $args = []): string; |
|
| 93 | + |
|
| 94 | + /** |
|
| 95 | + * Returns the link to an image, like linkTo but only with prepending img/ |
|
| 96 | + * @param string $appName the name of the app |
|
| 97 | + * @param string $file the name of the file |
|
| 98 | + * @return string the url |
|
| 99 | + * @since 6.0.0 |
|
| 100 | + */ |
|
| 101 | + public function imagePath(string $appName, string $file): string; |
|
| 102 | + |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * Makes an URL absolute |
|
| 106 | + * @param string $url the url in the ownCloud host |
|
| 107 | + * @return string the absolute version of the url |
|
| 108 | + * @since 6.0.0 |
|
| 109 | + */ |
|
| 110 | + public function getAbsoluteURL(string $url): string; |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * @param string $key |
|
| 114 | + * @return string url to the online documentation |
|
| 115 | + * @since 8.0.0 |
|
| 116 | + */ |
|
| 117 | + public function linkToDocs(string $key): string; |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * Returns the URL of the default page based on the system configuration |
|
| 121 | + * and the apps visible for the current user |
|
| 122 | + * @return string |
|
| 123 | + * @since 23.0.0 |
|
| 124 | + */ |
|
| 125 | + public function linkToDefaultPageUrl(): string; |
|
| 126 | + |
|
| 127 | + /** |
|
| 128 | + * @return string base url of the current request |
|
| 129 | + * @since 13.0.0 |
|
| 130 | + */ |
|
| 131 | + public function getBaseUrl(): string; |
|
| 132 | + |
|
| 133 | + /** |
|
| 134 | + * @return string webroot part of the base url |
|
| 135 | + * @since 23.0.0 |
|
| 136 | + */ |
|
| 137 | + public function getWebroot(): string; |
|
| 138 | 138 | } |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | * |
| 44 | 44 | * @since 25.0.0 |
| 45 | 45 | */ |
| 46 | - public const URL_REGEX = '/' . self::URL_REGEX_NO_MODIFIERS . '/mi'; |
|
| 46 | + public const URL_REGEX = '/'.self::URL_REGEX_NO_MODIFIERS.'/mi'; |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * Regex for matching http(s) urls (without modifiers for client compatibility) |
@@ -33,29 +33,29 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | class CoreCapabilities implements ICapability { |
| 35 | 35 | |
| 36 | - /** @var IConfig */ |
|
| 37 | - private $config; |
|
| 36 | + /** @var IConfig */ |
|
| 37 | + private $config; |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @param IConfig $config |
|
| 41 | - */ |
|
| 42 | - public function __construct(IConfig $config) { |
|
| 43 | - $this->config = $config; |
|
| 44 | - } |
|
| 39 | + /** |
|
| 40 | + * @param IConfig $config |
|
| 41 | + */ |
|
| 42 | + public function __construct(IConfig $config) { |
|
| 43 | + $this->config = $config; |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Return this classes capabilities |
|
| 48 | - * |
|
| 49 | - * @return array |
|
| 50 | - */ |
|
| 51 | - public function getCapabilities() { |
|
| 52 | - return [ |
|
| 53 | - 'core' => [ |
|
| 54 | - 'pollinterval' => $this->config->getSystemValue('pollinterval', 60), |
|
| 55 | - 'webdav-root' => $this->config->getSystemValue('webdav-root', 'remote.php/webdav'), |
|
| 56 | - 'reference-api' => true, |
|
| 57 | - 'reference-regex' => IURLGenerator::URL_REGEX_NO_MODIFIERS, |
|
| 58 | - ], |
|
| 59 | - ]; |
|
| 60 | - } |
|
| 46 | + /** |
|
| 47 | + * Return this classes capabilities |
|
| 48 | + * |
|
| 49 | + * @return array |
|
| 50 | + */ |
|
| 51 | + public function getCapabilities() { |
|
| 52 | + return [ |
|
| 53 | + 'core' => [ |
|
| 54 | + 'pollinterval' => $this->config->getSystemValue('pollinterval', 60), |
|
| 55 | + 'webdav-root' => $this->config->getSystemValue('webdav-root', 'remote.php/webdav'), |
|
| 56 | + 'reference-api' => true, |
|
| 57 | + 'reference-regex' => IURLGenerator::URL_REGEX_NO_MODIFIERS, |
|
| 58 | + ], |
|
| 59 | + ]; |
|
| 60 | + } |
|
| 61 | 61 | } |