mirror of
https://github.com/friendica/friendica
synced 2025-04-28 03:50:17 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
27d94023ee
70 changed files with 27138 additions and 26508 deletions
|
@ -10,17 +10,23 @@ use Friendica\Core\Addon;
|
|||
* Leaflet Map related functions
|
||||
*/
|
||||
class Map {
|
||||
public static function byCoordinates($coord) {
|
||||
public static function byCoordinates($coord, $html_mode = 0) {
|
||||
$coord = trim($coord);
|
||||
$coord = str_replace([',','/',' '],[' ',' ',' '],$coord);
|
||||
$arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => ''];
|
||||
$arr = ['lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'mode' => $html_mode, 'html' => ''];
|
||||
Addon::callHooks('generate_map',$arr);
|
||||
return ($arr['html']) ? $arr['html'] : $coord;
|
||||
}
|
||||
|
||||
public static function byLocation($location) {
|
||||
$arr = ['location' => $location, 'html' => ''];
|
||||
public static function byLocation($location, $html_mode = 0) {
|
||||
$arr = ['location' => $location, 'mode' => $html_mode, 'html' => ''];
|
||||
Addon::callHooks('generate_named_map',$arr);
|
||||
return ($arr['html']) ? $arr['html'] : $location;
|
||||
}
|
||||
|
||||
public static function getCoordinates($location) {
|
||||
$arr = ['location' => $location, 'lat' => false, 'lon' => false];
|
||||
Addon::callHooks('Map::getCoordinates', $arr);
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -217,7 +217,7 @@ class Network
|
|||
|
||||
$newurl = $curl_info['redirect_url'];
|
||||
|
||||
if (($new_location_info['path'] == '') && ( $new_location_info['host'] != '')) {
|
||||
if (($new_location_info['path'] == '') && ($new_location_info['host'] != '')) {
|
||||
$newurl = $new_location_info['scheme'] . '://' . $new_location_info['host'] . $old_location_info['path'];
|
||||
}
|
||||
|
||||
|
@ -229,6 +229,11 @@ class Network
|
|||
if (strpos($newurl, '/') === 0) {
|
||||
$newurl = $old_location_info["scheme"]."://".$old_location_info["host"].$newurl;
|
||||
}
|
||||
$old_location_query = @parse_url($url, PHP_URL_QUERY);
|
||||
|
||||
if ($old_location_query != '') {
|
||||
$newurl .= '?' . $old_location_query;
|
||||
}
|
||||
|
||||
if (filter_var($newurl, FILTER_VALIDATE_URL)) {
|
||||
$redirects++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue