Code Duplication    Length = 4-12 lines in 7 locations

calendar/inc/class.boholiday.inc.php 1 location

@@ 271-282 (lines=12) @@
268
				{
269
					$load_from = $GLOBALS['egw_info']['server']['holidays_url_path'];
270
				}
271
				else
272
				{
273
					if ($GLOBALS['egw_info']['server']['webserver_url'][0] == '/')
274
					{
275
						$server_host = ($_SERVER['HTTPS']?'https://':'http://').$_SERVER['HTTP_HOST'].$GLOBALS['egw_info']['server']['webserver_url'];
276
					}
277
					else
278
					{
279
						$server_host = $GLOBALS['egw_info']['server']['webserver_url'];
280
					}
281
					$load_from = $server_host.'/calendar/egroupware.org';
282
				}
283
//				echo 'Loading from: '.$load_from.'/holidays.'.strtoupper($locale).'.csv'."<br>\n";
284
				if($GLOBALS['egw_info']['server']['holidays_url_path'] == 'localhost')
285
				{

etemplate/inc/class.bo_merge.inc.php 2 locations

@@ 339-343 (lines=5) @@
336
					$link = egw::link($link, array());
337
				}
338
				// Prepend site
339
				if ($link{0} == '/')
340
				{
341
					$link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://').
342
						($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link;
343
				}
344
				$title = $style == 'href' ? html::a_href(html::htmlspecialchars($title), $link) : $link;
345
			}
346
			$link_titles[] = $title;
@@ 397-401 (lines=5) @@
394
							$link = egw::link($link, array());
395
						}
396
						// Prepend site
397
						if ($link{0} == '/')
398
						{
399
							$link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://').
400
								($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link;
401
						}
402
						$title = html::a_href(html::htmlspecialchars($title), $link);
403
						$array[($prefix?$prefix.'/':'').$placeholder] = $title;
404
						break;

etemplate/inc/class.bo_tracking.inc.php 1 location

@@ 922-926 (lines=5) @@
919
				$popup = egw_link::is_popup($this->app,'view');
920
			}
921
		}
922
		if ($link[0] == '/')
923
		{
924
			$link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://').
925
				($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link;
926
		}
927
		if (!$allow_popup)
928
		{
929
			// remove the session-id in the notification mail!

filemanager/inc/class.filemanager_merge.inc.php 1 location

@@ 199-203 (lines=5) @@
196
		}
197
198
		// Prepend site, if missing
199
		if ($link{0} == '/')
200
		{
201
			$link = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://').
202
				($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$link;
203
		}
204
		$file['link'] = html::a_href(html::htmlspecialchars($file['name']), $link);
205
		$file['url'] = $link;
206

notifications/inc/class.notifications_email.inc.php 1 location

@@ 150-153 (lines=4) @@
147
			// do not expose sensitive data
148
			$url = preg_replace('/(sessionid|kp3|domain)=[^&]+&?/','',html::link('/index.php', $link->view));
149
			// complete missing protocol and domain part if needed
150
			if ($url{0} == '/' && $_render_external) {
151
				$url = ($_SERVER['HTTPS'] || $GLOBALS['egw_info']['server']['enforce_ssl'] ? 'https://' : 'http://').
152
					($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).$url;
153
			}
154
			$a_href = '<a href="'.$url.'" target="_blank">'.$link->text.'</a>';
155
			$rendered_links[] = $_render_html ? $a_href : $url;
156
		}

calendar/inc/class.calendar_boupdate.inc.php 1 location

@@ 1852-1857 (lines=6) @@
1849
		$eventStart_arr = $this->date2array($event['start']); // give this as 'date' to the link to pick the right recurrence for the participants state
1850
		$link = $GLOBALS['egw_info']['server']['webserver_url'].'/index.php?menuaction=calendar.calendar_uiforms.edit&cal_id='.$event['id'].'&date='.$eventStart_arr['full'].'&no_popup=1';
1851
		// if url is only a path, try guessing the rest ;-)
1852
		if ($link[0] == '/')
1853
		{
1854
			$link = ($GLOBALS['egw_info']['server']['enforce_ssl'] || $_SERVER['HTTPS'] ? 'https://' : 'http://').
1855
				($GLOBALS['egw_info']['server']['hostname'] ? $GLOBALS['egw_info']['server']['hostname'] : $_SERVER['HTTP_HOST']).
1856
				$link;
1857
		}
1858
		$event_arr['link']['data'] = $details['link'] = $link;
1859
1860
		/* this is needed for notification-app