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


PHP rawurldecode函数代码示例

本文整理汇总了PHP中rawurldecode函数的典型用法代码示例。如果您正苦于以下问题:PHP rawurldecode函数的具体用法?PHP rawurldecode怎么用?PHP rawurldecode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: cf7bs_number_shortcode_handler

function cf7bs_number_shortcode_handler($tag)
{
    $tag = new WPCF7_Shortcode($tag);
    if (empty($tag->name)) {
        return '';
    }
    $mode = $status = 'default';
    $validation_error = wpcf7_get_validation_error($tag->name);
    $class = wpcf7_form_controls_class($tag->type);
    $class .= ' wpcf7-validates-as-number';
    if ($validation_error) {
        $class .= ' wpcf7-not-valid';
        $status = 'error';
    }
    if ($tag->is_required()) {
        $mode = 'required';
    }
    $value = (string) reset($tag->values);
    $placeholder = '';
    if ($tag->has_option('placeholder') || $tag->has_option('watermark')) {
        $placeholder = $value;
        $value = '';
    }
    if (wpcf7_is_posted() && isset($_POST[$tag->name])) {
        $value = stripslashes_deep($_POST[$tag->name]);
    } elseif (isset($_GET) && array_key_exists($tag->name, $_GET)) {
        $value = stripslashes_deep(rawurldecode($_GET[$tag->name]));
    }
    $field = new CF7BS_Form_Field(array('name' => $tag->name, 'id' => $tag->get_option('id', 'id', true), 'class' => $tag->get_class_option($class), 'type' => wpcf7_support_html5() ? $tag->basetype : 'text', 'value' => $value, 'placeholder' => $placeholder, 'label' => $tag->content, 'options' => array('min' => $tag->get_option('min', 'signed_int', true), 'max' => $tag->get_option('max', 'signed_int', true), 'step' => $tag->get_option('step', 'int', true)), 'help_text' => $validation_error, 'size' => cf7bs_get_form_property('size'), 'grid_columns' => cf7bs_get_form_property('grid_columns'), 'form_layout' => cf7bs_get_form_property('layout'), 'form_label_width' => cf7bs_get_form_property('label_width'), 'form_breakpoint' => cf7bs_get_form_property('breakpoint'), 'mode' => $mode, 'status' => $status, 'readonly' => $tag->has_option('readonly') ? true : false, 'tabindex' => $tag->get_option('tabindex', 'int', true), 'wrapper_class' => $tag->name));
    $html = $field->display(false);
    return $html;
}
开发者ID:kevinreilly,项目名称:envirotronics-wp,代码行数:32,代码来源:number.php

示例2: matches

 public function matches(Request $request)
 {
     if (!$this->language) {
         throw new \LogicException('Unable to match the request as the expression language is not available.');
     }
     return $this->language->evaluate($this->expression, array('request' => $request, 'method' => $request->getMethod(), 'path' => rawurldecode($request->getPathInfo()), 'host' => $request->getHost(), 'ip' => $request->getClientIp(), 'attributes' => $request->attributes->all())) && parent::matches($request);
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:7,代码来源:ExpressionRequestMatcher.php

示例3: items

 function items($name = '', $payload = '')
 {
     // Protect this handler
     if (!$this->authorized()) {
         redirect('auth/login');
     }
     $data['profile_items'] = array();
     $data['name'] = 'No item';
     if ($name) {
         $name = rawurldecode($name);
         $profile_item_obj = new Profile_model();
         $data['profile_name'] = $name;
         if ($payload) {
             $payload = rawurldecode($payload);
             $items = $profile_item_obj->retrieve_many('payload_name = ? GROUP BY serial_number', array($payload));
             $data['name'] = $payload;
         } else {
             $items = $profile_item_obj->retrieve_many('profile_name = ? GROUP BY serial_number', array($name));
             $data['name'] = $name;
         }
         foreach ($items as $item) {
             $machine = new Machine_model($item->serial_number);
             $instance['serial'] = $item->serial_number;
             $instance['hostname'] = $machine->computer_name;
             $instance['payload'] = $item->profile_name;
             $data['profile_items'][] = $instance;
         }
     }
     $obj = new View();
     $obj->view('profile/profileitem_detail', $data);
 }
开发者ID:kidistS,项目名称:munkireport-php,代码行数:31,代码来源:profile_controller.php

示例4: extractRDF

 function extractRDF()
 {
     $tc = 0;
     $t = '';
     $t_vals = array();
     foreach ($this->nodes as $n) {
         if ($n['tag'] != 'a') {
             continue;
         }
         if (!($href = $this->v('href uri', '', $n['a']))) {
             continue;
         }
         if (!($rels = $this->v('rel m', array(), $n['a']))) {
             continue;
         }
         if (!($vals = array_intersect($this->terms, $rels))) {
             continue;
         }
         $parts = preg_match('/^(.*\\/)([^\\/]+)\\/?$/', $href, $m) ? array('space' => $m[1], 'tag' => rawurldecode($m[2])) : array('space' => '', 'tag' => '');
         if ($tag = $parts['tag']) {
             $t_vals['s_' . $tc] = $this->getContainerResIDByClass($n, $this->containers);
             $t_vals['concept_' . $tc] = $this->createBnodeID() . '_concept';
             $t_vals['tag_' . $tc] = $tag;
             $t_vals['space_' . $tc] = $parts['space'];
             $t .= '?s_' . $tc . ' skos:subject [skos:prefLabel ?tag_' . $tc . ' ; skos:inScheme ?space_' . $tc . '] . ';
             $tc++;
         }
     }
     $doc = $this->getFilledTemplate($t, $t_vals, $n['doc_base']);
     $this->addTs(ARC2::getTriplesFromIndex($doc));
 }
开发者ID:helenadeus,项目名称:s3db.map,代码行数:31,代码来源:ARC2_RelTagSkosExtractor.php

示例5: match

 public function match($pathinfo)
 {
     $allow = array();
     $pathinfo = rawurldecode($pathinfo);
     $context = $this->context;
     $request = $this->request;
     if (0 === strpos($pathinfo, '/noticias')) {
         // noticias
         if (rtrim($pathinfo, '/') === '/noticias') {
             if (substr($pathinfo, -1) !== '/') {
                 return $this->redirect($pathinfo . '/', 'noticias');
             }
             return array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\noticiasController::indexAction', '_route' => 'noticias');
         }
         // noticias_show
         if (preg_match('#^/noticias/(?P<id>[^/]++)/show$#s', $pathinfo, $matches)) {
             return $this->mergeDefaults(array_replace($matches, array('_route' => 'noticias_show')), array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\noticiasController::showAction'));
         }
         // noticias_new
         if ($pathinfo === '/noticias/new') {
             return array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\noticiasController::newAction', '_route' => 'noticias_new');
         }
         // noticias_create
         if ($pathinfo === '/noticias/create') {
             if ($this->context->getMethod() != 'POST') {
                 $allow[] = 'POST';
                 goto not_noticias_create;
             }
             return array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\noticiasController::createAction', '_route' => 'noticias_create');
         }
         not_noticias_create:
         // noticias_edit
         if (preg_match('#^/noticias/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) {
             return $this->mergeDefaults(array_replace($matches, array('_route' => 'noticias_edit')), array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\noticiasController::editAction'));
         }
         // noticias_update
         if (preg_match('#^/noticias/(?P<id>[^/]++)/update$#s', $pathinfo, $matches)) {
             if (!in_array($this->context->getMethod(), array('POST', 'PUT'))) {
                 $allow = array_merge($allow, array('POST', 'PUT'));
                 goto not_noticias_update;
             }
             return $this->mergeDefaults(array_replace($matches, array('_route' => 'noticias_update')), array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\noticiasController::updateAction'));
         }
         not_noticias_update:
         // noticias_delete
         if (preg_match('#^/noticias/(?P<id>[^/]++)/delete$#s', $pathinfo, $matches)) {
             if (!in_array($this->context->getMethod(), array('POST', 'DELETE'))) {
                 $allow = array_merge($allow, array('POST', 'DELETE'));
                 goto not_noticias_delete;
             }
             return $this->mergeDefaults(array_replace($matches, array('_route' => 'noticias_delete')), array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\noticiasController::deleteAction'));
         }
         not_noticias_delete:
         // uni_marca_homepage
         if ($pathinfo === '/noticias') {
             return array('_controller' => 'uni\\bundle\\marcaBundle\\Controller\\DefaultController::indexAction', '_route' => 'uni_marca_homepage');
         }
     }
     throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
 }
开发者ID:iker24,项目名称:marca,代码行数:60,代码来源:appProdUrlMatcher.php

示例6: action

 public function action($what, $cat, &$ret, $limit, $useGlobalCats)
 {
     $category = !$useGlobalCats && $cat && array_key_exists($cat, $this->categories) ? $this->categories[$cat] : $this->categories['all'];
     $searchUrl = $this->url . '/browse.php?search=' . $what . '&page=0&cat=' . $category;
     $cli = $this->fetch($searchUrl, false);
     if (!$cli) {
         $this->sendSimpleResult('error', 'Error connecting to bitsoup', $ret);
         return;
     }
     if (strpos($cli->results, '<h2>Search results for "' . rawurldecode($what) . '"</h2>') === false) {
         $this->sendSimpleResult('noresults', 'No results could be parsed from Bitsoup', $ret);
         return;
     }
     list($totalRowCount, $rows) = $this->countRows($cli->results);
     if ($totalRowCount === null) {
         $this->sendSimpleResult('noresults', 'Result table could not be parsed from Bitsoup', $ret);
         return;
     }
     if ($totalRowCount === 0) {
         $this->sendSimpleResult('noresults', 'No results found', $ret);
         return;
     }
     list($rowsParsed, $unMatchedRows) = $this->processResults($rows, $ret);
     if ($rowsParsed === null) {
         $this->sendSimpleResult('noresults', 'No results could be parsed from Bitsoup', $ret);
         return;
     }
     if ($rowsParsed < $totalRowCount) {
         $this->sendSimpleResult('resultCount', 'Warning: detected ' . $totalRowCount . ' but could parsed just ' . $rowsParsed . ' results', $ret, $this->getDataUrlForUnmatchedRows($unMatchedRows));
     }
 }
开发者ID:limerainne,项目名称:ruTorrent,代码行数:31,代码来源:Bitsoup.php

示例7: addAuthHeaders

 public function addAuthHeaders(BeforeEvent $event)
 {
     /*
      * Get Consumer ID and Private Key from auth and then unset it
      */
     $auth = $event->getClient()->getDefaultOption('auth');
     if ($auth === null) {
         throw new \Exception('Http client is missing \'auth\' parameters', 1466965269);
     }
     $consumerId = $auth[0];
     $privateKey = $auth[1];
     $event->getClient()->setDefaultOption('auth', null);
     /*
      * Get Request URL, method, and timestamp to calculate signature
      */
     $requestUrl = $event->getRequest()->getUrl();
     //decode url back to normal to nextCursor issue. automatic url encoding
     $requestUrl = rawurldecode($requestUrl);
     $event->getRequest()->setUrl($requestUrl);
     $requestMethod = $event->getRequest()->getMethod();
     $timestamp = Utils::getMilliseconds();
     $signature = Signature::calculateSignature($consumerId, $privateKey, $requestUrl, $requestMethod, $timestamp);
     /*
      * Add required headers to request
      */
     $headers = ['WM_SVC.NAME' => 'Walmart Marketplace', 'WM_QOS.CORRELATION_ID' => base64_encode(Random::string(16)), 'WM_SEC.TIMESTAMP' => $timestamp, 'WM_SEC.AUTH_SIGNATURE' => $signature, 'WM_CONSUMER.ID' => $consumerId];
     $currentHeaders = $event->getRequest()->getHeaders();
     unset($currentHeaders['Authorization']);
     $updatedHeaders = array_merge($currentHeaders, $headers);
     $event->getRequest()->setHeaders($updatedHeaders);
 }
开发者ID:fillup,项目名称:walmart-partner-api-sdk-php,代码行数:31,代码来源:AuthSubscriber.php

示例8: dispatch

 /**
  * Tries to find a route matching the current request. If found the defined action is called.
  */
 protected function dispatch()
 {
     $httpMethod = $_SERVER['REQUEST_METHOD'];
     $uri = rawurldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));
     $routeInfo = $this->dispatcher->dispatch($httpMethod, $uri);
     if (!isset($routeInfo[0])) {
         throw new RuntimeException('Could not dispatch request.');
     }
     switch ($routeInfo[0]) {
         case FastRoute\Dispatcher::NOT_FOUND:
             $responder = new NotFoundResponder($this->config);
             $responder->__invoke();
             break;
         case FastRoute\Dispatcher::METHOD_NOT_ALLOWED:
             $responder = new HttpResponder($this->config);
             $responder->methodNotAllowed();
             break;
         case FastRoute\Dispatcher::FOUND:
             $handler = $routeInfo[1];
             $arguments = $routeInfo[2];
             $this->runAction($handler, $arguments);
             break;
         default:
             throw new RuntimeException('Could not dispatch request.');
     }
 }
开发者ID:nekudo,项目名称:shiny_blog,代码行数:29,代码来源:ShinyBlog.php

示例9: smarty_insert_oxid_nocache

/**
 * Smarty plugin
 * -------------------------------------------------------------
 * File: insert.oxid_nocache.php
 * Type: string, html
 * Name: oxid_nocache
 * Purpose: Inserts Items not cached
 * -------------------------------------------------------------
 *
 * @param array  $params  params
 * @param Smarty &$smarty clever simulation of a method
 *
 * @return string
 */
function smarty_insert_oxid_nocache($params, &$smarty)
{
    $myConfig = oxRegistry::getConfig();
    $smarty->caching = false;
    /* if( isset( $smarty->oxobject->oProduct))
       $smarty->assign_by_ref( "product", $smarty->oxobject->oProduct);*/
    // #1184M - specialchar search
    $sSearchParamForHTML = oxRegistry::getConfig()->getRequestParameter("searchparam");
    $sSearchParamForLink = rawurlencode(oxRegistry::getConfig()->getRequestParameter("searchparam", true));
    if ($sSearchParamForHTML) {
        $smarty->assign_by_ref("searchparamforhtml", $sSearchParamForHTML);
        $smarty->assign_by_ref("searchparam", $sSearchParamForLink);
    }
    $sSearchCat = oxRegistry::getConfig()->getRequestParameter("searchcnid");
    if ($sSearchCat) {
        $smarty->assign_by_ref("searchcnid", rawurldecode($sSearchCat));
    }
    foreach (array_keys($params) as $key) {
        $viewData =& $params[$key];
        $smarty->assign_by_ref($key, $viewData);
    }
    $sOutput = $smarty->fetch($params['tpl']);
    $smarty->caching = false;
    return $sOutput;
}
开发者ID:ioanok,项目名称:symfoxid,代码行数:39,代码来源:insert.oxid_nocache.php

示例10: execute

 function execute($par)
 {
     global $wgRequest, $wgEmailImage;
     $size = 4;
     $text = $wgRequest->getText('img');
     /* decode this rubbish */
     $text = rawurldecode($text);
     $text = str_rot13($text);
     $text = base64_decode($text);
     $text = str_replace($wgEmailImage['ugly'], "", $text);
     $fontwidth = imagefontwidth($size);
     $fontheight = imagefontheight($size);
     $width = strlen($text) * $fontwidth + 4;
     $height = $fontheight + 2;
     $im = @imagecreatetruecolor($width, $height) or exit;
     $trans = imagecolorallocate($im, 0, 0, 0);
     /* must be black! */
     $color = imagecolorallocate($im, 1, 1, 1);
     /* nearly black ;) */
     imagecolortransparent($im, $trans);
     /* seems to work only with black! */
     imagestring($im, $size, 2, 0, $text, $color);
     //header ("Content-Type: image/png"); imagepng($im); => IE is just so bad!
     header("Content-Type: image/gif");
     imagegif($im);
     exit;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:27,代码来源:emailtag.php

示例11: vote

 public function vote(TokenInterface $token, $object, array $attributes)
 {
     $request = null;
     try {
         $request = $this->app['request'];
     } catch (\RuntimeException $e) {
         // requestが取得できない場合、無視する(テストプログラムで不要なため)
         return;
     }
     $path = rawurldecode($request->getPathInfo());
     $Member = $this->app->user();
     if ($Member instanceof \Eccube\Entity\Member) {
         // 管理者のロールをチェック
         $AuthorityRoles = $this->app['eccube.repository.authority_role']->findBy(array('Authority' => $Member->getAuthority()));
         foreach ($AuthorityRoles as $AuthorityRole) {
             // 許可しないURLが含まれていればアクセス拒否
             try {
                 // 正規表現でURLチェック
                 $denyUrl = str_replace('/', '\\/', $AuthorityRole->getDenyUrl());
                 if (preg_match("/^(\\/{$this->app['config']['admin_route']}{$denyUrl})/i", $path)) {
                     return VoterInterface::ACCESS_DENIED;
                 }
             } catch (\Exception $e) {
                 // 拒否URLの指定に誤りがある場合、エスケープさせてチェック
                 $denyUrl = preg_quote($AuthorityRole->getDenyUrl(), '/');
                 if (preg_match("/^(\\/{$this->app['config']['admin_route']}{$denyUrl})/i", $path)) {
                     return VoterInterface::ACCESS_DENIED;
                 }
             }
         }
     }
     return VoterInterface::ACCESS_GRANTED;
 }
开发者ID:ec-cube,项目名称:ec-cube,代码行数:33,代码来源:AuthorityVoter.php

示例12: createTorrent

 public static function createTorrent($torrent, $hash)
 {
     global $saveUploadedTorrents;
     $torrent = new Torrent($torrent);
     if ($torrent->errors()) {
         return self::STE_DELETED;
     }
     if ($torrent->hash_info() == $hash) {
         return self::STE_UPTODATE;
     }
     $req = new rXMLRPCRequest(array(new rXMLRPCCommand("d.get_directory_base", $hash), new rXMLRPCCommand("d.get_custom1", $hash), new rXMLRPCCommand("d.get_throttle_name", $hash), new rXMLRPCCommand("d.get_connection_seed", $hash), new rXMLRPCCommand("d.is_open", $hash), new rXMLRPCCommand("d.is_active", $hash), new rXMLRPCCommand("d.get_state", $hash), new rXMLRPCCommand("d.stop", $hash), new rXMLRPCCommand("d.close", $hash)));
     if ($req->success()) {
         $addition = array(getCmd("d.set_connection_seed=") . $req->val[3], getCmd("d.set_custom") . "=chk-state," . self::STE_UPDATED, getCmd("d.set_custom") . "=chk-time," . time(), getCmd("d.set_custom") . "=chk-stime," . time());
         $isStart = $req->val[4] != 0 && $req->val[5] != 0 && $req->val[6] != 0;
         if (!empty($req->val[2])) {
             $addition[] = getCmd("d.set_throttle_name=") . $req->val[2];
         }
         if (preg_match('/rat_(\\d+)/', $req->val[3], $ratio)) {
             $addition[] = getCmd("view.set_visible=") . "rat_" . $ratio;
         }
         $label = rawurldecode($req->val[1]);
         if (rTorrent::sendTorrent($torrent, $isStart, false, $req->val[0], $label, $saveUploadedTorrents, false, true, $addition)) {
             $req = new rXMLRPCRequest(new rXMLRPCCommand("d.erase", $hash));
             if ($req->success()) {
                 return null;
             }
         }
     }
     return self::STE_ERROR;
 }
开发者ID:limerainne,项目名称:ruTorrent,代码行数:30,代码来源:check.php

示例13: urlToArgs

 /**
  * url字符串转化为数组格式
  * 
  * 效果同'argsToUrl'相反
  * @param string $url
  * @param boolean $decode 是否需要进行url反编码处理
  * @param string $separator url的分隔符
  * @return array
  */
 public static function urlToArgs($url, $decode = true, $separator = '&=')
 {
     if (strlen($separator) !== 2) {
         return array();
     }
     if (false !== ($pos = strpos($url, '?'))) {
         $url = substr($url, $pos + 1);
     }
     $url = explode($separator[0], trim($url, $separator[0]));
     $args = array();
     if ($separator[0] === $separator[1]) {
         $_count = count($url);
         for ($i = 0; $i < $_count; $i += 2) {
             if (!isset($url[$i + 1])) {
                 $args[] = $decode ? rawurldecode($url[$i]) : $url[$i];
                 continue;
             }
             $_k = $decode ? rawurldecode($url[$i]) : $url[$i];
             $_v = $decode ? rawurldecode($url[$i + 1]) : $url[$i + 1];
             $args[$_k] = $_v;
         }
     } else {
         foreach ($url as $value) {
             if (strpos($value, $separator[1]) === false) {
                 $args[] = $decode ? rawurldecode($value) : $value;
                 continue;
             }
             list($__k, $__v) = explode($separator[1], $value);
             $args[$__k] = $decode && $__v ? rawurldecode($__v) : $__v;
         }
     }
     return $args;
 }
开发者ID:latticet,项目名称:EduSoho_jb51,代码行数:42,代码来源:WindUrlHelper.php

示例14: set

 public function set()
 {
     if (!isset($HTTP_RAW_POST_DATA)) {
         $HTTP_RAW_POST_DATA = file_get_contents("php://input");
     }
     if (isset($HTTP_RAW_POST_DATA)) {
         $vars = explode('&', $HTTP_RAW_POST_DATA);
         $this->list = array();
         foreach ($vars as $var) {
             $parts = explode("=", $var);
             if ($parts[0] == "look") {
                 $value = trim(rawurldecode($parts[1]));
                 if (strlen($value)) {
                     $tmp = explode("|", $value);
                     if (count($tmp > 1) && trim($tmp[1]) != '') {
                         if (strpos($tmp[1], "{title}") === false) {
                             $tmp[1] .= "{title}";
                         }
                         $this->list[$tmp[0]] = $tmp[1];
                     }
                 }
             }
         }
     }
     $this->store();
 }
开发者ID:Rapiddot,项目名称:ruTorrent,代码行数:26,代码来源:lookat.php

示例15: fma_filter

function fma_filter($type, $filename, $Extension)
{
    $autorise = false;
    $error = "";
    if ($type == "f") {
        $filename = removeHack($filename);
    }
    $filename = preg_replace('#[/\\\\:\\*\\?"<>|]#i', '', rawurldecode($filename));
    $filename = str_replace("..", "", $filename);
    // Liste des extensions autorisées
    $suffix = strtoLower(substr(strrchr($filename, '.'), 1));
    if ($suffix != "" or $type == "d") {
        if (in_array($suffix, $Extension) or $Extension[0] == "*" or $type == "d") {
            // Fichiers interdits en fonction de qui est connecté
            if (fma_autorise($type, $filename)) {
                $autorise = true;
            } else {
                $error = fma_translate("Fichier interdit");
            }
        } else {
            $error = fma_translate("Type de fichier interdit");
        }
    } else {
        $error = fma_translate("Fichier interdit");
    }
    $tab[] = $autorise;
    $tab[] = $error;
    $tab[] = $filename;
    return $tab;
}
开发者ID:Jireck-npds,项目名称:npds_dune,代码行数:30,代码来源:pic-manager.php


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