當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。