<?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
namespace Friendica\Util;
-use Friendica\Core\Config;
use Friendica\DI;
/**
- * @brief Proxy utilities class
+ * Proxy utilities class
*/
class Proxy
{
];
/**
- * @brief Private constructor
+ * Private constructor
*/
private function __construct () {
// No instances from utilities classes
}
/**
- * @brief Transform a remote URL into a local one.
+ * Transform a remote URL into a local one.
*
* This function only performs the URL replacement on http URL and if the
* provided URL isn't local, "the isn't deactivated" (sic) and if the config
}
// Is the proxy disabled?
- if (Config::get('system', 'proxy_disabled')) {
+ if (DI::config()->get('system', 'proxy_disabled')) {
return $url;
}
}
/**
- * @brief "Proxifies" HTML code's image tags
+ * "Proxifies" HTML code's image tags
*
* "Proxifies", means replaces image URLs in given HTML code with those from
* proxy storage directory.
}
/**
- * @brief Checks if the URL is a local URL.
+ * Checks if the URL is a local URL.
*
* @param string $url
* @return boolean
}
/**
- * @brief Return the array of query string parameters from a URL
+ * Return the array of query string parameters from a URL
*
* @param string $url URL to parse
* @return array Associative array of query string parameters
}
/**
- * @brief Call-back method to replace the UR
+ * Call-back method to replace the UR
*
* @param array $matches Matches from preg_replace_callback()
* @return string Proxified HTML image tag