本文整理汇总了PHP中helper::escapeText方法的典型用法代码示例。如果您正苦于以下问题:PHP helper::escapeText方法的具体用法?PHP helper::escapeText怎么用?PHP helper::escapeText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helper
的用法示例。
在下文中一共展示了helper::escapeText方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
public function remove($accountId, $accessToken)
{
$accountId = helper::clearInt($accountId);
$accessToken = helper::clearText($accessToken);
$accessToken = helper::escapeText($accessToken);
$currentTime = time();
//current time
$stmt = $this->db->prepare("UPDATE access_data SET removeAt = (:removeAt) WHERE accountId = (:accountId) AND accessToken = (:accessToken)");
$stmt->bindParam(":accountId", $accountId, PDO::PARAM_INT);
$stmt->bindParam(":accessToken", $accessToken, PDO::PARAM_STR);
$stmt->bindParam(":removeAt", $currentTime, PDO::PARAM_INT);
if ($stmt->execute()) {
return true;
}
return false;
}
示例2: isset
$error_password = false;
$error_password_repeat = false;
if (!empty($_POST)) {
$error = false;
$user_username = isset($_POST['user_username']) ? $_POST['user_username'] : '';
$user_password = isset($_POST['user_password']) ? $_POST['user_password'] : '';
$user_fullname = isset($_POST['user_fullname']) ? $_POST['user_fullname'] : '';
$token = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
$user_username = helper::clearText($user_username);
$user_fullname = helper::clearText($user_fullname);
$user_password = helper::clearText($user_password);
$user_password_repeat = helper::clearText($user_password_repeat);
$user_username = helper::escapeText($user_username);
$user_fullname = helper::escapeText($user_fullname);
$user_password = helper::escapeText($user_password);
$user_password_repeat = helper::escapeText($user_password_repeat);
if (auth::getAuthenticityToken() !== $token) {
$error = true;
$error_token = true;
$error_message[] = 'Error!';
}
if (!helper::isCorrectLogin($user_username)) {
$error = true;
$error_username = true;
$error_message[] = 'Incorrect username.';
}
if (!helper::isCorrectPassword($user_password)) {
$error = true;
$error_password = true;
$error_message[] = 'Incorrect password.';
}
示例3: isset
$fb_page = isset($_POST['fb_page']) ? $_POST['fb_page'] : '';
$instagram_page = isset($_POST['instagram_page']) ? $_POST['instagram_page'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$username = helper::clearText($username);
$username = helper::escapeText($username);
$fullname = helper::clearText($fullname);
$fullname = helper::escapeText($fullname);
$location = helper::clearText($location);
$location = helper::escapeText($location);
$balance = helper::clearInt($balance);
$fb_page = helper::clearText($fb_page);
$fb_page = helper::escapeText($fb_page);
$instagram_page = helper::clearText($instagram_page);
$instagram_page = helper::escapeText($instagram_page);
$email = helper::clearText($email);
$email = helper::escapeText($email);
if ($authToken === helper::getAuthenticityToken()) {
$account->setUsername($username);
$account->setFullname($fullname);
$account->setLocation($location);
$account->setBalance($balance);
$account->setFacebookPage($fb_page);
$account->setInstagramPage($instagram_page);
$account->setEmail($email);
}
}
header("Location: /admin/profile.php/?id=" . $accountInfo['id']);
exit;
}
}
} else {
示例4: isset
<?php
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2015 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$gcm_regId = isset($_POST['gcm_regId']) ? $_POST['gcm_regId'] : '';
$gcm_regId = helper::clearText($gcm_regId);
$gcm_regId = helper::escapeText($gcm_regId);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$account = new account($dbo, $accountId);
$result = $account->setGCM_regId($gcm_regId);
echo json_encode($result);
exit;
}
示例5: isset
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0;
$gcm_regId = isset($_POST['gcm_regId']) ? $_POST['gcm_regId'] : '';
$facebookId = isset($_POST['facebookId']) ? $_POST['facebookId'] : '';
$clientId = helper::clearInt($clientId);
$gcm_regId = helper::clearText($gcm_regId);
$gcm_regId = helper::escapeText($gcm_regId);
$facebookId = helper::clearText($facebookId);
$facebookId = helper::escapeText($facebookId);
$access_data = array("error" => true, "error_code" => ERROR_UNKNOWN);
$helper = new helper($dbo);
$accountId = $helper->getUserIdByFacebook($facebookId);
if ($accountId != 0) {
$auth = new auth($dbo);
$access_data = $auth->create($accountId, $clientId);
if ($access_data['error'] === false) {
$account = new account($dbo, $accountId);
$account->setState(ACCOUNT_STATE_ENABLED);
$account->setLastActive();
$access_data['account'] = array();
array_push($access_data['account'], $account->get());
if (strlen($gcm_regId) != 0) {
$account->setGCM_regId($gcm_regId);
}
示例6: header
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (admin::isSession()) {
header("Location: /admin/main.php");
}
$page_id = "login";
$user_username = '';
$error = false;
$error_message = '';
if (!empty($_POST)) {
$user_username = isset($_POST['user_username']) ? $_POST['user_username'] : '';
$user_password = isset($_POST['user_password']) ? $_POST['user_password'] : '';
$token = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
$user_username = helper::clearText($user_username);
$user_password = helper::clearText($user_password);
$user_username = helper::escapeText($user_username);
$user_password = helper::escapeText($user_password);
if (helper::getAuthenticityToken() !== $token) {
$error = true;
$error_message = 'Error!';
}
if (!$error) {
$access_data = array();
$admin = new admin($dbo);
$access_data = $admin->signin($user_username, $user_password);
if ($access_data['error'] === false) {
$clientId = 0;
// Desktop version
admin::createAccessToken();
admin::setSession($access_data['accountId'], admin::getAccessToken());
header("Location: /admin/main.php");
} else {
示例7: header
if (!admin::isSession()) {
header("Location: /admin/login.php");
}
$page_id = "search";
$error = false;
$error_message = '';
$query = '';
$result = array();
$result['users'] = array();
$stats = new stats($dbo);
$settings = new settings($dbo);
$admin = new admin($dbo);
if (isset($_GET['query'])) {
$query = isset($_GET['query']) ? $_GET['query'] : '';
$query = helper::clearText($query);
$query = helper::escapeText($query);
if (strlen($query) > 2) {
$result = $stats->searchAccounts(0, $query);
}
}
helper::newAuthenticityToken();
$css_files = array("admin.css");
$page_title = "Users";
include_once $_SERVER['DOCUMENT_ROOT'] . "/common/header.inc.php";
?>
<body class="bg_gray">
<div id="page_wrap">
<?php
示例8: isset
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : 0;
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$lat = isset($_POST['lat']) ? $_POST['lat'] : '';
$lng = isset($_POST['lng']) ? $_POST['lng'] : '';
$lat = helper::clearText($lat);
$lat = helper::escapeText($lat);
$lng = helper::clearText($lng);
$lng = helper::escapeText($lng);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$result = array("error" => false, "error_code" => ERROR_SUCCESS);
$geo = new geo($dbo);
$info = $geo->info(helper::ip_addr());
$account = new account($dbo, $accountId);
if (strlen($lat) > 0 && strlen($lng) > 0) {
$result = $account->setGeoLocation($lat, $lng);
} else {
if ($info['geoplugin_status'] == 206) {
$result = $account->setGeoLocation($info['geoplugin_latitude'], $info['geoplugin_longitude']);
} else {
示例9: header
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (!admin::isSession()) {
header("Location: /admin/login.php");
}
if (!empty($_POST)) {
$authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
$message = isset($_POST['message']) ? $_POST['message'] : '';
$type = isset($_POST['type']) ? $_POST['type'] : 1;
$message = helper::clearText($message);
$message = helper::escapeText($message);
$type = helper::clearInt($type);
if ($authToken === helper::getAuthenticityToken() && !APP_DEMO) {
if (strlen($message) != 0) {
$gcm = new gcm($dbo, 0);
$gcm->setData($type, $message, 0);
$gcm->forAll();
$gcm->send();
}
}
header("Location: /admin/gcm.php");
}
$stats = new stats($dbo);
$page_id = "gcm";
$error = false;
$error_message = '';
示例10: header
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (!admin::isSession()) {
header("Location: /admin/login.php");
}
$stats = new stats($dbo);
$gift = new gift($dbo);
$page_id = "gifts";
$error = false;
$error_message = '';
if (isset($_GET['action'])) {
$action = isset($_GET['action']) ? $_GET['action'] : '';
$id = isset($_GET['id']) ? $_GET['id'] : 0;
$action = helper::clearText($action);
$action = helper::escapeText($action);
$id = helper::clearInt($id);
if (!APP_DEMO) {
switch ($action) {
case 'remove':
$gift->db_remove($id);
header("Location: /admin/gifts.php");
break;
default:
header("Location: /admin/gifts.php");
break;
}
}
}
if (!empty($_POST)) {
$authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
示例11: isset
$profileId = isset($_POST['profileId']) ? $_POST['profileId'] : 0;
$chatId = isset($_POST['chatId']) ? $_POST['chatId'] : 0;
$messageText = isset($_POST['messageText']) ? $_POST['messageText'] : "";
$messageImg = isset($_POST['messageImg']) ? $_POST['messageImg'] : "";
$clientId = helper::clearInt($clientId);
$accountId = helper::clearInt($accountId);
$profileId = helper::clearInt($profileId);
$chatId = helper::clearInt($chatId);
$messageText = helper::clearText($messageText);
$messageText = preg_replace("/[\r\n]+/", "<br>", $messageText);
//replace all new lines to one new line
$messageText = preg_replace('/\\s+/', ' ', $messageText);
//replace all white spaces to one space
$messageText = helper::escapeText($messageText);
$messageImg = helper::clearText($messageImg);
$messageImg = helper::escapeText($messageImg);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$profile = new profile($dbo, $profileId);
$profile->setRequestFrom($accountId);
$profileInfo = $profile->get();
if ($profileInfo['state'] != ACCOUNT_STATE_ENABLED) {
echo json_encode($result);
exit;
}
if ($profileInfo['allowMessages'] == 0 && $profileInfo['follower'] === false) {
echo json_encode($result);
exit;
示例12: isset
$accessMode = isset($_POST['accessMode']) ? $_POST['accessMode'] : 0;
$comment = isset($_POST['comment']) ? $_POST['comment'] : "";
$originImgUrl = isset($_POST['originImgUrl']) ? $_POST['originImgUrl'] : "";
$previewImgUrl = isset($_POST['previewImgUrl']) ? $_POST['previewImgUrl'] : "";
$imgUrl = isset($_POST['imgUrl']) ? $_POST['imgUrl'] : "";
$clientId = helper::clearInt($clientId);
$accountId = helper::clearInt($accountId);
$accessMode = helper::clearInt($accessMode);
$comment = helper::clearText($comment);
$comment = preg_replace("/[\r\n]+/", "<br>", $comment);
//replace all new lines to one new line
$comment = preg_replace('/\\s+/', ' ', $comment);
//replace all white spaces to one space
$comment = helper::escapeText($comment);
$originImgUrl = helper::clearText($originImgUrl);
$originImgUrl = helper::escapeText($originImgUrl);
$previewImgUrl = helper::clearText($previewImgUrl);
$previewImgUrl = helper::escapeText($previewImgUrl);
$imgUrl = helper::clearText($imgUrl);
$imgUrl = helper::escapeText($imgUrl);
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$photos = new photos($dbo);
$photos->setRequestFrom($accountId);
$result = $photos->add($accessMode, $comment, $originImgUrl, $previewImgUrl, $imgUrl);
echo json_encode($result);
exit;
}
示例13: isset
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$clientId = isset($_POST['clientId']) ? $_POST['clientId'] : 0;
$gcm_regId = isset($_POST['gcm_regId']) ? $_POST['gcm_regId'] : '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$clientId = helper::clearInt($clientId);
$gcm_regId = helper::clearText($gcm_regId);
$username = helper::clearText($username);
$password = helper::clearText($password);
$gcm_regId = helper::escapeText($gcm_regId);
$username = helper::escapeText($username);
$password = helper::escapeText($password);
if ($clientId != CLIENT_ID) {
api::printError(ERROR_UNKNOWN, "Error client Id.");
}
$access_data = array();
$account = new account($dbo);
$access_data = $account->signin($username, $password);
unset($account);
if ($access_data["error"] === false) {
$auth = new auth($dbo);
$access_data = $auth->create($access_data['accountId'], $clientId);
if ($access_data['error'] === false) {
$account = new account($dbo, $access_data['accountId']);
$account->setState(ACCOUNT_STATE_ENABLED);
$account->setLastActive();
$access_data['account'] = array();
示例14: isset
<?php
/*!
* ifsoft.co.uk engine v1.0
*
* http://ifsoft.com.ua, http://ifsoft.co.uk
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/config/api.inc.php";
if (!empty($_POST)) {
$accountId = isset($_POST['accountId']) ? $_POST['accountId'] : '';
$accessToken = isset($_POST['accessToken']) ? $_POST['accessToken'] : '';
$currentPassword = isset($_POST['currentPassword']) ? $_POST['currentPassword'] : '';
$newPassword = isset($_POST['newPassword']) ? $_POST['newPassword'] : '';
$currentPassword = helper::clearText($currentPassword);
$currentPassword = helper::escapeText($currentPassword);
$newPassword = helper::clearText($newPassword);
$newPassword = helper::escapeText($newPassword);
$auth = new auth($dbo);
if (!$auth->authorize($accountId, $accessToken)) {
api::printError(ERROR_ACCESS_TOKEN, "Error authorization.");
}
$result = array("error" => true, "error_code" => ERROR_UNKNOWN);
$account = new account($dbo, $accountId);
$result = $account->setPassword($currentPassword, $newPassword);
echo json_encode($result);
exit;
}
示例15: header
* qascript@ifsoft.co.uk
*
* Copyright 2012-2016 Demyanchuk Dmitry (https://vk.com/dmitry.demyanchuk)
*/
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (!admin::isSession()) {
header("Location: /admin/login.php");
}
if (!empty($_POST)) {
$authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
$current_passw = isset($_POST['current_passw']) ? $_POST['current_passw'] : '';
$new_passw = isset($_POST['new_passw']) ? $_POST['new_passw'] : '';
$current_passw = helper::clearText($current_passw);
$current_passw = helper::escapeText($current_passw);
$new_passw = helper::clearText($new_passw);
$new_passw = helper::escapeText($new_passw);
if ($authToken === helper::getAuthenticityToken() && !APP_DEMO) {
$admin = new admin($dbo);
$admin->setId(admin::getCurrentAdminId());
$result = $admin->setPassword($current_passw, $new_passw);
if ($result['error'] === false) {
header("Location: /admin/settings.php/?result=success");
exit;
} else {
header("Location: /admin/settings.php/?result=error");
exit;
}
}
header("Location: /admin/settings.php");
exit;
}