private static function makeValueUrlsRelative(PersistentObject $object, $valueName, $baseUrl) {
    $value = $object->getValue($valueName);

    // find urls in texts
    $urls = StringUtil::getUrls($value);
    // find direct attribute urls
    if (strpos($value, 'http://') === 0 || strpos($value, 'https://') === 0) {
      $urls[] = $value;
    }
    // process urls
    foreach ($urls as $url) {
      // convert absolute urls matching baseUrl
      $urlConv = $url;
      if (strpos($url, $baseUrl) === 0) {
        $urlConv = str_replace($baseUrl, '', $url);
      }
      // replace url
      $value = str_replace($url, $urlConv, $value);
    }
    $object->setValue($valueName, $value);
  }