From c1e2f95484dc8fa11c4d7ae2c5d5394e34785ecd Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 26 Feb 2013 18:26:33 -0800 Subject: doc update --- doc/html/text_8php.html | 1320 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 1135 insertions(+), 185 deletions(-) (limited to 'doc/html/text_8php.html') diff --git a/doc/html/text_8php.html b/doc/html/text_8php.html index 6e700f349..d58aa5908 100644 --- a/doc/html/text_8php.html +++ b/doc/html/text_8php.html @@ -113,66 +113,114 @@ $(document).ready(function(){initNavTree('text_8php.html','');}); - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + @@ -246,12 +294,80 @@ Functions

Functions

if(!function_exists('random_string'))
-if(!function_exists('notags'))
-if(!function_exists('escape_tags'))
-if(!function_exists('autoname'))
-if(!function_exists('xmlify'))
-if(!function_exists('unxmlify'))
-if(!function_exists('hex2bin'))
-if(!function_exists('paginate'))
-if(!function_exists('alt_pager'))
-if(!function_exists('expand_acl'))
-if(!function_exists('sanitise_acl'))
-if(!function_exists('perms2str'))
-if(!function_exists('item_message_id'))
-if(!function_exists('photo_new_resource'))
-if(!function_exists('attribute_contains'))
-if(!function_exists('logger'))
-if(!function_exists('dlogger')) 
profiler ($t1, $t2, $label)
 
if(!function_exists('activity_match'))
-if(!function_exists('get_tags'))
-if(!function_exists('qp')) if(!function_exists('get_mentions'))
-if(!function_exists('contact_block')) 
chanlink_hash ($s)
 
 replace_macros ($s, $r)
 
 random_string ($size=64, $type=RANDOM_STRING_HEX)
 
 notags ($string)
 
 escape_tags ($string)
 
 autoname ($len)
 
 xmlify ($str)
 
 unxmlify ($s)
 
 hex2bin ($s)
 
 paginate (&$a)
 
 alt_pager (&$a, $i, $more= '', $less= '')
 
 expand_acl ($s)
 
 sanitise_acl (&$item)
 
 perms2str ($p)
 
 item_message_id ()
 
 photo_new_resource ()
 
 attribute_contains ($attr, $s)
 
 logger ($msg, $level=0)
 
 dlogger ($msg, $level=0)
 
 profiler ($t1, $t2, $label)
 
 activity_match ($haystack, $needle)
 
 get_tags ($s)
 
 qp ($s)
 
 get_mentions ($item, $tags)
 
 contact_block ()
 
 chanlink_hash ($s)
 
 chanlink_url ($s)
 
 chanlink_cid ($d)
 
 magiclink_url ($observer, $myaddr, $url)
 
if(!function_exists('micropro'))
-if(!function_exists('search'))
-if(!function_exists('valid_email'))
-if(!function_exists('linkify')) 
get_poke_verbs ()
 
 micropro ($contact, $redirect=false, $class= '', $textmode=false)
 
 search ($s, $id='search-box', $url='/search', $save=false)
 
 valid_email ($x)
 
 linkify ($s)
 
 get_poke_verbs ()
 
 get_mood_verbs ()
 
if(!function_exists('smilies')) smile_encode ($m)
 
 smilies ($s, $sample=false)
 
 smile_encode ($m)
 
 smile_decode ($m)
 
 preg_heart ($x)
 
if(!function_exists('day_translate'))
-if(!function_exists('normalise_link'))
-if(!function_exists('link_compare'))
-if(!function_exists('prepare_body'))
-if(!function_exists('prepare_text'))
-if(!function_exists('feed_hublinks'))
-if(!function_exists('feed_salmonlinks'))
-if(!function_exists('get_plink'))
-if(!function_exists('unamp'))
-if(!function_exists('lang_selector'))
-if(!function_exists('return_bytes')) 
generate_user_guid ()
 
 day_translate ($s)
 
 normalise_link ($url)
 
 link_compare ($a, $b)
 
 prepare_body ($item, $attach=false)
 
 prepare_text ($text)
 
 feed_hublinks ()
 
 feed_salmonlinks ($nick)
 
 get_plink ($item)
 
 unamp ($s)
 
 lang_selector ()
 
 return_bytes ($size_str)
 
 generate_user_guid ()
 
 base64url_encode ($s, $strip_padding=true)
 
 base64url_decode ($s)
 
if(!function_exists('str_getcsv')) cleardiv ()
 
 str_getcsv ($input, $delimiter= ',', $enclosure= '"', $escape = '\\', $eol = '\n')
 
 cleardiv ()
 
 bb_translate_video ($s)
 
 html2bb_video ($s)
- - + +

Variables

const RANDOM_STRING_HEX (!function_exists('replace_macros')) 0x00
 
const RANDOM_STRING_HEX 0x00
 
const RANDOM_STRING_TEXT 0x01
 

Function Documentation

+ +
+
+ + + + + + + + + + + + + + + + + + +
activity_match ( $haystack,
 $needle 
)
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
alt_pager ($a,
 $i,
 $more = '',
 $less = '' 
)
+
+
@@ -265,10 +381,56 @@ Variables
-

apply xmlify() to all values of array $val, recursively

+

apply xmlify() to all values of array $val, recursively

Referenced by api_apply_template(), and poco_init().

+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
attribute_contains ( $attr,
 $s 
)
+
+ +

Referenced by lrdd().

+ +
+
+ +
+
+ + + + + + + + +
autoname ( $len)
+
+ +

Referenced by check_php(), invite_post(), and lostpass_content().

+
@@ -313,7 +475,7 @@ Variables
-

Referenced by aes_encapsulate(), allowed_public_recips(), atom_entry(), create_identity(), get_item_elements(), get_mail_elements(), get_profile_elements(), identity_basic_export(), import_post(), import_xchan(), magic_init(), oembed_iframe(), post_post(), salmon_key(), smile_encode(), zfinger_init(), zot_build_packet(), zot_fetch(), zot_import(), zot_new_uid(), zot_notify(), zot_register_hub(), and zperms_init().

+

Referenced by aes_encapsulate(), allowed_public_recips(), atom_entry(), create_identity(), get_item_elements(), get_mail_elements(), get_profile_elements(), identity_basic_export(), import_post(), import_xchan(), magic_init(), oembed_iframe(), post_post(), random_string(), salmon_key(), smile_encode(), zfinger_init(), zot_build_packet(), zot_fetch(), zot_import(), zot_new_uid(), zot_notify(), zot_register_hub(), and zperms_init().

@@ -351,12 +513,12 @@ Variables - +
- + @@ -365,7 +527,7 @@ Variables
if (!function_exists('activity_match')) if (!function_exists('get_tags')) if (!function_exists('qp')) if (!function_exists('get_mentions')) if (!function_exists('contact_block')) chanlink_hash chanlink_hash (   $s)
-

Referenced by message_content().

+

Referenced by message_content(), and micropro().

@@ -405,12 +567,12 @@ Variables - +
- + @@ -420,6 +582,139 @@ Variables

Referenced by allfriends_content(), common_content(), match_content(), and suggest_content().

+ + + +
+
+
if (!function_exists('str_getcsv')) cleardiv cleardiv ( )
+ + + + + + +
contact_block ()
+
+ +

Referenced by profile_sidebar().

+ +
+
+ +
+
+ + + + + + + + +
day_translate ( $s)
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
dlogger ( $msg,
 $level = 0 
)
+
+ +
+
+ +
+
+ + + + + + + + +
escape_tags ( $string)
+
+
+ +
+
+ + + + + + + + +
expand_acl ( $s)
+
+
+ +
+
+ + + + + + + +
feed_hublinks ()
+
+

return atom link elements for all of our hubs

+ +

Referenced by get_feed_for().

+ +
+
+ +
+
+ + + + + + + + +
feed_salmonlinks ( $nick)
+
+ +

Referenced by get_feed_for().

+
@@ -718,20 +1013,46 @@ Variables - +
- +
if (!function_exists('day_translate')) if (!function_exists('normalise_link')) if (!function_exists('link_compare')) if (!function_exists('prepare_body')) if (!function_exists('prepare_text')) if (!function_exists('feed_hublinks')) if (!function_exists('feed_salmonlinks')) if (!function_exists('get_plink')) if (!function_exists('unamp')) if (!function_exists('lang_selector')) if (!function_exists('return_bytes')) generate_user_guid generate_user_guid ( )
-

Compare two URLs to see if they are the same, but ignore slight but hopefully insignificant differences such as if one is https and the other isn't, or if one is www.something and the other isn't - and also ignore case differences.

-

Return true if the URLs match, otherwise false. return atom link elements for all of our hubs

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
get_mentions ( $item,
 $tags 
)
+
+ +

Referenced by atom_entry().

@@ -752,20 +1073,36 @@ Variables - + +
+
+ + + + + + + + +
get_plink ( $item)
+
+ +

Referenced by Item\get_template_data().

+ +
+
+
- +
if (!function_exists('micropro')) if (!function_exists('search')) if (!function_exists('valid_email')) if (!function_exists('linkify')) get_poke_verbs get_poke_verbs ( )
-

Function: linkify

-

Replace naked text hyperlink with HTML formatted hyperlink

Referenced by poke_content(), and poke_init().

@@ -799,31 +1136,67 @@ Variables
- +
- + - - - - + - - - - - +
get_terms_oftype get_tags (  $arr,
$s)  $type 
)
+
+ +

Referenced by item_post(), and photos_post().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + +
get_terms_oftype ( $arr,
 $type 
)
-

Referenced by item_getfeedtags(), and tag_deliver().

+

Referenced by item_getfeedtags(), prepare_body(), and tag_deliver().

+ +
+
+ +
+
+ + + + + + + + +
hex2bin ( $s)
+
@@ -832,34 +1205,517 @@ Variables
- + + + + + + +
html2bb_video html2bb_video ( $s)
+
+ +

Referenced by api_statuses_mediap(), api_statuses_update(), and get_atom_elements().

+ +
+ + +
+
+ + + + + + + + + + + + + + + + + + +
ids_to_querystr ( $arr,
 $idx = 'id' 
)
+
+
+ +
+
+ + + + + + + + +
is_a_date_arg ( $s)
+
+
+ +
+
+ + + + + + + +
item_message_id ()
+
+
+ +
+
+ + + + + + + + +
item_post_type ( $item)
+
+ +

Referenced by notification().

+ +
+
+ +
+
+ + + + + + + + +
jindent ( $json)
+
+

Indents a flat JSON string to make it more human-readable.

+
Parameters
+ + +
string$jsonThe original JSON string to process.
+
+
+
Returns
string Indented version of the original JSON string.
+ +
+
+ +
+
+ + + + + + + +
lang_selector ()
+
+ +

Referenced by nav().

+ +
+
+ +
+
+ + + + + + + + +
legal_webbie ( $s)
+
+ +

Referenced by check_webbie(), and new_channel_init().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
link_compare ( $a,
 $b 
)
+
+

Compare two URLs to see if they are the same, but ignore slight but hopefully insignificant differences such as if one is https and the other isn't, or if one is www.something and the other isn't - and also ignore case differences.

+

Return true if the URLs match, otherwise false.

+ +

Referenced by consume_feed(), local_delivery(), tag_deliver(), tgroup_check(), and zid().

+ +
+
+ +
+
+ + + + + + + + +
linkify ( $s)
+
+

Function: linkify

+

Replace naked text hyperlink with HTML formatted hyperlink

+ +

Referenced by advanced_profile().

+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
logger ( $msg,
 $level = 0 
)
+
+ +

Referenced by account_verify_password(), Item\add_child(), Conversation\add_thread(), allowed_public_recips(), api_call(), api_export_basic(), api_favorites(), api_get_user(), api_login(), api_statuses_destroy(), api_statuses_mediap(), api_statuses_repeat(), api_statuses_show(), api_statuses_update(), api_statuses_user_timeline(), authenticate_success(), avatar_img(), base64url_decode(), channel_remove(), chanview_content(), check_config(), check_form_security_token_ForbiddenOnErr(), check_form_security_token_redirectOnErr(), consume_feed(), create_account(), create_identity(), crepair_post(), cronhooks_run(), datetime_convert(), delete_imported_item(), deliver_run(), detect_language(), dfrn_deliver(), directory_content(), directory_run(), email_send(), encode_item(), encode_mail(), expire_run(), feed_init(), fetch_lrdd_template(), fetch_xrd_links(), filer_content(), filerm_content(), fix_private_photos(), Conversation\get_template_data(), group_content(), guess_image_type(), http_status_exit(), import_author_xchan(), import_channel_photo(), import_directory_profile(), import_post(), import_profile_photo(), import_xchan(), item_expire(), item_post(), item_store(), like_content(), load_contact_links(), local_delivery(), FKOAuth1\loginUser(), FKOAuthDataStore\lookup_consumer(), FKOAuthDataStore\lookup_token(), lrdd(), mail_store(), message_content(), message_post(), mini_group_select(), mood_init(), FKOAuthDataStore\new_access_token(), new_contact(), new_keypair(), FKOAuthDataStore\new_request_token(), notification(), notifier_run(), onepoll_run(), parse_url_content(), parse_xml_string(), photo_upload(), photos_post(), ping_init(), poco_init(), poco_load(), poke_init(), poller_run(), post_init(), post_post(), probe_url(), process_delivery(), process_mail_delivery(), process_profile_delivery(), profile_load(), dba\q(), q(), queue_run(), redir_init(), register_content(), Item\remove_child(), remove_queue_item(), scale_external_images(), search_ac_init(), enotify\send(), send_reg_approval_email(), Conversation\set_mode(), subthread_content(), syncdirs(), tag_deliver(), tagger_content(), tgroup_check(), update_imported_item(), update_queue_time(), webfinger(), webfinger_dfrn(), xml2array(), xml_status(), zfinger_init(), zot_build_packet(), zot_fetch(), zot_finger(), zot_gethub(), zot_import(), zot_process_response(), zot_refresh(), and zot_register_hub().

+ +
+
+ +
+
+ + + + + + + + +
magic_link ( $s)
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
magiclink_url ( $observer,
 $myaddr,
 $url 
)
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
micropro ( $contact,
 $redirect = false,
 $class = '',
 $textmode = false 
)
+
+ +

Referenced by contact_block().

+ +
+
+ +
+
+ + + + + + + + +
normalise_link ( $url)
+
+
+ +
+
+ + + + + + + + +
normalise_openid ( $s)
+
+ +
+
+ +
+
+ + + + + + + + +
notags ( $string)
+
+

This is our primary input filter.

+

The high bit hack only involved some old IE browser, forget which (IE5/Mac?) that had an XSS attack vector due to stripping the high-bit on an 8-bit character after cleansing, and angle chars with the high bit set could get through as markup.

+

This is now disabled because it was interfering with some legitimate unicode sequences and hopefully there aren't a lot of those browsers left.

+

Use this on any text input where angle chars are not valid or permitted They will be replaced with safer brackets. This may be filtered further if these are not allowed either.

+ +

Referenced by admin_page_logs_post(), admin_page_site_post(), community_content(), connections_content(), consume_feed(), create_account(), directory_content(), dirfind_content(), follow_init(), get_atom_elements(), group_post(), help_content(), invite_post(), item_post(), item_store(), like_content(), local_delivery(), lostpass_post(), mail_store(), message_post(), mood_init(), network_content(), new_follower(), oexchange_content(), photos_post(), poco_init(), poke_init(), probe_url(), profile_tabs(), profiles_post(), qsearch_init(), register_post(), sanitise_acl(), settings_post(), setup_content(), setup_post(), subthread_content(), tagger_content(), and xrd_init().

+ +
+
+ +
+
+ + + + + + + + +
paginate ($a)
+
+
+ +
+
+ + + + + + + + +
perms2str ( $p)
+
+
+ +
+
+ + + + + + + +
photo_new_resource ()
+
+
+ +
+
+ + + + + + + + +
preg_heart ( $x)
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + +
prepare_body ( $item,
 $attach = false 
)
+
+ +

Referenced by email_send(), and Item\get_template_data().

+ +
+
+ +
+
+ + + - +
prepare_text (  $s)$text)
- +
- + - + - + + + + + + + @@ -869,16 +1725,16 @@ Variables
ids_to_querystr profiler (  $arr, $t1,
 $idx = 'id' $t2,
 $label 
- +
- + @@ -887,107 +1743,97 @@ Variables
is_a_date_arg protect_sprintf (   $s)
- +
- + - +
item_post_type qp (  $item)$s)
-

Referenced by notification().

-
- +
- + - - + -
jindent random_string (  $json)$size = 64,
-
-

Indents a flat JSON string to make it more human-readable.

-
Parameters
- - -
string$jsonThe original JSON string to process.
-
-
-
Returns
string Indented version of the original JSON string.
- -
-
- -
-
- - - + + - + + + + +
legal_webbie (  $s)$type = RANDOM_STRING_HEX 
)
- +
- + - + + + + + + + + + + +
magic_link reltoabs (  $s)$text,
 $base 
)
+

Referenced by get_atom_elements().

+
- +
- + - - - - - - - + - + @@ -997,17 +1843,19 @@ Variables
magiclink_url replace_macros (  $observer,
 $myaddr, $s,
 $url $r 
+

Referenced by admin_content(), admin_page_dbsync(), admin_page_logs(), admin_page_plugins(), admin_page_site(), admin_page_summary(), admin_page_themes(), admin_page_users(), advanced_profile(), allfriends_content(), api_apply_template(), api_content(), apps_content(), App\build_pagehead(), categories_widget(), channel_content(), chanview_content(), check_config(), check_php(), common_content(), common_friends_visitor_widget(), connections_content(), construct_page(), contact_block(), crepair_content(), delegate_content(), directory_content(), dirfind_content(), display_content(), editpost_content(), events_content(), fbrowser_content(), field_timezone(), fileas_widget(), filer_content(), findpeople_widget(), follow_widget(), get_birthdays(), Item\get_comment_box(), get_events(), get_feed_for(), group_content(), group_side(), help_content(), hostxrd_init(), import_content(), intro_content(), invite_content(), lang_selector(), login(), lostpass_content(), lostpass_post(), manage_content(), match_content(), message_aside(), message_content(), micropro(), mini_group_select(), mood_content(), nav(), network_content(), new_channel_content(), new_follower(), nogroup_content(), notification(), notifications_content(), notify_content(), oembed_format_object(), oexchange_init(), opensearch_init(), photos_album_widget(), photos_content(), poco_init(), poke_content(), populate_acl(), posted_date_widget(), profile_sidebar(), profile_tabs(), profiles_content(), redbasic_form(), register_content(), removeme_content(), rmagic_content(), saved_searches(), search_content(), send_reg_approval_email(), send_verification_email(), settings_aside(), setup_content(), setup_post(), siteinfo_content(), suggest_content(), user_allow(), vcard_from_xchan(), viewconnections_content(), and xrd_init().

+
- +
- + - +
normalise_openid return_bytes (  $s)$size_str)
@@ -1015,15 +1863,15 @@ Variables
- +
- + - - + +
preg_heart sanitise_acl ( $x)$item)
@@ -1031,27 +1879,33 @@ Variables
- +
- + - + - + - + + + + + + + @@ -1060,87 +1914,63 @@ Variables
if (!function_exists('random_string')) if (!function_exists('notags')) if (!function_exists('escape_tags')) if (!function_exists('autoname')) if (!function_exists('xmlify')) if (!function_exists('unxmlify')) if (!function_exists('hex2bin')) if (!function_exists('paginate')) if (!function_exists('alt_pager')) if (!function_exists('expand_acl')) if (!function_exists('sanitise_acl')) if (!function_exists('perms2str')) if (!function_exists('item_message_id')) if (!function_exists('photo_new_resource')) if (!function_exists('attribute_contains')) if (!function_exists('logger')) if (!function_exists('dlogger')) profiler search (  $t1, $s,
 $t2, $id = 'search-box',
 $label $url = '/search',
 $save = false 
-

This is our primary input filter.

-

The high bit hack only involved some old IE browser, forget which (IE5/Mac?) that had an XSS attack vector due to stripping the high-bit on an 8-bit character after cleansing, and angle chars with the high bit set could get through as markup.

-

This is now disabled because it was interfering with some legitimate unicode sequences and hopefully there aren't a lot of those browsers left.

-

Use this on any text input where angle chars are not valid or permitted They will be replaced with safer brackets. This may be filtered further if these are not allowed either.

-

Referenced by network_content().

+

Referenced by saved_searches(), and search_content().

- +
- + - +
protect_sprintf smile_decode (  $s)$m)
- +
- + - - - - - - - - - + - -
reltoabs smile_encode (  $text,
 $base 
$m) )
-

Referenced by get_atom_elements().

-
- +
- + - - + -
smile_decode smilies (  $m)$s,
-
- -
-
- -
-
- - - + + - + + + + +
if (!function_exists('smilies')) smile_encode (  $m)$sample = false 
)
@@ -1149,7 +1979,9 @@ Variables

: string $s

Returns string

It is expected that this function will be called using HTML text. We will escape text between HTML pre and code blocks from being processed.

-

At a higher level, the bbcode [nosmile] tag can be used to prevent this function from being executed by the prepare_text() routine when preparing bbcode source for HTML display

+

At a higher level, the bbcode [nosmile] tag can be used to prevent this function from being executed by the prepare_text() routine when preparing bbcode source for HTML display

+ +

Referenced by message_content(), and smilies_content().

@@ -1203,6 +2035,52 @@ Variables

Referenced by filer_content().

+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
str_getcsv ( $input,
 $delimiter = ',',
 $enclosure = '"',
 $escape = '\\',
 $eol = '\n' 
)
+
+ +

Referenced by parse_url_content().

+
@@ -1363,6 +2241,24 @@ Variables

Referenced by network_content().

+ + + +
+
+ + + + + + + + +
unamp ( $s)
+
+ +

Referenced by probe_url().

+
@@ -1381,6 +2277,42 @@ Variables

Referenced by editpost_content().

+ + + +
+
+ + + + + + + + +
unxmlify ( $s)
+
+
+ +
+
+ + + + + + + + +
valid_email ( $x)
+
@@ -1427,15 +2359,33 @@ Variables

Referenced by api_format_items(), api_statuses_home_timeline(), api_statuses_public_timeline(), api_statuses_show(), channel_content(), display_content(), events_content(), network_content(), notification(), notifier_run(), page_content(), ping_init(), search_content(), share_init(), and zot_feed().

+ + + +
+
+ + + + + + + + +
xmlify ( $str)
+

Variable Documentation

- +
- +
const RANDOM_STRING_HEX(!function_exists('replace_macros')) 0x00const RANDOM_STRING_HEX 0x00
@@ -1452,7 +2402,7 @@ Variables
-

Referenced by aes_encapsulate().

+

Referenced by aes_encapsulate(), and random_string().

@@ -1462,7 +2412,7 @@ Variables