Skip to content

Commit

Permalink
fix(form): bad sharing URL
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Sep 9, 2020
1 parent ba54332 commit 6ea4dff
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inc/form_profile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ public static function showForForm(CommonDBTM $item, $withtemplate = '') {
echo '</td>';
echo '<td>'.__('Link to the form', 'formcreator').': ';
if ($item->fields['is_active']) {
$baseUrl = parse_url($CFG_GLPI['url_base']);
$baseUrl = $baseUrl['scheme'] . '://' . $baseUrl['host'] . ':' . $baseUrl['port'];
$parsedBaseUrl = parse_url($CFG_GLPI['url_base']);
$baseUrl = $parsedBaseUrl['scheme'] . '://' . $parsedBaseUrl['host'];
if (isset($parsedBaseUrl['port'])) {
$baseUrl .= ':' . $parsedBaseUrl['port'];
}
$form_url = $baseUrl . FORMCREATOR_ROOTDOC . '/front/formdisplay.php?id='.$item->getID();
echo '<a href="'.$form_url.'">'.$form_url.'</a>&nbsp;';
echo '<a href="mailto:?subject='.$item->getName().'&body='.$form_url.'" target="_blank">';
Expand Down

0 comments on commit 6ea4dff

Please sign in to comment.