• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP escape_tags函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中escape_tags函数的典型用法代码示例。如果您正苦于以下问题:PHP escape_tags函数的具体用法?PHP escape_tags怎么用?PHP escape_tags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了escape_tags函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: appman_post

function appman_post(&$a)
{
    if (!local_user()) {
        return;
    }
    if ($_POST['url']) {
        $arr = array('uid' => intval($_REQUEST['uid']), 'url' => escape_tags($_REQUEST['url']), 'guid' => escape_tags($_REQUEST['guid']), 'author' => escape_tags($_REQUEST['author']), 'addr' => escape_tags($_REQUEST['addr']), 'name' => escape_tags($_REQUEST['name']), 'desc' => escape_tags($_REQUEST['desc']), 'photo' => escape_tags($_REQUEST['photo']), 'version' => escape_tags($_REQUEST['version']), 'price' => escape_tags($_REQUEST['price']), 'sig' => escape_tags($_REQUEST['sig']));
        $_REQUEST['appid'] = app_install(local_user(), $arr);
        if (app_installed(local_user(), $arr)) {
            info(t('App installed.') . EOL);
        }
        return;
    }
    $papp = app_decode($_POST['papp']);
    if (!is_array($papp)) {
        notice(t('Malformed app.') . EOL);
        return;
    }
    if ($_POST['install']) {
        app_install(local_user(), $papp);
        if (app_installed(local_user(), $papp)) {
            info(t('App installed.') . EOL);
        }
    }
    if ($_POST['delete']) {
        app_destroy(local_user(), $papp);
    }
    if ($_POST['edit']) {
        return;
    }
    if ($_SESSION['return_url']) {
        goaway(z_root() . '/' . $_SESSION['return_url']);
    }
    goaway(z_root() . '/apps/personal');
}
开发者ID:Mauru,项目名称:red,代码行数:35,代码来源:appman.php


示例2: feed_init

function feed_init(&$a)
{
    $params = array();
    $params['begin'] = x($_REQUEST, 'date_begin') ? $_REQUEST['date_begin'] : NULL_DATE;
    $params['end'] = x($_REQUEST, 'date_end') ? $_REQUEST['date_end'] : '';
    $params['type'] = stristr(argv(0), 'json') ? 'json' : 'xml';
    $params['pages'] = x($_REQUEST, 'pages') ? intval($_REQUEST['pages']) : 0;
    $params['top'] = x($_REQUEST, 'top') ? intval($_REQUEST['top']) : 0;
    $params['start'] = x($params, 'start') ? intval($params['start']) : 0;
    $params['records'] = x($params, 'records') ? intval($params['records']) : 40;
    $params['direction'] = x($params, 'direction') ? dbesc($params['direction']) : 'desc';
    $params['cat'] = x($_REQUEST, 'cat') ? escape_tags($_REQUEST['cat']) : '';
    $channel = '';
    if (argc() > 1) {
        $r = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_address = '%s' limit 1", dbesc(argv(1)));
        if (!($r && count($r))) {
            killme();
        }
        $channel = $r[0];
        if (intval(get_config('system', 'block_public')) && !get_account_id()) {
            killme();
        }
        logger('mod_feed: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $channel['channel_address']);
        echo get_public_feed($channel, $params);
        killme();
    }
}
开发者ID:royalterra,项目名称:hubzilla,代码行数:27,代码来源:feed.php


示例3: wallmessage_content

function wallmessage_content(&$a)
{
    if (!get_my_url()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $recipient = $a->argc > 1 ? $a->argv[1] : '';
    if (!$recipient) {
        notice(t('No recipient.') . EOL);
        return;
    }
    $r = q("select * from user where nickname = '%s' limit 1", dbesc($recipient));
    if (!count($r)) {
        notice(t('No recipient.') . EOL);
        logger('wallmessage: no recipient');
        return;
    }
    $user = $r[0];
    if (!intval($user['unkmail'])) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $r = q("select count(*) as total from mail where uid = %d and created > UTC_TIMESTAMP() - INTERVAL 1 day and unknown = 1", intval($user['uid']));
    if ($r[0]['total'] > $user['cntunkmail']) {
        notice(sprintf(t('Number of daily wall messages for %s exceeded. Message failed.', $user['username'])));
        return;
    }
    $tpl = get_markup_template('wallmsg-header.tpl');
    $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl(true), '$editselect' => '/(profile-jot-text|prvmail-text)/', '$nickname' => $user['nickname'], '$linkurl' => t('Please enter a link URL:')));
    $tpl = get_markup_template('wallmessage.tpl');
    $o .= replace_macros($tpl, array('$header' => t('Send Private Message'), '$subheader' => sprintf(t('If you wish for %s to respond, please check that the privacy settings on your site allow private mail from unknown senders.'), $user['username']), '$to' => t('To:'), '$subject' => t('Subject:'), '$recipname' => $user['username'], '$nickname' => $user['nickname'], '$subjtxt' => x($_REQUEST, 'subject') ? strip_tags($_REQUEST['subject']) : '', '$text' => x($_REQUEST, 'body') ? escape_tags(htmlspecialchars($_REQUEST['body'])) : '', '$readonly' => '', '$yourmessage' => t('Your message:'), '$select' => $select, '$parent' => '', '$upload' => t('Upload photo'), '$insert' => t('Insert web link'), '$wait' => t('Please wait')));
    return $o;
}
开发者ID:robhell,项目名称:friendica,代码行数:33,代码来源:wallmessage.php


示例4: notes_init

/** @file */
function notes_init(&$a)
{
    if (!local_channel()) {
        return;
    }
    $ret = array('success' => true);
    if (array_key_exists('note_text', $_REQUEST)) {
        $body = escape_tags($_REQUEST['note_text']);
        // I've had my notes vanish into thin air twice in four years.
        // Provide a backup copy if there were contents previously
        // and there are none being saved now.
        if (!$body) {
            $old_text = get_pconfig(local_channel(), 'notes', 'text');
            if ($old_text) {
                set_pconfig(local_channel(), 'notes', 'text.bak', $old_text);
            }
        }
        set_pconfig(local_channel(), 'notes', 'text', $body);
    }
    // push updates to channel clones
    if (argc() > 1 && argv(1) === 'sync') {
        require_once 'include/zot.php';
        build_sync_packet();
    }
    logger('notes saved.', LOGGER_DEBUG);
    json_return_and_die($ret);
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:28,代码来源:notes.php


示例5: get

 function get()
 {
     if (argc() == 2 && argv(1) == 'edit') {
         $mode = 'edit';
     } else {
         $mode = 'list';
     }
     $_SESSION['return_url'] = \App::$cmd;
     $apps = array();
     if (local_channel()) {
         import_system_apps();
         $syslist = array();
         $list = app_list(local_channel(), false, $_GET['cat']);
         if ($list) {
             foreach ($list as $x) {
                 $syslist[] = app_encode($x);
             }
         }
         translate_system_apps($syslist);
     } else {
         $syslist = get_system_apps(true);
     }
     usort($syslist, 'app_name_compare');
     //	logger('apps: ' . print_r($syslist,true));
     foreach ($syslist as $app) {
         $apps[] = app_render($app, $mode);
     }
     return replace_macros(get_markup_template('myapps.tpl'), array('$sitename' => get_config('system', 'sitename'), '$cat' => array_key_exists('cat', $_GET) && $_GET['cat'] ? ' - ' . escape_tags($_GET['cat']) : '', '$title' => t('Apps'), '$apps' => $apps));
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:29,代码来源:Apps.php


示例6: post

 function post()
 {
     if (!local_channel()) {
         return;
     }
     if ($_POST['url']) {
         $arr = array('uid' => intval($_REQUEST['uid']), 'url' => escape_tags($_REQUEST['url']), 'guid' => escape_tags($_REQUEST['guid']), 'author' => escape_tags($_REQUEST['author']), 'addr' => escape_tags($_REQUEST['addr']), 'name' => escape_tags($_REQUEST['name']), 'desc' => escape_tags($_REQUEST['desc']), 'photo' => escape_tags($_REQUEST['photo']), 'version' => escape_tags($_REQUEST['version']), 'price' => escape_tags($_REQUEST['price']), 'requires' => escape_tags($_REQUEST['requires']), 'system' => intval($_REQUEST['system']), 'sig' => escape_tags($_REQUEST['sig']), 'categories' => escape_tags($_REQUEST['categories']));
         $_REQUEST['appid'] = Zlib\Apps::app_install(local_channel(), $arr);
         if (Zlib\Apps::app_installed(local_channel(), $arr)) {
             info(t('App installed.') . EOL);
         }
         return;
     }
     $papp = Zlib\Apps::app_decode($_POST['papp']);
     if (!is_array($papp)) {
         notice(t('Malformed app.') . EOL);
         return;
     }
     if ($_POST['install']) {
         Zlib\Apps::app_install(local_channel(), $papp);
         if (Zlib\Apps::app_installed(local_channel(), $papp)) {
             info(t('App installed.') . EOL);
         }
     }
     if ($_POST['delete']) {
         Zlib\Apps::app_destroy(local_channel(), $papp);
     }
     if ($_POST['edit']) {
         return;
     }
     if ($_SESSION['return_url']) {
         goaway(z_root() . '/' . $_SESSION['return_url']);
     }
     goaway(z_root() . '/apps');
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:35,代码来源:Appman.php


示例7: message_post

function message_post(&$a)
{
    if (!local_user()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    $replyto = x($_POST, 'replyto') ? notags(trim($_POST['replyto'])) : '';
    $subject = x($_POST, 'subject') ? notags(trim($_POST['subject'])) : '';
    $body = x($_POST, 'body') ? escape_tags(trim($_POST['body'])) : '';
    $recipient = x($_POST, 'messageto') ? intval($_POST['messageto']) : 0;
    $ret = send_message($recipient, $body, $subject, $replyto);
    switch ($ret) {
        case -1:
            notice(t('No recipient selected.') . EOL);
            break;
        case -2:
            notice(t('Unable to locate contact information.') . EOL);
            break;
        case -3:
            notice(t('Message could not be sent.') . EOL);
            break;
        case -4:
            notice(t('Message collection failure.') . EOL);
            break;
        default:
            info(t('Message sent.') . EOL);
    }
}
开发者ID:nextgensh,项目名称:friendica,代码行数:28,代码来源:message.php


示例8: lsearch_init

function lsearch_init(&$a)
{
    $perpage = $_REQUEST['n'] ? $_REQUEST['n'] : 80;
    $page = $_REQUEST['p'] ? intval($_REQUEST['p'] - 1) : 0;
    $startrec = ($page + 1) * $perpage - $perpage;
    $search = trim($_REQUEST['search']);
    if (!strlen($search)) {
        killme();
    }
    if ($search) {
        $search = dbesc(escape_tags($search));
    }
    $sql_extra = strlen($search) ? " AND ( `name` REGEXP '{$search}' OR `homepage` REGEXP '{$search}' OR `tags` REGEXP '{$search}' \n\t\tor `region` REGEXP '{$search}' or `country-name` regexp '{$search}' ) " : "";
    $r = q("SELECT COUNT(*) AS `total` FROM `profile` WHERE 1 {$sql_extra} ");
    if (count($r)) {
        $total = $r[0]['total'];
    }
    $r = q("SELECT * FROM `profile` WHERE 1 {$sql_extra} ORDER BY `name` ASC LIMIT %d, %d ", intval($startrec), intval($perpage));
    $results = array();
    if (count($r)) {
        foreach ($r as $rr) {
            $results[] = array('name' => $rr['name'], 'url' => $rr['homepage'], 'photo' => $a->get_baseurl() . '/photo/' . $rr['id'], 'tags' => $rr['tags']);
        }
    }
    $output = array('total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results);
    echo json_encode($output);
    killme();
}
开发者ID:silke,项目名称:dir,代码行数:28,代码来源:lsearch.php


示例9: get

 /**
  * @brief Logs admin page.
  *
  * @return string
  */
 function get()
 {
     $log_choices = array(LOGGER_NORMAL => 'Normal', LOGGER_TRACE => 'Trace', LOGGER_DEBUG => 'Debug', LOGGER_DATA => 'Data', LOGGER_ALL => 'All');
     $t = get_markup_template('admin_logs.tpl');
     $f = get_config('system', 'logfile');
     $data = '';
     if (!file_exists($f)) {
         $data = t("Error trying to open <strong>{$f}</strong> log file.\r\n<br/>Check to see if file {$f} exist and is \n\treadable.");
     } else {
         $fp = fopen($f, 'r');
         if (!$fp) {
             $data = t("Couldn't open <strong>{$f}</strong> log file.\r\n<br/>Check to see if file {$f} is readable.");
         } else {
             $fstat = fstat($fp);
             $size = $fstat['size'];
             if ($size != 0) {
                 if ($size > 5000000 || $size < 0) {
                     $size = 5000000;
                 }
                 $seek = fseek($fp, 0 - $size, SEEK_END);
                 if ($seek === 0) {
                     $data = escape_tags(fread($fp, $size));
                     while (!feof($fp)) {
                         $data .= escape_tags(fread($fp, 4096));
                     }
                 }
             }
             fclose($fp);
         }
     }
     return replace_macros($t, array('$title' => t('Administration'), '$page' => t('Logs'), '$submit' => t('Submit'), '$clear' => t('Clear'), '$data' => $data, '$baseurl' => z_root(), '$logname' => get_config('system', 'logfile'), '$debugging' => array('debugging', t("Debugging"), get_config('system', 'debugging'), ""), '$logfile' => array('logfile', t("Log file"), get_config('system', 'logfile'), t("Must be writable by web server. Relative to your top-level webserver directory.")), '$loglevel' => array('loglevel', t("Log level"), get_config('system', 'loglevel'), "", $log_choices), '$form_security_token' => get_form_security_token('admin_logs')));
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:37,代码来源:Logs.php


示例10: post

 function post()
 {
     if (!local_channel()) {
         return;
     }
     if (\App::$argc != 2) {
         return;
     }
     $contact_id = intval(\App::$argv[1]);
     $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($contact_id), intval(local_channel()));
     if (!count($r)) {
         notice(t('Contact not found.') . EOL);
         return;
     }
     $contact = $r[0];
     $new_contact = intval($_POST['suggest']);
     $hash = random_string();
     $note = escape_tags(trim($_POST['note']));
     if ($new_contact) {
         $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($new_contact), intval(local_channel()));
         if (count($r)) {
             $x = q("INSERT INTO `fsuggest` ( `uid`,`cid`,`name`,`url`,`request`,`photo`,`note`,`created`)\n\t\t\t\t\tVALUES ( %d, %d, '%s','%s','%s','%s','%s','%s')", intval(local_channel()), intval($contact_id), dbesc($r[0]['name']), dbesc($r[0]['url']), dbesc($r[0]['request']), dbesc($r[0]['photo']), dbesc($hash), dbesc(datetime_convert()));
             $r = q("SELECT `id` FROM `fsuggest` WHERE `note` = '%s' AND `uid` = %d LIMIT 1", dbesc($hash), intval(local_channel()));
             if (count($r)) {
                 $fsuggest_id = $r[0]['id'];
                 q("UPDATE `fsuggest` SET `note` = '%s' WHERE `id` = %d AND `uid` = %d", dbesc($note), intval($fsuggest_id), intval(local_channel()));
                 proc_run('php', 'include/notifier.php', 'suggest', $fsuggest_id);
             }
             info(t('Friend suggestion sent.') . EOL);
         }
     }
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:32,代码来源:Fsuggest.php


示例11: pre_output

 /**
  * Pre-Ouput content
  *
  * @access 	public
  * @return 	string
  */
 public function pre_output($input, $params)
 {
     $parse_tags = !isset($params['allow_tags']) ? 'n' : $params['allow_tags'];
     $content_type = !isset($params['content_type']) ? 'html' : $params['content_type'];
     // If this is the admin, show only the source
     // @TODO This is hacky, there will be times when the admin wants to see a preview or something
     if (defined('ADMIN_THEME')) {
         return $input;
     }
     // If this isn't the admin and we want to allow tags,
     // let it through. Otherwise we will escape them.
     if ($parse_tags == 'y') {
         $content = $this->CI->parser->parse_string($input, array(), true);
     } else {
         $this->CI->load->helper('text');
         $content = escape_tags($input);
     }
     // Not that we know what content is there, what format should we treat is as?
     switch ($content_type) {
         case 'md':
             $this->CI->load->helper('markdown');
             return parse_markdown($content);
         case 'html':
             return $content;
         default:
             return strip_tags($content);
     }
 }
开发者ID:nockout,项目名称:tshpro,代码行数:34,代码来源:field.textarea.php


示例12: testEscapeTags

 /**
  * test, that tags are escaped
  */
 public function testEscapeTags()
 {
     $invalidstring = '<submit type="button" onclick="alert(\'failed!\');" />';
     $validstring = notags($invalidstring);
     $escapedString = escape_tags($invalidstring);
     $this->assertEquals('[submit type="button" onclick="alert(\'failed!\');" /]', $validstring);
     $this->assertEquals("&lt;submit type=&quot;button&quot; onclick=&quot;alert('failed!');&quot; /&gt;", $escapedString);
 }
开发者ID:TamirAl,项目名称:hubzilla,代码行数:11,代码来源:xss_filter_test.php


示例13: pre_output

 /**
  * Process before outputting
  *
  * @access	public
  * @param	array
  * @return	string
  */
 public function pre_output($input)
 {
     $this->CI->load->library('encrypt');
     $out = $this->CI->encrypt->decode($input);
     // No PyroCMS tags in your ouput!
     $this->CI->load->helper('text');
     return escape_tags($out);
 }
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:15,代码来源:field.encrypt.php


示例14: display_comments

/**
 * Function to display a comment
 * 
 * Reference is a actually an object reference, a.k.a. categorization of the comments table rows.
 * The reference id is a further categorization on this. (For example, for example for 
 *
 * @param	int		$ref_id		The id of the collection of the reference object of the comment (I guess?)
 * @param	bool	$reference	A module or other reference to pick comments for
 * @return	void
 */
function display_comments($ref_id = '', $reference = NULL)
{
	if ( ! (Settings::get('enable_comments') && $ref_id))
	{
		return;
	}

	$ci =& get_instance();
	
	// Set ref to module if none provided
	$reference OR $reference = $ci->router->fetch_module();

	$ci->lang->load('comments/comments');
	$ci->load->model('comments/comments_m');

	$comments	= $ci->comments_m->get_by_module_item($reference, $ref_id);
	
	// loop through the comments and escape {pyro} and html tags
	foreach ($comments as &$comment)
	{
		foreach ($comment as &$body)
		{
			$body = escape_tags($body);
		}
	}

	// set the data to send to the view
	$data['comments']	=	$comments;
	$data['module']		=	$reference;
	$data['id']			=	$ref_id;
	$data['comment']	=	$ci->session->flashdata('comment');

	/**
	 * The following allows us to load views
	 * without breaking theme overloading
	 **/
	$view = 'comments';
	
	if (file_exists($ci->template->get_views_path() . 'modules/comments/' . $view . (pathinfo($view, PATHINFO_EXTENSION) ? '' : EXT)))
	{
		// look in the theme for overloaded views
		$path = $ci->template->get_views_path() . 'modules/comments/';
	}
	else
	{
		// or look in the module
		list($path, $view) = Modules::find($view, 'comments', 'views/');
	}
	
	$save_path = $ci->load->_ci_view_path;
	$ci->load->_ci_view_path = $path;

	// output the comments html
	$comment_view = $ci->load->_ci_load(array('_ci_view' => $view, '_ci_vars' => ( $data )));

	// Put the path back
	$ci->load->_ci_view_path = $save_path;
}
开发者ID:JamieLomas,项目名称:pyrocms,代码行数:68,代码来源:comments_helper.php


示例15: tasks_post

function tasks_post(&$a)
{
    //	logger('post: ' . print_r($_POST,true));
    if (!local_channel()) {
        return;
    }
    $channel = App::get_channel();
    if (argc() > 2 && argv(1) === 'complete' && intval(argv(2))) {
        $ret = array('success' => false);
        $r = q("select * from event where `type` = 'task' and uid = %d and id = %d limit 1", intval(local_channel()), intval(argv(2)));
        if ($r) {
            $event = $r[0];
            if ($event['event_status'] === 'COMPLETED') {
                $event['event_status'] = 'IN-PROCESS';
                $event['event_status_date'] = NULL_DATE;
                $event['event_percent'] = 0;
                $event['event_sequence'] = $event['event_sequence'] + 1;
                $event['edited'] = datetime_convert();
            } else {
                $event['event_status'] = 'COMPLETED';
                $event['event_status_date'] = datetime_convert();
                $event['event_percent'] = 100;
                $event['event_sequence'] = $event['event_sequence'] + 1;
                $event['edited'] = datetime_convert();
            }
            $x = event_store_event($event);
            if ($x) {
                $ret['success'] = true;
            }
        }
        json_return_and_die($ret);
    }
    if (argc() == 2 && argv(1) === 'new') {
        $text = escape_tags(trim($_REQUEST['summary']));
        if (!$text) {
            return array('success' => false);
        }
        $event = array();
        $event['account'] = $channel['channel_account_id'];
        $event['uid'] = $channel['channel_id'];
        $event['event_xchan'] = $channel['channel_hash'];
        $event['type'] = 'task';
        $event['nofinish'] = true;
        $event['created'] = $event['edited'] = $event['start'] = datetime_convert();
        $event['adjust'] = 1;
        $event['allow_cid'] = '<' . $channel['channel_hash'] . '>';
        $event['summary'] = escape_tags($_REQUEST['summary']);
        $x = event_store_event($event);
        if ($x) {
            $x['success'] = true;
        } else {
            $x = array('success' => false);
        }
        json_return_and_die($x);
    }
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:56,代码来源:tasks.php


示例16: jqcal2wdcal

 /**
  * @param array $row
  * @param array $calendar
  * @param string $base_path
  * @return array
  */
 private function jqcal2wdcal($row, $calendar, $base_path)
 {
     $not = q("SELECT COUNT(*) num FROM %s%snotifications WHERE `calendar_id` = %d AND `calendarobject_id` = %d", CALDAV_SQL_DB, CALDAV_SQL_PREFIX, IntVal($row["calendar_id"]), IntVal($row["calendarobject_id"]));
     $editable = $this->getPermissionsItem($calendar["namespace_id"], $row["calendarobject_id"], $row);
     $end = wdcal_mySql2PhpTime($row["EndTime"]);
     if ($row["IsAllDayEvent"]) {
         $end -= 1;
     }
     return array("jq_id" => $row["id"], "ev_id" => $row["calendarobject_id"], "summary" => escape_tags($row["Summary"]), "start" => wdcal_mySql2PhpTime($row["StartTime"]), "end" => $end, "is_allday" => $row["IsAllDayEvent"], "is_moredays" => 0, "is_recurring" => $row["IsRecurring"], "color" => is_null($row["Color"]) || $row["Color"] == "" ? $calendar["calendarcolor"] : $row["Color"], "is_editable" => $editable ? 1 : 0, "is_editable_quick" => $editable && !$row["IsRecurring"] ? 1 : 0, "location" => "Loc.", "attendees" => '', "has_notification" => $not[0]["num"] > 0 ? 1 : 0, "url_detail" => $base_path . $row["calendarobject_id"] . "/", "url_edit" => $base_path . $row["calendarobject_id"] . "/edit/", "special_type" => "");
 }
开发者ID:ZerGabriel,项目名称:friendica-addons,代码行数:16,代码来源:dav_caldav_backend_private.inc.php


示例17: bookmark_add

function bookmark_add($channel, $sender, $taxonomy, $private, $opts = null)
{
    $menu_id = 0;
    $menu_name = '';
    $ischat = false;
    if (is_array($opts)) {
        $menu_id = x($opts, 'menu_id') ? intval($opts['menu_id']) : 0;
        $menu_name = x($opts, 'menu_name') ? escape_tags($opts['menu_name']) : '';
        $ischat = x($opts, 'ischat') ? intval($opts['ischat']) : 0;
    }
    $iarr = array();
    $channel_id = $channel['channel_id'];
    if ($private) {
        $iarr['contact_allow'] = array($channel['channel_hash']);
    }
    $iarr['mitem_link'] = $taxonomy['url'];
    $iarr['mitem_desc'] = $taxonomy['term'];
    $iarr['mitem_flags'] = $ischat ? MENU_ITEM_CHATROOM : 0;
    require_once 'include/hubloc.php';
    $zrl = is_matrix_url($taxonomy['url']);
    if ($zrl) {
        $iarr['mitem_flags'] |= MENU_ITEM_ZID;
    }
    $arr = array();
    if (!$menu_name) {
        $arr['menu_name'] = substr($sender['xchan_hash'], 0, 16) . ' ' . $sender['xchan_name'];
        $arr['menu_desc'] = sprintf(t('%1$s\'s bookmarks'), $sender['xchan_name']);
    } else {
        $arr['menu_name'] = $arr['menu_desc'] = $menu_name;
    }
    $arr['menu_flags'] = $sender['xchan_hash'] === $channel['channel_hash'] ? MENU_BOOKMARK : MENU_SYSTEM | MENU_BOOKMARK;
    $arr['menu_channel_id'] = $channel_id;
    if (!$menu_id) {
        $x = menu_list($arr['menu_channel_id'], $arr['menu_name'], $arr['menu_flags']);
        if ($x) {
            $menu_id = $x[0]['menu_id'];
        } else {
            $menu_id = menu_create($arr);
        }
    }
    if (!$menu_id) {
        logger('bookmark_add: unable to create menu ' . $arr['menu_name']);
        return;
    }
    logger('add_bookmark: menu_id ' . $menu_id);
    $r = q("select * from menu_item where mitem_link = '%s' and mitem_menu_id = %d and mitem_channel_id = %d limit 1", dbesc($iarr['mitem_link']), intval($menu_id), intval($channel_id));
    if ($r) {
        logger('add_bookmark: duplicate menu entry', LOGGER_DEBUG);
    }
    if (!$r) {
        $r = menu_add_item($menu_id, $channel_id, $iarr);
    }
    return $r;
}
开发者ID:msooon,项目名称:hubzilla,代码行数:54,代码来源:bookmarks.php


示例18: getPrincipalByPath

 /**
  * Returns a specific principal, specified by it's path.
  * The returned structure should be the exact same as from
  * getPrincipalsByPrefix.
  *
  * @param string $path
  * @return array
  */
 public function getPrincipalByPath($path)
 {
     list($prefixPath, $userName) = Sabre_DAV_URLUtil::splitPath($path);
     // This backend only support principals in one collection
     if ($prefixPath !== $this->prefix) {
         return null;
     }
     $r = q("SELECT `nickname` FROM `user` WHERE `nickname` = '%s'", escape_tags($userName));
     if (count($r) == 0) {
         return array();
     }
     return array('uri' => $this->prefix . '/' . strtolower($r[0]['nickname']), '{DAV:}displayname' => $r[0]['nickname']);
 }
开发者ID:robhell,项目名称:friendica-addons,代码行数:21,代码来源:dav_friendica_principal.inc.php


示例19: post

 function post()
 {
     $channel = \App::get_channel();
     check_form_security_token_redirectOnErr('/settings/tokens', 'settings_tokens');
     $token_errs = 0;
     if (array_key_exists('token', $_POST)) {
         $atoken_id = $_POST['atoken_id'] ? intval($_POST['atoken_id']) : 0;
         $name = trim(escape_tags($_POST['name']));
         $token = trim($_POST['token']);
         if (!$name || !$token) {
             $token_errs++;
         }
         if (trim($_POST['expires'])) {
             $expires = datetime_convert(date_default_timezone_get(), 'UTC', $_POST['expires']);
         } else {
             $expires = NULL_DATE;
         }
         $max_atokens = service_class_fetch(local_channel(), 'access_tokens');
         if ($max_atokens) {
             $r = q("select count(atoken_id) as total where atoken_uid = %d", intval(local_channel()));
             if ($r && intval($r[0]['total']) >= $max_tokens) {
                 notice(sprintf(t('This channel is limited to %d tokens'), $max_tokens) . EOL);
                 return;
             }
         }
     }
     if ($token_errs) {
         notice(t('Name and Password are required.') . EOL);
         return;
     }
     if ($atoken_id) {
         $r = q("update atoken set atoken_name = '%s', atoken_token = '%s', atoken_expires = '%s' \n\t\t\t\twhere atoken_id = %d and atoken_uid = %d", dbesc($name), dbesc($token), dbesc($expires), intval($atoken_id), intval($channel['channel_id']));
     } else {
         $r = q("insert into atoken ( atoken_aid, atoken_uid, atoken_name, atoken_token, atoken_expires )\n\t\t\t\tvalues ( %d, %d, '%s', '%s', '%s' ) ", intval($channel['channel_account_id']), intval($channel['channel_id']), dbesc($name), dbesc($token), dbesc($expires));
     }
     $atoken_xchan = substr($channel['channel_hash'], 0, 16) . '.' . $name;
     $all_perms = \Zotlabs\Access\Permissions::Perms();
     if ($all_perms) {
         foreach ($all_perms as $perm => $desc) {
             if (array_key_exists('perms_' . $perm, $_POST)) {
                 set_abconfig($channel['channel_id'], $atoken_xchan, 'my_perms', $perm, intval($_POST['perms_' . $perm]));
             } else {
                 set_abconfig($channel['channel_id'], $atoken_xchan, 'my_perms', $perm, 0);
             }
         }
     }
     info(t('Token saved.') . EOL);
     return;
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:49,代码来源:Tokens.php


示例20: pre_output

 /**
  * Pre-Ouput WYSUWYG content
  *
  * @access 	public
  * @param 	string
  * @return 	string
  */
 public function pre_output($input, $params)
 {
     // Legacy. This was a temp fix for a few things
     // that I'm sure a few sites are utilizing.
     $input = str_replace('&#123;&#123; url:site &#125;&#125;', site_url() . '/', $input);
     $parse_tags = !isset($params['allow_tags']) ? 'n' : $params['allow_tags'];
     // If this isn't the admin and we want to allow tags,
     // let it through. Otherwise we will escape them.
     if (!defined('ADMIN_THEME') and $parse_tags == 'y') {
         return $this->CI->parser->parse_string($input, array(), true);
     } else {
         $this->CI->load->helper('text');
         return escape_tags($input);
     }
 }
开发者ID:rishikeshwalawalkar,项目名称:GetARide,代码行数:22,代码来源:field.wysiwyg.php



注:本文中的escape_tags函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP escape_title函数代码示例发布时间:2022-05-15
下一篇:
PHP escape_string函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap