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


PHP base64url_decode函数代码示例

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


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

示例1: file

 public function file($str = '')
 {
     $this->load->library('EncryptionX', array(), 'encryption');
     $this->encryption->key($this->config->item('encryption_key', 'app'));
     $expiryDate = date('D, d M Y H:i:s e', time() + 3600 * 24 * 30);
     header('Cache-Control: max-age=86400');
     header('Expires: ' . $expiryDate);
     $nstr = explode('||', $this->encryption->decode(base64url_decode($str)));
     if (count($nstr) != 5) {
         return show_404();
     }
     $size = $nstr[1] . 'x' . $nstr[2];
     $type = $nstr[3];
     $global = round($nstr[4]);
     $arrf = explode('/', $nstr[0]);
     if (count($arrf) != 3) {
         return show_404();
     }
     $year = $arrf[0];
     $month = $arrf[1];
     $file = $arrf[2];
     $this->load->config('app', TRUE);
     $folder = $this->config->item('uploads-global', 'app');
     if (!$global || !$folder) {
         $folder = $this->config->item('uploads', 'app');
     }
     $date_y = date('Y/m/d', strtotime("-1 day"));
     $filef = "{$folder}thumbs/{$date_y}/{$size}-{$file}";
     $version = $this->config->item('upload-version', 'app') . '.' . date('H');
     $mime = get_mime($filef);
     if ($mime) {
         header("Content-Type: {$mime}");
         readfile($filef);
         exit;
     }
     $date = date('Y/m/d');
     $filef = "{$folder}thumbs/{$date}/{$size}-{$file}";
     $mime = get_mime($filef);
     if ($mime) {
         header("Content-Type: {$mime}");
         readfile($filef);
         exit;
     }
     $thumbFolder = "{$folder}thumbs/{$date}/";
     if (!is_dir($thumbFolder)) {
         mkdir($thumbFolder, 0777, true);
     }
     $this->load->library('image');
     $fileb = "{$folder}{$year}/{$month}/{$file}";
     if (!file_exists($fileb)) {
         return show_404();
     }
     @unlink("{$folder}thumbs/{$date}/{$size}-{$file}");
     $function = $type == 'thumb' ? 'resize' : 'resize_crop';
     $this->image->load($fileb)->set_jpeg_quality(100)->{$function}($nstr[1], $nstr[2])->save("{$folder}thumbs/{$date}/{$size}-{$file}")->clear();
     $mime = get_mime($filef);
     header("Content-Type: {$mime}");
     readfile($filef);
     exit;
 }
开发者ID:juanazareno,项目名称:piscis,代码行数:60,代码来源:FilesP.php

示例2: get

 function get()
 {
     if (!local_channel()) {
         killme();
     }
     if (argc() > 2 && intval(argv(1)) && argv(2)) {
         $r = q("SELECT abook_xchan from abook where abook_xchan = '%s' and abook_channel = %d and abook_self = 0 limit 1", dbesc(base64url_decode(argv(2))), intval(local_channel()));
         if ($r) {
             $change = $r[0]['abook_xchan'];
         }
     }
     if (argc() > 1 && intval(argv(1))) {
         $r = q("SELECT * FROM `groups` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1", intval(argv(1)), intval(local_channel()));
         if (!$r) {
             killme();
         }
         $group = $r[0];
         $members = group_get_members($group['id']);
         $preselected = array();
         if (count($members)) {
             foreach ($members as $member) {
                 $preselected[] = $member['xchan_hash'];
             }
         }
         if ($change) {
             if (in_array($change, $preselected)) {
                 group_rmv_member(local_channel(), $group['gname'], $change);
             } else {
                 group_add_member(local_channel(), $group['gname'], $change);
             }
         }
     }
     killme();
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:34,代码来源:Contactgroup.php

示例3: post

 function post()
 {
     $hash = $_POST['hash'];
     $time = $_POST['time'];
     $sig = $_POST['signature'];
     $resource = $_POST['resource'];
     $revision = intval($_POST['revision']);
     if (!$hash) {
         killme();
     }
     $channel = channelx_by_hash($hash);
     if (!$channel || !$time || !$sig) {
         killme();
     }
     $slop = intval(get_pconfig($channel['channel_id'], 'system', 'getfile_time_slop'));
     if ($slop < 1) {
         $slop = 3;
     }
     $d1 = datetime_convert('UTC', 'UTC', "now + {$slop} minutes");
     $d2 = datetime_convert('UTC', 'UTC', "now - {$slop} minutes");
     if ($time > $d1 || $time < $d2) {
         logger('time outside allowable range');
         killme();
     }
     if (!rsa_verify($hash . '.' . $time, base64url_decode($sig), $channel['channel_pubkey'])) {
         logger('verify failed.');
         killme();
     }
     $r = attach_by_hash($resource, $revision);
     if (!$r['success']) {
         notice($r['message'] . EOL);
         return;
     }
     $unsafe_types = array('text/html', 'text/css', 'application/javascript');
     if (in_array($r['data']['filetype'], $unsafe_types)) {
         header('Content-type: text/plain');
     } else {
         header('Content-type: ' . $r['data']['filetype']);
     }
     header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
     if (intval($r['data']['os_storage'])) {
         $fname = dbunescbin($r['data']['data']);
         if (strpos($fname, 'store') !== false) {
             $istream = fopen($fname, 'rb');
         } else {
             $istream = fopen('store/' . $channel['channel_address'] . '/' . $fname, 'rb');
         }
         $ostream = fopen('php://output', 'wb');
         if ($istream && $ostream) {
             pipe_streams($istream, $ostream);
             fclose($istream);
             fclose($ostream);
         }
     } else {
         echo dbunescbin($r['data']['data']);
     }
     killme();
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:58,代码来源:Getfile.php

示例4: oembed_content

function oembed_content(&$a)
{
    if ($a->argc == 2) {
        echo "<html><body>";
        $url = base64url_decode($a->argv[1]);
        $j = oembed_fetch_url($url);
        echo $j->html;
        echo "</body></html>";
    }
    killme();
}
开发者ID:nphyx,项目名称:friendica,代码行数:11,代码来源:oembed.php

示例5: import

 public function import($id1_)
 {
     Logger::debug('main', "UserGroupDB::ldap_memberof::import (id = {$id1_})");
     if (is_base64url($id1_)) {
         $id_ = base64url_decode($id1_);
     } else {
         $id_ = $id1_;
     }
     $prefs = Preferences::getInstance();
     if (!$prefs) {
         die_error('get Preferences failed', __FILE__, __LINE__);
     }
     $config_ldap = $prefs->get('UserDB', 'ldap');
     $config_ldap['match'] = array();
     if (array_key_exists('match', $this->preferences)) {
         $config_ldap['match'] = $this->preferences['match'];
     }
     if (str_endswith(strtolower($id_), strtolower($config_ldap['suffix'])) === true) {
         $id2 = substr($id_, 0, -1 * strlen($config_ldap['suffix']) - 1);
     } else {
         $id2 = $id_;
     }
     $expl = explode(',', $id2, 2);
     if (count($expl) == 1) {
         $expl = array($id2, '');
     }
     $config_ldap['userbranch'] = $expl[1];
     $buf = $config_ldap['match'];
     $buf['id'] = $id_;
     $ldap = new LDAP($config_ldap);
     $sr = $ldap->search($expl[0], array_keys($config_ldap['match']));
     if ($sr === false) {
         Logger::error('main', "UserGroupDB::ldap_memberof::import search failed for ({$id_})");
         return NULL;
     }
     $infos = $ldap->get_entries($sr);
     if ($infos === array()) {
         Logger::error('main', "UserGroupDB::ldap_memberof::import get_entries failed for ({$id_})");
         return NULL;
     }
     $keys = array_keys($infos);
     $dn = $keys[0];
     $info = $infos[$dn];
     foreach ($config_ldap['match'] as $attribut => $match_ldap) {
         if (isset($info[$match_ldap][0])) {
             $buf[$attribut] = $info[$match_ldap][0];
         }
     }
     $ug = new UsersGroup($buf['id'], $buf['name'], $buf['description'], true);
     return $ug;
 }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:51,代码来源:ldap_memberof.php

示例6: loadcomment

function loadcomment($id, $number)
{
    include '../page/protection.php';
    include '../page/db.php';
    $id = (int) base64url_decode($id);
    $sql = "SELECT * FROM Comments WHERE ID='{$id}'";
    $data = mysqli_query($conn, $sql);
    $data = mysqli_fetch_assoc($data);
    $userid = $data['UserID'];
    $usersql = "SELECT UserName,ProfilePicture FROM UserAccounts WHERE RowID='{$userid}'";
    $userdata = mysqli_query($conn, $usersql);
    $userdata = mysqli_fetch_assoc($userdata);
    $user = $userdata['UserName'];
    $comment = $data['Comment'];
    $space = "&emsp;";
    $postdate = date_create($data['CreateDate']);
    $postdate = date_format($postdate, 'm/d/Y g:ia');
    $modifieddate = date_create($data['ModifiedDate']);
    $modifieddate = date_format($modifieddate, 'm/d/Y g:ia');
    if ($userid === $_SESSION['id']) {
        $poster = "<span style=\"float:right;padding-right:10px;\" class=\"link2\"><a href=\"/admin/CommentDelete?a=" . base64url_encode($id) . "\">Delete</a></span>";
    }
    if ($data['Edited']) {
        $time = "<span style=\"float:right;\">Edited: " . $modifieddate . "</span>";
    } else {
        $time = "<span style=\"float:right;\">Posted: " . $postdate . "</span>";
    }
    $text .= "\n\t\t\t<div class=\"commentshadow\" id=\"comment-{$id}\">\n\t\t\t<div class=\"commenttitle\">#{$number} " . $time . $poster . "</div>\n\t\t\t<div class=\"fullcomment\">\n\t\t\t<!--<hr class=\"commenthr\">-->\n\t\t\t<div class=\"commentimage\">\n\t\t";
    $text .= "<div class=\"commentimageinner\"><span class=\"profilepichelper\"></span>";
    if (strlen($userdata['ProfilePicture'])) {
        $text .= "<img src=\"/account/ProfilePictureShow?a=" . base64url_encode($userid) . "\" class=\"commentpic\">";
    } else {
        $text .= "<img src=\"/theme/grey-question-mark.png\" class=\"commentpic hideLight\">";
        $text .= "<img src=\"/theme/darkgrey-question-mark.png\" class=\"commentpic hideDark\">";
    }
    $text .= "</div>";
    $text .= "\n\t\t\t</div>\n\t\t\t\t<div class=\"commentusername\"><span class=\"link3\"><a href=\"/account/Profile?a=" . base64url_encode($userid) . "\">{$user}</a></span></div>\n\t\t";
    include '../page/BBCode.php';
    if (isset($comment)) {
        $comment = decrypt($comment);
        $comment = strip_tags($comment);
        $comment = preg_replace('/\\r\\n?/', "\n<br />", $comment);
        $comment = bb_parse($comment);
    } else {
        $comment = '';
    }
    $text .= "<div class=\"comment\">" . $comment . "</div></div></div>";
    mysqli_close($conn);
    return $text;
}
开发者ID:Chris221,项目名称:My-Site,代码行数:50,代码来源:Comment.php

示例7: import

 public function import($id_)
 {
     if (is_base64url($id_)) {
         $id_ = base64url_decode($id_);
     }
     Logger::debug('main', 'UserGroupDB::import(' . $id_ . ')');
     foreach ($this->instance_type as $key => $value) {
         if (str_startswith($id_, $key . '_')) {
             return $value->import(substr($id_, strlen($key) + 1));
         }
     }
     return NULL;
     // not found
 }
开发者ID:skdong,项目名称:nfs-ovd,代码行数:14,代码来源:UserGroupDB.php

示例8: process

 /**
  * 处理上传
  *
  * @access public
  */
 public function process()
 {
     $param = Request::only('authkey', 'args');
     $config = @unserialize(base64url_decode($param['args']));
     $uploadObject = new UploadManager();
     if (!$uploadObject->setParam($config)->checkUploadToken($param['authkey'])) {
         return abort(500);
     }
     $file = Request::file('file');
     $returnFileUrl = $uploadObject->setFile($file)->upload();
     if (!$returnFileUrl) {
         return abort(500);
     }
     $this->saveFile($returnFileUrl, $file);
     return response()->json(['file' => implode('|', $returnFileUrl)]);
 }
开发者ID:pfdtk,项目名称:bmsys,代码行数:21,代码来源:UploadController.php

示例9: process

 /**
  * 处理上传
  */
 public function process()
 {
     $parpams = Request::only('authkey', 'args');
     $config = @unserialize(base64url_decode($parpams['args']));
     //检测请求是否合法
     $uploadObject = new UploadManager();
     if (!$uploadObject->setParam($config)->checkUploadToken($parpams['authkey'])) {
         return abort(500);
     }
     //开始处理上传
     $file = Request::file('file');
     $returnFileUrl = $uploadObject->setFile($file)->upload();
     if (!$returnFileUrl) {
         return abort(500);
     }
     return response()->json(['file' => $returnFileUrl]);
 }
开发者ID:mikegit2014,项目名称:laravelback,代码行数:20,代码来源:UploadController.php

示例10: oembed_init

function oembed_init(&$a)
{
    // logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
    if (argc() > 1) {
        if (argv(1) == 'b2h') {
            $url = array("", trim(hex2bin($_REQUEST['url'])));
            echo oembed_replacecb($url);
            killme();
        } elseif (argv(1) == 'h2b') {
            $text = trim(hex2bin($_REQUEST['text']));
            echo oembed_html2bbcode($text);
            killme();
        } else {
            echo "<html><body>";
            $j = oembed_fetch_url(base64url_decode(argv(1)));
            echo $j->html;
            //		    logger('mod-oembed ' . $j->html, LOGGER_ALL);
            echo "</body></html>";
        }
    }
    killme();
}
开发者ID:Mauru,项目名称:red,代码行数:22,代码来源:oembed.php

示例11: body

 /**
  * Update item by his id
  * @return void
  */
 public function body()
 {
     //product id
     $id = $this->uri->segment(4);
     $email = base64url_decode($this->uri->segment(5));
     $bodymail = $this->Imap_model->get_newsletter_email_by_email($email);
     $this->load->config('imap');
     //echo '<pre>'; print_r($bodymail); die;
     $config['imap_server'] = $this->config->item('mailbox');
     $config['imap_user'] = $bodymail[0]['email'];
     $config['imap_pass'] = decrypt($bodymail[0]['password']);
     $config['imap_folder'] = 'INBOX';
     // Load the IMAP Library
     $this->Imap_model->imap($config);
     $body = $this->Imap_model->imap_read_body($id);
     //echo $body; die;
     $this->Imap_model->close_imap();
     $data['email'] = $bodymail[0]['email'];
     $data['body'] = $body;
     $data['main_content'] = 'kd2a2a0u1g4/email_inbox/body';
     $this->load->view('kd2a2a0u1g4/includes/template', $data);
 }
开发者ID:bhushansonar,项目名称:knewdog.com,代码行数:26,代码来源:cron_email_issues+_12_1_2015.php

示例12: oembed_content

function oembed_content(&$a)
{
    // logger('mod_oembed ' . $a->query_string, LOGGER_ALL);
    if ($a->argv[1] == 'b2h') {
        $url = array("", trim(hex2bin($_REQUEST['url'])));
        echo oembed_replacecb($url);
        killme();
    }
    if ($a->argv[1] == 'h2b') {
        $text = trim(hex2bin($_REQUEST['text']));
        echo oembed_html2bbcode($text);
        killme();
    }
    if ($a->argc == 2) {
        echo "<html><body>";
        $url = base64url_decode($a->argv[1]);
        $j = oembed_fetch_url($url);
        echo $j->html;
        //		logger('mod-oembed ' . $j->html, LOGGER_ALL);
        echo "</body></html>";
    }
    killme();
}
开发者ID:ZerGabriel,项目名称:friendica,代码行数:23,代码来源:oembed.php

示例13: init

 function init()
 {
     // logger('mod_oembed ' . \App::$query_string, LOGGER_ALL);
     if (argc() > 1) {
         if (argv(1) == 'b2h') {
             $url = array("", trim(hex2bin($_REQUEST['url'])));
             echo oembed_replacecb($url);
             killme();
         } elseif (argv(1) == 'h2b') {
             $text = trim(hex2bin($_REQUEST['text']));
             echo oembed_html2bbcode($text);
             killme();
         } else {
             echo "<html><head><base target=\"_blank\" /></head><body>";
             $src = base64url_decode(argv(1));
             $j = oembed_fetch_url($src);
             echo $j['html'];
             //		    logger('mod-oembed ' . $h, LOGGER_ALL);
             echo "</body></html>";
         }
     }
     killme();
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:23,代码来源:Oembed.php

示例14: private_messages_fetch_conversation

function private_messages_fetch_conversation($channel_id, $messageitem_id, $updateseen = false)
{
    // find the parent_mid of the message being requested
    $r = q("SELECT parent_mid from mail WHERE channel_id = %d and id = %d limit 1", intval($channel_id), intval($messageitem_id));
    if (!$r) {
        return array();
    }
    $messages = q("select * from mail where parent_mid = '%s' and channel_id = %d order by created asc", dbesc($r[0]['parent_mid']), intval($channel_id));
    if (!$messages) {
        return array();
    }
    $chans = array();
    foreach ($messages as $rr) {
        $s = "'" . dbesc(trim($rr['from_xchan'])) . "'";
        if (!in_array($s, $chans)) {
            $chans[] = $s;
        }
        $s = "'" . dbesc(trim($rr['to_xchan'])) . "'";
        if (!in_array($s, $chans)) {
            $chans[] = $s;
        }
    }
    $c = q("select * from xchan where xchan_hash in (" . implode(',', $chans) . ")");
    foreach ($messages as $k => $message) {
        $messages[$k]['from'] = find_xchan_in_array($message['from_xchan'], $c);
        $messages[$k]['to'] = find_xchan_in_array($message['to_xchan'], $c);
        if (intval($messages[$k]['mail_obscured'])) {
            if ($messages[$k]['title']) {
                $messages[$k]['title'] = base64url_decode(str_rot47($messages[$k]['title']));
            }
            if ($messages[$k]['body']) {
                $messages[$k]['body'] = base64url_decode(str_rot47($messages[$k]['body']));
            }
        }
    }
    if ($updateseen) {
        $r = q("UPDATE `mail` SET mail_seen = 1 where mail_seen = 0 and parent_mid = '%s' AND channel_id = %d", dbesc($r[0]['parent_mid']), intval($channel_id));
    }
    return $messages;
}
开发者ID:23n,项目名称:hubzilla,代码行数:40,代码来源:message.php

示例15: FreshRSS_feed_Controller

$system_conf->auth_type = 'none';
// avoid necessity to be logged in (not saved!)
Minz_Translate::init('en');
Minz_Request::_param('ajax', true);
$feedController = new FreshRSS_feed_Controller();
$simplePie = customSimplePie();
$simplePie->set_raw_data($ORIGINAL_INPUT);
$simplePie->init();
unset($ORIGINAL_INPUT);
$links = $simplePie->get_links('self');
$self = isset($links[0]) ? $links[0] : null;
if ($self !== base64url_decode($canonical64)) {
    //header('HTTP/1.1 422 Unprocessable Entity');
    logMe('Warning: Self URL [' . $self . '] does not match registered canonical URL!: ' . base64url_decode($canonical64));
    //die('Self URL does not match registered canonical URL!');
    $self = base64url_decode($canonical64);
}
Minz_Request::_param('url', $self);
$nb = 0;
foreach ($users as $userFilename) {
    $username = basename($userFilename, '.txt');
    if (!file_exists(USERS_PATH . '/' . $username . '/config.php')) {
        break;
    }
    try {
        Minz_Session::_param('currentUser', $username);
        Minz_Configuration::register('user', join_path(USERS_PATH, $username, 'config.php'), join_path(USERS_PATH, '_', 'config.default.php'));
        FreshRSS_Context::init();
        if ($feedController->actualizeAction($simplePie) > 0) {
            $nb++;
        }
开发者ID:buggithubs,项目名称:FreshRSS,代码行数:31,代码来源:pshb.php


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