use DOMDocument;
use DOMXPath;
use Exception;
-use Friendica\Core\Logger;
use Friendica\Database\DBA;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Psr\Log\LoggerInterface;
* @see initHead()
*
* @param string $path
+ * @throws InternalServerErrorException
*/
public function registerStylesheet($path)
{
* @see initFooter()
*
* @param string $path
+ * @throws InternalServerErrorException
*/
public function registerFooterScript($path)
{
* finally for PWD
*
* @return string
+ * @throws InternalServerErrorException
*/
public function getBasePath()
{
*
* @param bool $ssl Whether to append http or https under SSL_POLICY_SELFSIGN
* @return string Friendica server base URL
+ * @throws InternalServerErrorException
*/
public function getBaseURL($ssl = false)
{
$this->hostname = Core\Config::get('config', 'hostname');
}
- return $scheme . '://' . $this->hostname . !empty($this->getURLPath() ? '/' . $this->getURLPath() : '' );
+ return $scheme . '://' . $this->hostname . (!empty($this->getURLPath()) ? '/' . $this->getURLPath() : '' );
}
/**
* Clears the baseurl cache to prevent inconsistencies
*
* @param string $url
+ * @throws InternalServerErrorException
*/
public function setBaseURL($url)
{
* @param string $origURL
*
* @return string The cleaned url
+ * @throws InternalServerErrorException
*/
public function removeBaseURL($origURL)
{
* Returns the current UserAgent as a String
*
* @return string the UserAgent as a String
+ * @throws InternalServerErrorException
*/
public function getUserAgent()
{
* @brief Checks if the minimal memory is reached
*
* @return bool Is the memory limit reached?
+ * @throws InternalServerErrorException
*/
public function isMinMemoryReached()
{
* @brief Checks if the maximum load is reached
*
* @return bool Is the load reached?
+ * @throws InternalServerErrorException
*/
public function isMaxLoadReached()
{
*
* @param string $command The command to execute
* @param array $args Arguments to pass to the command ( [ 'key' => value, 'key2' => value2, ... ]
+ * @throws InternalServerErrorException
*/
public function proc_run($command, $args)
{
/**
* @brief Checks if a given directory is usable for the system
*
+ * @param $directory
+ * @param bool $check_writable
* @return boolean the directory is usable
+ * @throws Exception
*/
public static function isDirectoryUsable($directory, $check_writable = true)
{
* Generates the site's default sender email address
*
* @return string
+ * @throws InternalServerErrorException
*/
public function getSenderEmailAddress()
{
* Returns the current theme name.
*
* @return string the name of the current theme
+ * @throws InternalServerErrorException
*/
public function getCurrentTheme()
{
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string
+ * @throws InternalServerErrorException
*/
public function getCurrentThemeStylesheetPath()
{
// And then append it to the target
$target->documentElement->appendChild($item);
}
- }
- if (isset($_GET["mode"]) && ($_GET["mode"] == "raw")) {
- header("Content-type: text/html; charset=utf-8");
+ if ($_GET["mode"] == "raw") {
+ header("Content-type: text/html; charset=utf-8");
- echo substr($target->saveHTML(), 6, -8);
+ echo substr($target->saveHTML(), 6, -8);
- exit();
+ exit();
+ }
}
$page = $this->page;
* Should only be used if it isn't clear if the URL is either internal or external
*
* @param string $toUrl The target URL
- *
+ * @throws InternalServerErrorException
*/
public function redirect($toUrl)
{