本文整理汇总了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)) {
示例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();
}