The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
zid.php File Reference

Functions

 is_matrix_url ($url)
 
 zid ($s, $address= '')
 Adds a zid parameter to a url. More...
 
 strip_query_param ($s, $param)
 
 strip_zids ($s)
 
 strip_owt ($s)
 
 strip_zats ($s)
 
 clean_query_string ($s= '')
 
 zidify_callback ($match)
 
 zidify_img_callback ($match)
 
 zidify_links ($s)
 
 zidify_text_callback ($match)
 
 zidify_text_img_callback ($match)
 
 zidify_text ($s)
 
 red_zrl_callback ($matches)
 preg_match function when fixing 'naked' links in mod item.php. More...
 
 red_escape_zrl_callback ($matches)
 
 red_escape_codeblock ($m)
 
 red_unescape_codeblock ($m)
 
 red_zrlify_img_callback ($matches)
 
 owt_init ($token)
 OpenWebAuth authentication. More...
 

Function Documentation

clean_query_string (   $s = '')
owt_init (   $token)

OpenWebAuth authentication.

Parameters
string$token
Hooks:
magic_auth_success Called when a magic-auth was successful.
  • array xchan
  • string url
  • array session

Referenced by Zotlabs\Web\WebServer\run().

red_escape_codeblock (   $m)
red_escape_zrl_callback (   $matches)

If we've got a url or zrl tag with a naked url somewhere in the link text, escape it with quotes unless the naked url is a linked photo.

Parameters
array$matches
Returns
string
red_unescape_codeblock (   $m)
red_zrl_callback (   $matches)

preg_match function when fixing 'naked' links in mod item.php.

Check if we've got a hubloc for the site and use a zrl if we do, a url if we don't. Remove any existing zid= param which may have been pasted by mistake - and will have the author's credentials. zid's are dynamic and can't really be passed around like that.

Parameters
array$matches
Returns
string
red_zrlify_img_callback (   $matches)
strip_owt (   $s)

Referenced by clean_query_string().

strip_query_param (   $s,
  $param 
)
strip_zats (   $s)
zid (   $s,
  $address = '' 
)

Adds a zid parameter to a url.

Parameters
string$sThe url to accept the zid
boolean$address$address to use instead of session environment
Returns
string
Fixme:
checking against our own channel url is no longer reliable. We may have a lot of urls attached to our channel. Should probably match against our site, since we will not need to remote authenticate on our own site anyway.
Hooks:
zid Called when adding the observer's zid to a URL.
  • string url - url to accept zid
  • string zid - urlencoded zid
  • string result - the return string we calculated, change it if you want to return something else

Referenced by advanced_profile(), Zotlabs\Lib\Apps\app_render(), bb_to_markdown_share(), bbcode(), builtin_activity_puller(), conversation(), Zotlabs\Lib\SuperCurl\exec(), format_categories(), format_hashtags(), format_mentions(), Zotlabs\Module\Chanview\get(), Zotlabs\Module\Network\get(), Zotlabs\Module\Chatsvc\get(), Zotlabs\Module\Connedit\get(), get_plink(), get_things(), localize_item(), menu_render(), new_contact(), oembed_fetch_url(), oembed_format_object(), Zotlabs\Lib\Apps\parse_app_description(), prepare_body(), tryzrlaudio(), tryzrlvideo(), vcard_from_xchan(), Zotlabs\Widget\Bookmarkedchats\widget(), Zotlabs\Widget\Suggestedchats\widget(), Zotlabs\Widget\Forums\widget(), Zotlabs\Widget\Photo_rand\widget(), Zotlabs\Widget\Photo\widget(), zidify_callback(), zidify_img_callback(), zidify_text_callback(), and zidify_text_img_callback().

zidify_callback (   $match)

zidify_callback() and zidify_links() work together to turn any HTML a tags with class="zrl" into zid links These will typically be generated by a bbcode '[zrl]' tag. This is done inside prepare_text() rather than bbcode() because the latter is used for general purpose conversions and the former is used only when preparing text for immediate display.

Todo:
Issues: Currently the order of HTML parameters in the text is somewhat rigid and inflexible. We assume it looks like <a class="zrl" href="xxxxxxxxxx"> and will not work if zrl and href appear in a different order.
Parameters
array$match
Returns
string
zidify_img_callback (   $match)
zidify_text (   $s)
zidify_text_callback (   $match)
zidify_text_img_callback (   $match)