当前位置: 首页>>代码示例>>PHP>>正文


PHP Filter::postUrl方法代码示例

本文整理汇总了PHP中Fisharebest\Webtrees\Filter::postUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Filter::postUrl方法的具体用法?PHP Filter::postUrl怎么用?PHP Filter::postUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fisharebest\Webtrees\Filter的用法示例。


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

示例1: SimpleController

 */
namespace Fisharebest\Webtrees;

use Fisharebest\Webtrees\Controller\SimpleController;
define('WT_SCRIPT_NAME', 'message.php');
require './includes/session.php';
// Some variables are initialised from GET (so we can set initial values in URLs),
// but are submitted in POST so we can have long body text.
$subject = Filter::post('subject', null, Filter::get('subject'));
$body = Filter::post('body');
$from_name = Filter::post('from_name');
$from_email = Filter::post('from_email');
$action = Filter::post('action', 'compose|send', 'compose');
$to = Filter::post('to', null, Filter::get('to'));
$method = Filter::post('method', 'messaging|messaging2|messaging3|mailto|none', Filter::get('method', 'messaging|messaging2|messaging3|mailto|none', 'messaging2'));
$url = Filter::postUrl('url', Filter::getUrl('url'));
$to_user = User::findByUserName($to);
$controller = new SimpleController();
$controller->restrictAccess($to_user || Auth::isAdmin() && ($to === 'all' || $to === 'last_6mo' || $to === 'never_logged'))->setPageTitle(I18N::translate('webtrees message'));
$errors = '';
// Is this message from a member or a visitor?
if (Auth::check()) {
    $from = Auth::user()->getUserName();
} else {
    // Visitors must provide a valid email address
    if ($from_email && (!preg_match("/(.+)@(.+)/", $from_email, $match) || function_exists('checkdnsrr') && checkdnsrr($match[2]) === false)) {
        $errors .= '<p class="ui-state-error">' . I18N::translate('Please enter a valid email address.') . '</p>';
        $action = 'compose';
    }
    // Do not allow anonymous visitors to include links to external sites
    if (preg_match('/(?!' . preg_quote(WT_BASE_URL, '/') . ')(((?:ftp|http|https):\\/\\/)[a-zA-Z0-9.-]+)/', $subject . $body, $match)) {
开发者ID:josefpavlik,项目名称:webtrees,代码行数:31,代码来源:message.php

示例2: config

 /**
  * WelcomeBlock@config
  * 
  * @param string $block_id
  */
 public function config($block_id)
 {
     if (Filter::postBool('save') && Filter::checkCsrf()) {
         $this->module->setBlockSetting($block_id, 'piwik_enabled', Filter::postBool('piwik_enabled'));
         $this->module->setBlockSetting($block_id, 'piwik_url', trim(Filter::postUrl('piwik_url')));
         $this->module->setBlockSetting($block_id, 'piwik_siteid', trim(Filter::post('piwik_siteid')));
         $this->module->setBlockSetting($block_id, 'piwik_token', trim(Filter::post('piwik_token')));
         Cache::delete('piwikCountYear', $this->module);
         throw new MvcException(200);
         // Use this instead of exit
     }
     $view_bag = new ViewBag();
     // Is Piwik Statistic Enabled ?
     $view_bag->set('piwik_enabled', $this->module->getBlockSetting($block_id, 'piwik_enabled', '0'));
     //Piwik Root Url
     $view_bag->set('piwik_url', $this->module->getBlockSetting($block_id, 'piwik_url', ''));
     // Piwik token
     $view_bag->set('piwik_token', $this->module->getBlockSetting($block_id, 'piwik_token', ''));
     // Piwik side id
     $view_bag->set('piwik_siteid', $this->module->getBlockSetting($block_id, 'piwik_siteid', ''));
     ViewFactory::make('WelcomeBlockConfig', $this, new BaseController(), $view_bag)->renderPartial();
 }
开发者ID:jon48,项目名称:webtrees-lib,代码行数:27,代码来源:WelcomeBlockController.php


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