maybe this way works better

This commit is contained in:
Matthew Exon 2020-01-10 07:47:08 +01:00
parent e090a286b1
commit b9f048c2a8
2 changed files with 6 additions and 6 deletions

View file

@ -103,7 +103,7 @@ function phototrack_photo_use($photo, $table, $field, $id) {
function phototrack_check_field_url($a, $table, $field, $id, $url) {
Logger::info('@@@ phototrack_check_field_url table ' . $table . ' field ' . $field . ' id ' . $id . ' url ' . $url);
$baseurl = DI::baseUrl();
$baseurl = DI::baseUrl()->get(true);
if (strpos($url, $baseurl) === FALSE) {
return;
}
@ -126,7 +126,7 @@ function phototrack_check_field_url($a, $table, $field, $id, $url) {
}
function phototrack_check_field_bbcode($a, $table, $field, $id, $value) {
$baseurl = DI::baseUrl();
$baseurl = DI::baseUrl()->get(true);
$matches = array();
preg_match_all("/\[img(\=([0-9]*)x([0-9]*))?\](.*?)\[\/img\]/ism", $value, $matches);
foreach ($matches[4] as $url) {

View file

@ -715,7 +715,7 @@ function retrieve_images(&$item) {
if (!$url) {
continue;
}
if (strpos($url, DI::baseUrl()) === FALSE) {
if (strpos($url, DI::baseUrl()->get(true)) === FALSE) {
$resource = add_retriever_resource($url, $item['uid'], $item['contact-id'], true);
if (!$resource['completed']) {
add_retriever_item($item, $resource);
@ -801,7 +801,7 @@ function retriever_transform_images(&$item, $resource) {
return;
}
$photo = Photo::store($image, $uid, $cid, $rid, $filename, $album, 0, 0, "", "", "", "", $desc);
$new_url = DI::baseUrl() . '/photo/' . $rid . '-0.' . $image->getExt();
$new_url = DI::baseUrl()->get(true) . '/photo/' . $rid . '-0.' . $image->getExt();
if (!strlen($new_url)) {
Logger::warning('retriever_transform_images: no replacement URL for image ' . $resource['url']);
return;
@ -827,7 +827,7 @@ function retriever_content($a) {
if ($a->argv[1] === 'help') {
$feeds = DBA::selectToArray('contact', ['id', 'name', 'thumb'], ['uid' => local_user(), 'network' => 'feed']);
for ($i = 0; $i < count($feeds); ++$i) {
$feeds[$i]['url'] = DI::baseUrl() . '/retriever/' . $feeds[$i]['id'];
$feeds[$i]['url'] = DI::baseUrl()->get(true) . '/retriever/' . $feeds[$i]['id'];
}
$template = Renderer::getMarkupTemplate('/help.tpl', 'addon/retriever/');
$a->page['content'] .= Renderer::replaceMacros($template, array(
@ -951,7 +951,7 @@ function retriever_contact_photo_menu($a, &$args) {
return;
}
if ($args["contact"]["network"] == "feed") {
$args["menu"]['retriever'] = array(L10n::t('Retriever'), DI::baseUrl() . '/retriever/' . $args["contact"]['id']);
$args["menu"]['retriever'] = array(L10n::t('Retriever'), DI::baseUrl()->get(true) . '/retriever/' . $args["contact"]['id']);
}
}