function odecrypt($string, $key) { $method = 'aes-256-ofb'; $iv = substr(md5($key), 0, 16); $string = url_base64_decode($string); $string = openssl_decrypt($string, $method, $key, OPENSSL_RAW_DATA, $iv); $string = explode(':', $string, 2); if (count($string) != 2 or !is_numeric($string[0])) { return null; } $string = $string[1]; $pos = strrpos($string, ':'); if (!$pos) { return null; } return substr($string, 0, $pos); }
<?php include_once "init.php"; include_once LIB_ROOT . "Sp/View.php"; include_once LIB_ROOT . "Sp/Taobao/Goods.php"; include_once LIB_ROOT . "Sp/Taobao/Shop.php"; include_once LIB_ROOT . "Sp/Taobao/Taobaoke.php"; $sp_view = new Sp_View('utf-8'); $nick = isset($_GET['nick']) ? $_GET['nick'] : $sp_view->out_404(true); //静态编码网址转码 if (Config::get('special.static') == '1') { $nick = htmlspecialchars(url_base64_decode($nick)); } //$goods = Sp_Taobao_Shop::getCategoes($nick,0,1,10); //print_r($goods); //商铺信息 $shop_info = Sp_Taobao_Shop::getShopinfo($nick); if (isset($shop_info['shop'])) { $info = Sp_Taobao_Taobaoke::getShopsConvert($shop_info['shop']['sid'], Config::get('taoke.pid_short')); $click_url = $info['taobaoke_shops']['taobaoke_shop']['click_url']; $shop_info['shop']['click_url'] = $click_url; } //商店商品分类信息 $goods = Sp_Taobao_Goods::getShopItems($nick, null, 1, 1); //按分类产品数量倒序 $category = $goods['item_search']['item_categories']['item_category']; $category = array_sort($category, 'count', 'desc'); //最多取8个分类的商品,并且每个分类下的产品数量要大于4 $step = count($category) < 8 ? count($category) : 8; $category = array_slice($category, 0, $step); $catids = "";
$con = mysql_connect("localhost", "hobbsh", "Myp4ssw0rd"); if (!$con) { die('Could not connect: ' . mysql_error()); } ?> <h3>Step 2</h3> <ul> <li>Here you need to tell the tool how your webpage is laid out.</li> <li>Select your wrapper DIV names below - this will be the outermost DIV(s) on your page</li> <li>They are typically named with variations of "wrapper"</li> </ul> <?php $IP = $_GET['id']; $d_IP = url_base64_decode($IP); $d_IP = url_base64_decode($d_IP); function url_base64_decode(&$str = "") { return base64_decode(strtr($str, array('.' => '+', '-' => '=', '~' => '/'))); } mysql_select_db("wp_template", $con); $result = mysql_query("SELECT * FROM sites\nWHERE IP='{$d_IP}'"); $row = mysql_fetch_array($result); $data = explode(";", $row['divs']); echo "<form method=\"POST\" action=\"cgi-bin/ins.cgi\">"; echo "<p>Select your outermost div ID(s)</p>"; echo "<select name=\"divs\" title=\"Please select your wrapper DIV(s)\" width=\"400px\" multiple=\"multiple\">"; foreach ($data as $key => $value) { echo "\t\t<option>" . $value . "</option>\n"; } echo "\t</select>\n";
public function testEncodeDecode() { $string = url_base64_encode("1234567890"); $this->assertTrue($string === "MTIzNDU2Nzg5MA"); // $string = url_base64_decode($string); $this->assertTrue($string === "1234567890"); // $key = '111'; $one = xencrypt("1234567890", $key); $two = xencrypt("1234567890", $key); $this->assertTrue($one and $two and $one != $two); $this->assertTrue(xdecrypt($one, $key) === "1234567890"); $this->assertTrue(xdecrypt($two, $key) === "1234567890"); $this->assertTrue(!xdecrypt($two, $key . '1')); // $string = base32_encode("1234567890"); $this->assertTrue(!!preg_match('~^[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]+$~', $string)); // $string = base32_decode($string); $this->assertTrue($string === "1234567890"); // $key = '111'; $one = oencrypt("1234567890", $key); $two = oencrypt("1234567890", $key); $this->assertTrue($one and $two and $one != $two); $this->assertTrue(odecrypt($one, $key) === "1234567890"); $this->assertTrue(odecrypt($two, $key) === "1234567890"); $this->assertTrue(!odecrypt($two, $key . '1')); }
function json_url_base64_decode($dados) { return json_decode(url_base64_decode($dados)); }
include_once LIB_ROOT . "Sp/Taobao/Goods.php"; include_once LIB_ROOT . "Sp/Taobao/Shop.php"; //list-1801-0-1-10000-w!bEpA-2.html $cache_id = 'list|' . md5(var_export($_GET, true)); $sp_view = new Sp_View('utf-8'); if (!$sp_view->isCached('list.html', $cache_id)) { $cid = isset($_GET['catid']) ? $_GET['catid'] : 0; $sort = isset($_GET['sort']) ? $_GET['sort'] : 1; $start_price = isset($_GET['sp']) ? $_GET['sp'] : Config::get('special.start_price'); $end_price = isset($_GET['ep']) ? $_GET['ep'] : Config::get('special.end_price'); $keyword = isset($_GET['sq']) ? $_GET['sq'] : ''; $page_no = isset($_GET['page']) ? $_GET['page'] : 1; $page_size = 36; //静态编码网址转码 if (Config::get('special.static') == '1') { $keyword = htmlspecialchars(url_base64_decode($keyword)); if ($keyword != '') { $encode_keyword = url_base64_encode($keyword); $url_format = "list-{$cid}-{$sort}-{$start_price}-{$end_price}-{$encode_keyword}-%d.html"; } else { $url_format = "list-{$cid}-{$sort}-{$start_price}-{$end_price}-%d.html"; } //$url_format = "?catid=$cid&page=%d&sq=$keyword":"?catid=$cid&page=%d"; } else { if ($keyword != '') { $url_format = "list.php?catid={$cid}&sortnum={$sort}&sp={$start_price}&ep={$end_price}&sq={$keyword}&page=%d"; } else { $url_format = "list.php?catid={$cid}&sortnum={$sort}&sp={$start_price}&ep={$end_price}&page=%d"; } } /*
function index() { $data = array(); $data['breadcrumb'] = set_crumbs(array(current_url() => 'Theme Editor')); $theme_dir = CMS_ROOT . 'themes/' . $this->settings->theme . '/'; $data['files_found'] = TRUE; $data['file_readable'] = TRUE; $data['file_writable'] = TRUE; $this->load->helper('file'); $this->load->model('theme_editor_model'); $this->template->add_stylesheet('/application/modules/settings/assets/css/theme_editor.css'); // Load CodeMirror Scripts $this->template->add_package('codemirror'); // Get theme files $data['layouts'] = $this->theme_editor_model->get_theme_files('{php, html}', 'views/layouts'); $data['partials'] = $this->theme_editor_model->get_theme_files('{php, html}', 'views/partials'); $data['stylesheets'] = $this->theme_editor_model->get_theme_files('css'); $data['javascripts'] = $this->theme_editor_model->get_theme_files('js'); // Read selected file if ($hash = $this->uri->segment(5)) { $data['file'] = $file = url_base64_decode($hash); } else { // Check if assets/css/style.css exists and load it first if no other file specified if (isset($data['stylesheets']['assets/css/style.css'])) { $data['file'] = $file = url_base64_decode($data['stylesheets']['assets/css/style.css']['hash']); } else { // There was no style.css so load first file found if any foreach (array('stylesheets', 'layouts', 'partials', 'javascripts') as $theme_type) { if (!empty($data[$theme_type])) { $file_array = current($data[$theme_type]); $data['file'] = $file = url_base64_decode($file_array['hash']); break; } } } } if (!empty($file)) { // Check if the file exists and is readable if (is_readable($theme_dir . $file)) { // Read the file $data['code'] = read_file($theme_dir . $file); // Check if file is writable if (!is_writable($theme_dir . $file)) { $data['file_writable'] = FALSE; } // Determine CodeMirror mode from extension switch (pathinfo($file, PATHINFO_EXTENSION)) { case "css": $data['mode'] = 'text/css'; break; case "js": $data['mode'] = 'text/javascript'; break; default: $data['mode'] = 'application/x-httpd-php'; break; } } else { // Flag file as not found or not readable $data['file_readable'] = FALSE; } } else { // No theme files were found $data['files_found'] = FALSE; } // Form validation $this->form_validation->set_rules('code', 'Text Area', 'required'); if ($this->form_validation->run() == TRUE) { // Write post to file if (write_file($theme_dir . $file, $this->input->post('code'))) { $this->session->set_flashdata('message', '<p class="success">File saved successfully.</p>'); } else { $this->session->set_flashdata('message', '<p class="error">Unable to write to file.</p>'); } redirect(current_url()); } $this->template->view('admin/theme_editor', $data); }
public static function search($tag) { if (!$tag) { return; } $dtags = self::$tags; $tag = url_base64_encode($tag); $dir = "{$dtags}{$tag}"; if (!is_dir($dir)) { return array(); } $return = array(); foreach (scandir($dir, SCANDIR_SORT_NONE) as $file) { if ($file === ".." or $file === ".") { continue; } list($file, $expire) = explode(".", $file); if (is_numeric($expire) and (!$expire or time() <= $expire)) { $return[] = url_base64_decode($file); } } return $return; }