X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=include%2Fapi.php;h=8579d2d185b9a6b2c81bbb4a88acb3a4b2160c5a;hb=eb7a86f9ad2d3767469ccb813dc7888fd94ceb95;hp=7011f613d62a49a1cba4e17ec56340eabb57746a;hpb=11cf36105ccd359c9d21a006e13b3767712196b6;p=friendica.git diff --git a/include/api.php b/include/api.php index 7011f613d6..8579d2d185 100644 --- a/include/api.php +++ b/include/api.php @@ -8,10 +8,12 @@ use Friendica\App; use Friendica\Content\ContactSelector; use Friendica\Content\Feature; +use Friendica\Content\Text\BBCode; use Friendica\Core\Addon; use Friendica\Core\System; use Friendica\Core\Config; use Friendica\Core\NotificationsManager; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Core\Worker; use Friendica\Database\DBM; @@ -46,7 +48,6 @@ require_once 'include/html2bbcode.php'; require_once 'mod/wall_upload.php'; require_once 'mod/proxy.php'; require_once 'include/like.php'; -require_once 'include/plaintext.php'; define('API_METHOD_ANY', '*'); define('API_METHOD_GET', 'GET'); @@ -213,10 +214,10 @@ function api_login(App $a) ]; /* - * A plugin indicates successful login by setting 'authenticated' to non-zero value and returning a user record - * Plugins should never set 'authenticated' except to indicate success - as hooks may be chained - * and later plugins should not interfere with an earlier one that succeeded. - */ + * An addon indicates successful login by setting 'authenticated' to non-zero value and returning a user record + * Addons should never set 'authenticated' except to indicate success - as hooks may be chained + * and later addons should not interfere with an earlier one that succeeded. + */ Addon::callHooks('authenticate', $addon_auth); if ($addon_auth['authenticated'] && count($addon_auth['user_record'])) { @@ -1176,8 +1177,8 @@ function api_statuses_update($type) if ($posts_day > $throttle_day) { logger('Daily posting limit reached for user '.api_user(), LOGGER_DEBUG); - // die(api_error($type, sprintf(t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day))); - throw new TooManyRequestsException(sprintf(t("Daily posting limit of %d posts reached. The post was rejected."), $throttle_day)); + // die(api_error($type, L10n::t("Daily posting limit of %d posts reached. The post was rejected.", $throttle_day)); + throw new TooManyRequestsException(L10n::tt("Daily posting limit of %d post reached. The post was rejected.", "Daily posting limit of %d posts reached. The post was rejected.", $throttle_day)); } } @@ -1200,8 +1201,8 @@ function api_statuses_update($type) if ($posts_week > $throttle_week) { logger('Weekly posting limit reached for user '.api_user(), LOGGER_DEBUG); - // die(api_error($type, sprintf(t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week))); - throw new TooManyRequestsException(sprintf(t("Weekly posting limit of %d posts reached. The post was rejected."), $throttle_week)); + // die(api_error($type, L10n::t("Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week))); + throw new TooManyRequestsException(L10n::tt("Weekly posting limit of %d post reached. The post was rejected.", "Weekly posting limit of %d posts reached. The post was rejected.", $throttle_week)); } } @@ -1224,8 +1225,8 @@ function api_statuses_update($type) if ($posts_month > $throttle_month) { logger('Monthly posting limit reached for user '.api_user(), LOGGER_DEBUG); - // die(api_error($type, sprintf(t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month))); - throw new TooManyRequestsException(sprintf(t("Monthly posting limit of %d posts reached. The post was rejected."), $throttle_month)); + // die(api_error($type, L10n::t("Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month)); + throw new TooManyRequestsException(L10n::t("Monthly posting limit of %d post reached. The post was rejected.", "Monthly posting limit of %d posts reached. The post was rejected.", $throttle_month)); } } @@ -4374,7 +4375,7 @@ function api_account_update_profile_image($type) $media = $_FILES['media']; } // save new profile image - $data = save_media_to_database("profileimage", $media, $type, t('Profile Photos'), "", "", "", "", "", $is_default_profile); + $data = save_media_to_database("profileimage", $media, $type, L10n::t('Profile Photos'), "", "", "", "", "", $is_default_profile); // get filetype if (is_array($media['type'])) { @@ -5195,7 +5196,7 @@ function api_clean_plain_items($Text) */ function api_clean_attachments($body) { - $data = get_attachment_data($body); + $data = BBCode::getAttachmentData($body); if (!$data) { return $body;