예제 #1
0
 public function __construct()
 {
     $this->mysql = new mysql();
     mb_internal_encoding('UTF-8');
     mb_http_output('UTF-8');
     mb_http_input('UTF-8');
 }
예제 #2
0
 public function put_category_autofill_to_db($db, $cat)
 {
     mb_internal_encoding('UTF-8');
     mb_http_output('UTF-8');
     mb_http_input('UTF-8');
     echo '<pre>';
     //        $old_categorys = $db->get_categorys_from_db();
     //
     //        echo '<h2>vanhat</h2>';
     //
     //        var_dump($old_categorys);
     //
     //        echo '<h2>settareissa</h2>';
     //
     //        var_dump($xml_categorys);
     //
     //        $new_categorys = array_diff($xml_categorys, $old_categorys);
     echo '<h2>lisätään</h2>';
     $xml_categorys = $cat->autofillCategorys();
     var_dump($xml_categorys);
     foreach ($xml_categorys as $category) {
         $db->put_category_to_db($category);
         echo "\n";
     }
     echo '</pre>';
 }
예제 #3
0
 /**
  * Run an application
  */
 public static function run()
 {
     // Error reporting
     error_reporting(ENV === 'production' ? E_ERROR | E_WARNING | E_PARSE : -1);
     ini_set('display_errors', ENV === 'production' ? 0 : 1);
     // Services
     $services = Services::getInstance();
     // Global configuration
     $config = $services->config()->get('config');
     // UTF-8 support
     if (isset($config['utf8']) && $config['utf8']) {
         mb_internal_encoding('UTF-8');
         mb_http_output('UTF-8');
         mb_http_input('UTF-8');
         mb_language('uni');
         mb_regex_encoding('UTF-8');
         ob_start('mb_output_handler');
     } else {
         ob_start();
     }
     // Set Locales
     if (isset($config['locale']) && $config['locale']) {
         setlocale(LC_ALL, $config['locale']);
         setlocale(LC_NUMERIC, 'C');
     }
     // Call controller
     if ($route = $services->route()) {
         list($class, $method, $params) = $route;
         $controller = new $class();
         $controller->{$method}(...$params);
     }
     $services->output()->display(!$services->input()->isClient());
     ob_end_flush();
 }
예제 #4
0
 /**
  * Fired on instantiate the module
  * At this point nothing from the module is loaded
  */
 public function onInit()
 {
     mb_detect_order(self::$encoding . ", UTF-8, UTF-7, ISO-8859-1, ASCII, EUC-JP, SJIS, eucJP-win, SJIS-win, JIS, ISO-2022-JP, Windows-1251, Windows-1252");
     mb_internal_encoding(self::$encoding);
     mb_http_input(self::$encoding);
     mb_http_output(self::$encoding);
     mb_language("uni");
     header("Content-Type: text/html; charset=" . self::$encoding);
     return $this;
 }
예제 #5
0
 /**
  * Sets the default charset to be used for everything
  */
 public function setCharset($charset = '')
 {
     if (!empty($charset) && is_string($charset)) {
         $charset = trim($charset);
         @mb_internal_encoding($charset);
         @mb_http_output($charset);
         @mb_http_input($charset);
         @mb_regex_encoding($charset);
     }
 }
예제 #6
0
 public function initialize()
 {
     mb_internal_encoding('UTF-8');
     mb_http_output('UTF-8');
     mb_http_input('UTF-8');
     \common\classes\Error::initialize();
     \System\handler\ExceptionHandler::initialize();
     /**
      * @var $session Session
      */
     $session = \common\classes\Application::get_class(Session::class);
     $session->start();
 }
예제 #7
0
 /**
  * @param null $config
  *
  * @return TestApplication
  */
 public function __construct($config = null)
 {
     Craft::setApplication(null);
     clearstatcache();
     // SHOW EVERYTHING
     error_reporting(E_ALL & ~E_STRICT);
     ini_set('display_errors', 1);
     mb_internal_encoding('UTF-8');
     mb_http_input('UTF-8');
     mb_http_output('UTF-8');
     mb_detect_order('auto');
     // No matter how much you want to delete this line... DO NOT DO IT.
     Craft::$enableIncludePath = false;
     parent::__construct($config);
 }
예제 #8
0
function clean($string)
{
    mb_internal_encoding('UTF-8');
    mb_http_output('UTF-8');
    mb_http_input('UTF-8');
    if (is_array($string)) {
        foreach ($string as $key => $value) {
            $string[$key] = clean($value);
        }
        return $string;
    } else {
        if (strpos($string = htmlentities($string, ENT_QUOTES, 'UTF-8'), '&') !== false) {
            $string = html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|tilde|uml);~i', '$1', $string), ENT_QUOTES, 'UTF-8');
        }
        return $string;
    }
}
 public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
 {
     $front = Zend_Controller_Front::getInstance();
     $currentModule = $front->getRequest()->getModuleName();
     $registry = Zend_Registry::getInstance();
     $registry->session = Base_Helper_Session::getInstance();
     $appConfig = $front->getParam("bootstrap")->getOptions();
     $registry->appConfig = $appConfig;
     $registry->currentModule = $currentModule;
     $modulePaths = array();
     foreach ($front->getControllerDirectory() as $moduleName => $controllerPath) {
         $modulePaths[$moduleName] = dirname($controllerPath);
     }
     $registry->modulePaths = $modulePaths;
     $registry->controllerPaths = $front->getControllerDirectory();
     $logName = date('Y-m-d') . '.log';
     !is_dir(LOG_PATH) ? mkdir(LOG_PATH, 0777, TRUE) : NULL;
     $registry->logging = new Base_Php_Overloader();
     $registry->logging->logDir = LOG_PATH;
     $registry->logging->logName = $logName;
     Base_Helper_Log::getInstance()->setLogName($logName);
     if (PHP_VERSION_ID < 50600) {
         mb_http_input('UTF-8');
         mb_http_output('UTF-8');
         mb_internal_encoding('UTF-8');
         iconv_set_encoding('input_encoding', 'UTF-8');
         iconv_set_encoding('output_encoding', 'UTF-8');
         iconv_set_encoding('internal_encoding', 'UTF-8');
         iconv_set_encoding('internal_encoding', 'UTF-8');
     } else {
         ini_set('input_encoding', 'UTF-8');
         ini_set('output_encoding', 'UTF-8');
         ini_set('default_charset', 'UTF-8');
         ini_set('default_charset', 'UTF-8');
         //ini_set('mbstring.http_input', 'UTF-8');
         //ini_set('mbstring.http_output', 'UTF-8');
         //ini_set('mbstring.internal_encoding', 'UTF-8');
     }
     if ('base' != strtolower($currentModule)) {
         Base_Plugin_Module::init();
     }
     $class = ucfirst($currentModule) . '_Plugin_Module';
     call_user_func($class . '::init');
 }
예제 #10
0
 public function __construct()
 {
     $this->dbhost = get_dbhost();
     $this->dbuser = get_dbuser();
     $this->dbpw = get_dbpw();
     $this->dbname = get_dbname();
     $this->dbsocket = get_dbsocket();
     $this->dbport = get_dbport();
     $this->etuliite = get_etuliite();
     mb_internal_encoding('UTF-8');
     mb_http_output('UTF-8');
     mb_http_input('UTF-8');
     if (empty($this->dbsocket)) {
         $this->local_db = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpw) or die;
         mysqli_select_db($this->local_db, $this->dbname) or die;
     } else {
         $this->local_db = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpw, $this->dbname, $this->dbport, $this->dbsocket) or die;
     }
 }
예제 #11
0
 /**
  * @param $locale_head
  * @return string
  */
 static function setLocale($language, $region, $encoding)
 {
     if (self::$language != $language) {
         foreach (self::$domains as $domain) {
             self::resetDomain($domain);
         }
     }
     self::$language = $language;
     self::$region = $region;
     self::$encoding = $encoding;
     $locale = self::makeLocale($language, $region, $encoding);
     setlocale(LC_ALL, $locale);
     // set init encoding
     mb_language($language);
     mb_internal_encoding($encoding);
     mb_http_input($encoding);
     mb_http_output($encoding);
     return $locale;
 }
예제 #12
0
 public static function setEncoding($encoding = 'UTF-8', $language = null)
 {
     if ($language === null || !in_array($language, ['uni', 'Japanese', 'ja', 'English', 'en'], true)) {
         $language = 'uni';
     }
     switch (strtoupper($encoding)) {
         case 'UTF-8':
             if (extension_loaded("mbstring")) {
                 mb_internal_encoding($encoding);
                 mb_http_output($encoding);
                 mb_http_input($encoding);
                 mb_language($language);
                 mb_regex_encoding($encoding);
             } else {
                 throw new phpFastCacheCoreException("MB String need to be installed for Unicode Encoding");
             }
             break;
     }
 }
예제 #13
0
 /**
  * Constructor
  */
 public function construct()
 {
     mb_internal_encoding("UTF-8");
     mb_http_input("UTF-8");
     mb_http_output("UTF-8");
     if (!is_array($_SESSION[__CLASS__]['classes_versions'])) {
         $_SESSION[__CLASS__]['classes_versions'] = array();
     }
     $installedVersion = $this->getClassInstalledVersion(__CLASS__);
     if ($installedVersion != self::CLASS_VERSION) {
         $this->linker->db->updateQueries(__CLASS__);
         if (version_compare($installed_version, '1.1.11.03.28', '<')) {
             // We have to create the tables, because the insertion of the version is done at
             // the same time, so if there isn't a version, it is because the table doesn't exist.
             $this->db_execute('classes_installed_version_add_table', array());
             $this->db_execute('shared_methods_add_table', array());
         }
         if (version_compare($installed_version, '1.1.12.03.12', '<')) {
             $this->db_execute('create_table_datas_256', array());
         }
         $this->setClassInstalledVersion(__CLASS__, self::CLASS_VERSION);
     }
     return true;
 }
<?php

require dirname(__FILE__) . '/wp-config.php';
if (!defined('XOOPS_URL')) {
    $blog_charset = get_settings('blog_charset');
}
if (function_exists('mb_convert_encoding')) {
    if ($_charset != "" && (mb_http_input("P") == "" || strtolower(ini_get("mbstring.http_input")) == "pass")) {
        $_charset = strtoupper(trim($_charset));
    } else {
        $_charset = "auto";
    }
    if ($_charset == "auto") {
        $_charset = mb_detect_encoding($_POST['author'] . $_POST['comment'], $_charset);
    }
    $_POST['author'] = mb_convert_encoding($_POST['author'], $blog_charset, $_charset);
    $_POST['comment'] = mb_convert_encoding($_POST['comment'], $blog_charset, $_charset);
}
if (defined('XOOPS_URL')) {
    if (get_xoops_option(wp_mod(), 'wp_use_xoops_comments')) {
        return;
    }
    init_param('POST', 'author', 'string', '');
    init_param('POST', 'email', 'string', '');
    init_param('POST', 'url', 'string', '');
    init_param('POST', 'comment', 'html', '');
    init_param('POST', 'comment_post_ID', 'integer', '');
    init_param('POST', 'redirect_to', 'string', '');
    init_param('POST', 'action', 'string', '');
    init_param('POST', 'use_session', 'integer', '');
    $_author = get_param('author');
예제 #15
0
파일: MB.php 프로젝트: bytemtek/znframework
 public function httpInput($type = 'I')
 {
     if (!is_string($type)) {
         return Error::set('Error', 'stringParameter', '1.(type)');
     }
     return mb_http_input($type);
 }
예제 #16
0
파일: mb_misc.php 프로젝트: badlamer/hhvm
<?php

var_dump(mb_http_input());
var_dump(mb_http_output());
var_dump(mb_language());
var_dump(mb_preferred_mime_name("sjis-win"));
mb_regex_encoding("UTF-8");
var_dump(mb_regex_encoding());
var_dump(mb_regex_set_options());
var_dump(mb_regex_set_options("pz"));
var_dump(mb_regex_set_options());
예제 #17
0
파일: WebApp.php 프로젝트: kant312/sop
 /**
  * Processes the request.
  *
  * @throws HttpException
  * @return null
  */
 public function processRequest()
 {
     // If this is a resource request, we should respond with the resource ASAP
     $this->_processResourceRequest();
     // If we're not in devMode, or it's a 'dontExtendSession' request, we're going to remove some logging routes.
     if (!$this->config->get('devMode') || craft()->isInstalled() && !$this->userSession->shouldExtendSession()) {
         $this->log->removeRoute('WebLogRoute');
         $this->log->removeRoute('ProfileLogRoute');
     }
     // Additionally, we don't want these in the log files at all.
     if (craft()->isInstalled() && !$this->userSession->shouldExtendSession()) {
         $this->log->removeRoute('FileLogRoute');
     }
     // If this is a CP request, prevent robots from indexing/following the page
     // (see https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag)
     if ($this->request->isCpRequest()) {
         HeaderHelper::setHeader(array('X-Robots-Tag' => 'none'));
     }
     // Validate some basics on the database configuration file.
     $this->validateDbConfigFile();
     // Process install requests
     $this->_processInstallRequest();
     // If the system in is maintenance mode and it's a site request, throw a 503.
     if ($this->isInMaintenanceMode() && $this->request->isSiteRequest()) {
         throw new HttpException(503);
     }
     // Check if the app path has changed.  If so, run the requirements check again.
     $this->_processRequirementsCheck();
     // These have been deprecated in PHP 6 in favor of default_charset, which defaults to 'UTF-8'
     // http://php.net/manual/en/migration56.deprecated.php
     if (version_compare(PHP_VERSION, '6.0.0') < 0) {
         // Now that we've ran the requirements checker, set MB to use UTF-8
         mb_internal_encoding('UTF-8');
         mb_http_input('UTF-8');
         mb_http_output('UTF-8');
     }
     mb_detect_order('auto');
     // Makes sure that the uploaded files are compatible with the current DB schema
     if (!$this->updates->isSchemaVersionCompatible()) {
         if ($this->request->isCpRequest()) {
             $version = $this->getVersion();
             $build = $this->getBuild();
             $url = "http://download.buildwithcraft.com/craft/{$version}/{$version}.{$build}/Craft-{$version}.{$build}.zip";
             throw new HttpException(200, Craft::t('Craft does not support backtracking to this version. Please upload Craft {url} or later.', array('url' => '[' . $build . '](' . $url . ')')));
         } else {
             throw new HttpException(503);
         }
     }
     // Set the edition components
     $this->_setEditionComponents();
     // isCraftDbMigrationNeeded will return true if we're in the middle of a manual or auto-update for Craft itself.
     // If we're in maintenance mode and it's not a site request, show the manual update template.
     if ($this->updates->isCraftDbMigrationNeeded() || $this->isInMaintenanceMode() && $this->request->isCpRequest() || $this->request->getActionSegments() == array('update', 'cleanUp') || $this->request->getActionSegments() == array('update', 'rollback')) {
         $this->_processUpdateLogic();
     }
     // If there's a new version, but the schema hasn't changed, just update the info table
     if ($this->updates->hasCraftBuildChanged()) {
         $this->updates->updateCraftVersionInfo();
     }
     // If the system is offline, make sure they have permission to be here
     $this->_enforceSystemStatusPermissions();
     // Load the plugins
     $this->plugins->loadPlugins();
     // Check if a plugin needs to update the database.
     if ($this->updates->isPluginDbUpdateNeeded()) {
         $this->_processUpdateLogic();
     }
     // If this is a non-login, non-validate, non-setPassword CP request, make sure the user has access to the CP
     if ($this->request->isCpRequest() && !($this->request->isActionRequest() && $this->_isSpecialCaseActionRequest())) {
         // Make sure the user has access to the CP
         $this->userSession->requireLogin();
         $this->userSession->requirePermission('accessCp');
         // If they're accessing a plugin's section, make sure that they have permission to do so
         $firstSeg = $this->request->getSegment(1);
         if ($firstSeg) {
             $plugin = $plugin = $this->plugins->getPlugin($firstSeg);
             if ($plugin) {
                 $this->userSession->requirePermission('accessPlugin-' . $plugin->getClassHandle());
             }
         }
     }
     // If this is an action request, call the controller
     $this->_processActionRequest();
     // If we're still here, finally let UrlManager do it's thing.
     parent::processRequest();
 }
예제 #18
0
function get_the_snippet($length = 150)
{
    $html = '';
    if (get_the_excerpt()) {
        $html = get_the_excerpt();
    } else {
        $html = get_the_content('', false);
    }
    if ($html) {
        $html = strip_tags($html);
        if (strlen($html) > $length) {
            if (function_exists('mb_internal_encoding') && function_exists('mb_http_output') && function_exists('mb_http_input') && function_exists('mb_language') && function_exists('mb_regex_encoding')) {
                mb_internal_encoding('UTF-8');
                mb_http_output('UTF-8');
                mb_http_input('UTF-8');
                mb_language('uni');
                mb_regex_encoding('UTF-8');
            }
            $html = mb_substr($html, 0, $length) . '...';
        }
        $html = '<p class="snippet">' . $html . '</p>';
    }
    return $html;
}
예제 #19
0
파일: abs.php 프로젝트: kidaa/uw-web
<?php

mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
mb_language('uni');
mb_regex_encoding('UTF-8');
ob_start('mb_output_handler');
header('Content-type: application/javascript');
//// START UP
$token = '';
$action = $_GET['action'];
$output = $_GET['output'];
$callback = $_GET['callback'];
$key = $_GET['key'];
// TODO:STORE Access by key for analytics?
$results = null;
$dbs_book_codes = array("GN", "EX", "LV", "NU", "DT", "JS", "JG", "RT", "S1", "S2", "K1", "K2", "R1", "R2", "ER", "NH", "ET", "JB", "PS", "PR", "EC", "SS", "IS", "JR", "LM", "EK", "DN", "HS", "JL", "AM", "OB", "JH", "MC", "NM", "HK", "ZP", "HG", "ZC", "ML", "MT", "MK", "LK", "JN", "AC", "RM", "C1", "C2", "GL", "EP", "PP", "CL", "H1", "H2", "T1", "T2", "TT", "PM", "HB", "JM", "P1", "P2", "J1", "J2", "J3", "JD", "RV");
$osis_book_codes = array("Gen", "Exod", "Lev", "Num", "Deut", "Josh", "Judg", "Ruth", "1Sam", "2Sam", "1Kgs", "2Kgs", "1Chr", "2Chr", "Ezra", "Neh", "Esth", "Job", "Ps", "Prov", "Eccl", "Song", "Isa", "Jer", "Lam", "Ezek", "Dan", "Hos", "Joel", "Amos", "Obad", "Jonah", "Mic", "Nah", "Hab", "Zeph", "Hag", "Zech", "Mal", "Matt", "Mark", "Luke", "John", "Acts", "Rom", "1Cor", "2Cor", "Gal", "Eph", "Phil", "Col", "1Thess", "2Thess", "1Tim", "2Tim", "Titus", "Phlm", "Heb", "Jas", "1Pet", "2Pet", "1John", "2John", "3John", "Jude", "Rev");
switch ($action) {
    case 'list':
        $results = get_list($_GET['force']);
        break;
    case 'books':
        $results = get_books($_GET['version']);
        break;
    case 'chapter':
        $results = get_chapter($_GET['version'], $_GET['sectionid'], $_GET['osis'], $_GET['chapter'], $_GET['dir'], $_GET['lang'], $_GET['lang3'], $_GET['previd'], $_GET['nextid'], $_GET['bookname']);
        break;
    case 'search':
        $results = get_search($_GET['version'], $_GET['text'], $_GET['divisions']);
예제 #20
0
<?php

ini_set("display_errors", On);
error_reporting(E_ALL);
mb_language("uni");
mb_internal_encoding("utf-8");
mb_http_input("auto");
mb_http_output("utf-8");
require "constant.php";
$cont_id = $_POST['contribution_id'];
$reaction = $_POST['text'];
$user_id = $_POST['user_id'];
//$sql = "INSERT INTO user (name, facebook_id, img, univ, grad_year) VALUES('$name', $fb_id, '$img', '$univ', $grad_year)";
$sql = "INSERT INTO reaction (cont_id,  reaction, user_id, created_at) VALUES({$cont_id}, '{$reaction}', {$user_id}, now())";
$link = new mysqli("localhost", "{$db_usr}", "{$db_pwd}", "{$db_name}");
if (!mysqli_set_charset($link, "utf8")) {
    printf("Error loading character set utf8: %s\n", mysqli_error($link));
} else {
    printf("Current character set: %s\n", mysqli_character_set_name($link));
}
if ($link->query($sql)) {
} else {
    if (mysqli_connect_errno()) {
        printf("connect failed: %s\n", $link->connect_error());
        exit;
    }
}
mysqli_close($link);
예제 #21
0
 function pre_confirmation_check()
 {
     global $order;
     $encode = mb_http_input();
     if ($encode == 'ASCII') {
         $encode = 'UTF-8';
     }
     $phonenum = ereg_replace("-", "", mb_convert_kana($order->customer['telephone'], "a"));
     if (strlen($phonenum) > 11 || strlen($phonenum) < 9) {
         $error = mb_convert_encoding(MODULE_PAYMENT_REMISECSP_TEXT_ERROR_INVALID_PHONE_NUM, $encode);
         $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error);
         zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
     }
     return false;
 }
예제 #22
0
 /**
  * Processes the request.
  *
  * @throws HttpException
  * @return null
  */
 public function processRequest()
 {
     // If this is a resource request, we should respond with the resource ASAP
     $this->_processResourceRequest();
     // Validate some basics on the database configuration file.
     $this->validateDbConfigFile();
     // Process install requests
     $this->_processInstallRequest();
     // If the system in is maintenance mode and it's a site request, throw a 503.
     if ($this->isInMaintenanceMode() && $this->request->isSiteRequest()) {
         throw new HttpException(503);
     }
     // Check if the app path has changed.  If so, run the requirements check again.
     $this->_processRequirementsCheck();
     // Now that we've ran the requirements checker, set MB to use UTF-8
     mb_internal_encoding('UTF-8');
     mb_http_input('UTF-8');
     mb_http_output('UTF-8');
     mb_detect_order('auto');
     // Makes sure that the uploaded files are compatible with the current DB schema
     if (!$this->updates->isSchemaVersionCompatible()) {
         if ($this->request->isCpRequest()) {
             $version = $this->getVersion();
             $build = $this->getBuild();
             $url = "http://download.buildwithcraft.com/craft/{$version}/{$version}.{$build}/Craft-{$version}.{$build}.zip";
             throw new HttpException(200, Craft::t('Craft does not support backtracking to this version. Please upload Craft {url} or later.', array('url' => '<a href="' . $url . '">build ' . $build . '</a>')));
         } else {
             throw new HttpException(503);
         }
     }
     // Set the edition components
     $this->_setEditionComponents();
     // isCraftDbMigrationNeeded will return true if we're in the middle of a manual or auto-update for Craft itself.
     // If we're in maintenance mode and it's not a site request, show the manual update template.
     if ($this->updates->isCraftDbMigrationNeeded() || $this->isInMaintenanceMode() && $this->request->isCpRequest() || $this->request->getActionSegments() == array('update', 'cleanUp') || $this->request->getActionSegments() == array('update', 'rollback')) {
         $this->_processUpdateLogic();
     }
     // If there's a new version, but the schema hasn't changed, just update the info table
     if ($this->updates->hasCraftBuildChanged()) {
         $this->updates->updateCraftVersionInfo();
     }
     // If the system is offline, make sure they have permission to be here
     $this->_enforceSystemStatusPermissions();
     // Load the plugins
     $this->plugins->loadPlugins();
     // Check if a plugin needs to update the database.
     if ($this->updates->isPluginDbUpdateNeeded()) {
         $this->_processUpdateLogic();
     }
     // If this is a non-login, non-validate, non-setPassword CP request, make sure the user has access to the CP
     if ($this->request->isCpRequest() && !($this->request->isActionRequest() && $this->_isSpecialCaseActionRequest())) {
         // Make sure the user has access to the CP
         $this->userSession->requireLogin();
         $this->userSession->requirePermission('accessCp');
         // If they're accessing a plugin's section, make sure that they have permission to do so
         $firstSeg = $this->request->getSegment(1);
         if ($firstSeg) {
             $plugin = $plugin = $this->plugins->getPlugin($firstSeg);
             if ($plugin) {
                 $this->userSession->requirePermission('accessPlugin-' . $plugin->getClassHandle());
             }
         }
     }
     // If this is an action request, call the controller
     $this->_processActionRequest();
     // If we're still here, finally let UrlManager do it's thing.
     parent::processRequest();
 }
예제 #23
0
 function pre_confirmation_check()
 {
     if (MODULE_PAYMENT_REMISE_INPUT_MODE == 'Local') {
         if (MODULE_PAYMENT_REMISE_CARD_CHECK == 'ON') {
             include DIR_WS_CLASSES . 'cc_validation.php';
             $cc_validation = new cc_validation();
             $result = $cc_validation->validate($_POST['remise_cc_number'], $_POST['remise_cc_expires_month'], $_POST['remise_cc_expires_year']);
             $error = '';
             switch ($result) {
                 case -1:
                     $error = sprintf(MODULE_PAYMENT_REMISE_TEXT_CC_INVALID_NUMBER, substr($cc_validation->cc_number, 0, 4));
                     break;
                 case -2:
                 case -3:
                 case -4:
                     $error = MODULE_PAYMENT_REMISE_TEXT_CC_INVALID_DATE;
                     break;
                 case false:
                     $error = MODULE_PAYMENT_REMISE_TEXT_CC_INVALID_NUMBER;
                     break;
             }
             $this->cc_card_name = mb_convert_kana($_POST['remise_cc_name'], "a");
             if (strlen($this->cc_card_name) < 3 || ereg("[^0-9a-zA-Z ]", $this->cc_card_name)) {
                 if ($result == false || $result < 1) {
                     $error .= MODULE_PAYMENT_REMISE_TEXT_CC_NAME;
                 } else {
                     $error = MODULE_PAYMENT_REMISE_TEXT_CC_NAME;
                 }
                 $result = false;
             }
             if ($result == false || $result < 1) {
                 $encode = mb_http_input();
                 if ($encode == 'ASCII') {
                     $encode = 'UTF-8';
                 }
                 $error = mb_convert_encoding($error, $encode);
                 $payment_error_return = 'payment_error=' . $this->code . '&error=' . urlencode($error);
                 zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, $payment_error_return, 'SSL', true, false));
             }
             $this->cc_card_type = $cc_validation->cc_type;
             $this->cc_card_number = $cc_validation->cc_number;
             $this->cc_expiry_month = $cc_validation->cc_expiry_month;
             $this->cc_expiry_year = $cc_validation->cc_expiry_year;
         } else {
             $this->cc_card_name = mb_convert_kana($_POST['remise_cc_name'], "a");
             $this->cc_card_number = $_POST['remise_cc_number'];
             $this->cc_expiry_month = $_POST['remise_cc_expires_month'];
             $this->cc_expiry_year = $_POST['remise_cc_expires_year'];
         }
     }
     return false;
 }
예제 #24
0
<?php

mb_http_input("UTF-8");
mb_internal_encoding("UTF-8");
mb_regex_encoding("UTF-8");
//////////////////////////////////////////
//設定 ver2.0
//このファイルの名前
$thisfile = basename(__FILE__);
//送信後に飛ばすページ
$tempThankLocation = "http://" . $_SERVER['HTTP_HOST'] . "/sp/reservation/thx.html";
//このフォームのURL
$thisFormURL = "http://" . $_SERVER['HTTP_HOST'] . "/sp/reservation/";
//メールアドレスとサブジェクト
$clientMailto = "*****@*****.**";
$clientSubject = "【子供わきが治療センター】ご来院予約がありました[新着1件]";
$clientMailBody = <<<_TXT_
---------------------------------------------
下記のフォームより子供わきが治療センター宛に
ご来院予約がありました。
{$thisFormURL}
---------------------------------------------

■基本情報

【ご希望院】
{%clinic}

【お名前】
{%name}
예제 #25
0
 public function httpInput(string $type = 'I')
 {
     return mb_http_input($type);
 }
예제 #26
0
파일: index.php 프로젝트: ZennoFact/washget
<?php

require_once '../../../db/config.php';
require_once '../../../db/db.php';
$id = 0;
if (isset($_GET['id'])) {
    $id = $_GET['id'];
}
mb_language('uni');
mb_internal_encoding('utf-8');
mb_http_input('auto');
mb_http_output('utf-8');
$dbh = connectDB();
$stmt = $dbh->query("SET NAMES utf8;");
if ($id === 0) {
    $stmt = $dbh->prepare("SELECT * FROM users");
} else {
    $stmt = $dbh->prepare("SELECT * FROM users where user_id = {$id}");
}
$stmt->execute();
$toiletList = array();
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $toiletList[] = array('user_id' => $row['user_id'], 'first_name' => $row['first_name'], 'family_name' => $row['family_name'], 'sex' => $row['sex']);
}
$dbh = null;
header('Content_type: application/json');
echo json_encode($toiletList);
예제 #27
0
    $_SESSION['commonWords'] = file(_CONF_PATH_ . 'commonWords.dat', FILE_IGNORE_NEW_LINES);
}
$common_words_array = $_SESSION['commonWords'];
//------------------------------------------------------------------------
// Set Program O globals
//------------------------------------------------------------------------
$srai_iterations = 1;
$rememLimit = 20;
$debugArr = array();
//------------------------------------------------------------------------
// Configure mbstring parameters
//------------------------------------------------------------------------
define('IS_MB_ENABLED', function_exists('mb_internal_encoding') ? true : false);
if (IS_MB_ENABLED) {
    mb_internal_encoding($charset);
    mb_http_input($charset);
    mb_http_output($charset);
    mb_detect_order($charset);
    mb_regex_encoding($charset);
}
//------------------------------------------------------------------------
// Set memory trigger for large data imports
//------------------------------------------------------------------------
$sys_mem_limit = ini_get('memory_limit');
$quantifier = preg_match('~\\D~', $sys_mem_limit, $matches);
$quantifier = strtolower($matches[0]);
$mem_limit = str_replace($quantifier, '', $sys_mem_limit);
switch ($quantifier) {
    case 'g':
        $mem_limit *= 1024;
    case 'm':
<?php

// TODO: This is not a real test.... Need to change so that it does real testing
//$debug = true;
ini_set('include_path', dirname(__FILE__));
include_once 'common.inc';
$ini = ini_get('mbstring.http_input');
// It must be url encoded....
// echo vars
echo $_POST['a'] . "\n";
echo $_GET['b'] . "\n";
// Get encoding
$enc = mb_http_input('P');
// check
if (empty($ini)) {
    // Must be pass
    if ($enc === 'pass') {
        echo "OK\n";
    } else {
        echo "NG\n";
    }
} else {
    // Some encoding
    echo "This heppens when php.ini-dist is not used\n";
}
?>

예제 #29
0
<?php 
//设置sessionid
session_id($_GET['sessionid']);
session_start();
mb_http_input("utf-8");
mb_http_output("utf-8");
if (getGet('access2008_cmd') == '2') {
    // 提交MD5验证后的文件信息进行验证
    //getGet("access2008_File_name") 	'文件名
    //getGet("access2008_File_size")	'文件大小,单位字节
    //getGet("access2008_File_type")	'文件类型 例如.gif .png
    //getGet("access2008_File_md5")		'文件的MD5签名
    die('0');
    //返回命令  0 = 开始上传文件, 2 = 不上传文件,前台直接显示上传完成
}
if (getGet('access2008_cmd') == '3') {
    //提交文件信息进行验证
    //getGet("access2008_File_name") 	'文件名
    //getGet("access2008_File_size")	'文件大小,单位字节
    //getGet("access2008_File_type")	'文件类型 例如.gif .png
    die('1');
    //返回命令 0 = 开始上传文件,1 = 提交MD5验证后的文件信息进行验证, 2 = 不上传文件,前台直接显示上传完成
}
$php_path = dirname(__FILE__) . '/';
$php_url = dirname($_SERVER['PHP_SELF']) . '/';
//文件保存目录路径
$save_path = $php_path . './';
//默认为 update.php所在目录
$save_url = $php_url . './';
//默认为 update.php所在目录
//定义允许上传的文件扩展名
예제 #30
0
 /**
  * Detect the encoding that HTTP is using
  *
  * @return  string  Returns the encoding that HTTP is using
  * @access  public
  */
 function DetectHTTP()
 {
     return mb_http_input();
 }