/**
 * Проверка галеры на наличие заданого цвета
 */
function checkPages($urls)
{
    foreach ($urls as $url) {
        print "Load " . $url . "...\n";
        $content = file_get_contents($url);
        if (!preg_match('{<body([^>]*)>}si', $content, $matches)) {
            continue;
        }
        if (!preg_match('{bgcolor=(\\"#.+?\\"|\'#.+?\'|#.+?)(\\s+|>)}si', $matches[1], $m)) {
            continue;
        }
        $color = removeQuotes($m[1]);
        list($r, $g, $b) = colorRGB($color);
        if (hexdec($r) < hexdec(RED_MIN) || hexdec($r) > hexdec(RED_MAX)) {
            continue;
        }
        if (hexdec($g) < hexdec(GREEN_MIN) || hexdec($g) > hexdec(GREEN_MAX)) {
            continue;
        }
        if (hexdec($b) < hexdec(BLUE_MIN) || hexdec($b) > hexdec(BLUE_MAX)) {
            continue;
        }
        saveContents("urls_ok.txt", $url . "\n", true);
    }
}
Пример #2
0
function __xenimport_parse_config($file)
{
    $list = lfile_trim($file);
    foreach ($list as $l) {
        if (!csa($l, "=")) {
            continue;
        }
        list($var, $val) = explode("=", $l);
        $var = trim($var);
        $val = trim($val);
        switch ($var) {
            case "memory":
                $ret['memory'] = $val;
                break;
            case "name":
                $val = strfrom($val, 'VM-');
                $ret['name'] = strtolower(strtil($val, '"'));
                break;
            case "ip":
                $ret['ipaddress'] = removeQuotes($val);
                break;
            case "gateway":
                $ret['gateway'] = removeQuotes($val);
                break;
            case "disk":
                __xenimport_parsedisk($ret, $val);
                break;
        }
    }
    return $ret;
}
Пример #3
0
 public function view()
 {
     if (user::issetRight('delete')) {
         ui::newButton(lang::get('BTN_CLEAR_JORNAL'), 'javascript:clearJornal();');
     }
     ui::addLeftButton('Системный журнал', 'system_view');
     ui::addLeftButton('Журнал БД', 'db_view');
     function removeQuotes($val, $obj)
     {
         return substr($val, 1, strlen($val) - 2);
     }
     function rqDateTime($val, $obj)
     {
         return date('d.m.Y H:i:s', $val);
     }
     function sortByTime($a, $b)
     {
         if ($a[1] == $b[1]) {
             return 0;
         }
         return $a[1] > $b[1] ? -1 : 1;
     }
     $mas = array();
     $system_file = ROOT_DIR . '/revue.log';
     if (file_exists($system_file)) {
         // Читаем файл, формируем массив
         $tmp_mas = array();
         $file = file($system_file);
         while (list($key, $val) = each($file)) {
             $tmp = explode(Chr(9), $val);
             if (!empty($tmp[1])) {
                 $tmp[1] = strtotime(removeQuotes($tmp[1], $tmp[1]));
                 $tmp_mas[] = $tmp;
             }
         }
         // Сортиуем массив по времени
         usort($tmp_mas, 'sortByTime');
         // Выбераем часть массива в соотвествии с постраничной навигацией
         $count = count($tmp_mas);
         $max_count = uiTable::getMaxCount();
         if (uiTable::getCurPage() != 1) {
             $niz = empty($start_pos) ? uiTable::getCurPage() * $max_count - $max_count : 0;
             $mas = array_slice($tmp_mas, $niz, $max_count);
         } else {
             $mas = array_slice($tmp_mas, 0, $max_count);
         }
     } else {
         $count = 0;
     }
     $table = new uiTable($mas, $count);
     $table->emptyText('В системном журнале нет записей!');
     $table->addColumn('2', 'Важность', 0, false, false, 'removeQuotes');
     $table->addColumn('3', 'Пользователь', 0, false, false, 'removeQuotes');
     $table->addColumn('4', 'Действие', 400);
     $table->addColumn('1', 'Дата / Время', 0, false, false, 'rqDateTime');
     $table->addColumn('0', 'IP');
     return $table->getHTML();
 }
Пример #4
0
function removeQuotes($post)
{
    if (get_magic_quotes_gpc()) {
        foreach ($post as &$var) {
            if (is_array($var)) {
                $var = removeQuotes($var);
            } else {
                $var = stripslashes($var);
            }
        }
    }
    return $post;
}
function getFiles($path)
{
    global $dirContents, $pathURL, $codeMirrorModes, $nonce, $tz_offset;
    $filePath = $path == '.' ? '/' : '/' . $path . '/';
    if (!count($dirContents['files'])) {
        return;
    }
    natcasesort($dirContents['files']);
    $codeMirrorExists = (int) is_dir(CODEMIRROR_PATH);
    $zipSupport = zipSupport();
    //tt edition
    $correctpath = str_ireplace(separator__WFMB($_SERVER['DOCUMENT_ROOT']), '', separator__WFMB(ROOT));
    $correctpath = str_ireplace('\\', '/', $correctpath);
    foreach ($dirContents['files'] as $dirItem) {
        $dirItemURL = escape($dirItem);
        $dirItemHTML = htmlspecialchars($dirItem);
        $fullPath = $path . '/' . $dirItem;
        $mtime = filemtime($fullPath);
        $mod = getMod($fullPath);
        $ext = getExt($dirItem);
        $cmSupport = in_array($ext, $codeMirrorModes) ? 'cp ' : '';
        echo '  <li title="' . $dirItemHTML . '">' . "\n\t" . '<a href="' . escape($correctpath . $filePath . $dirItem) . '" title="' . $dirItemHTML . '" class="file" id="' . $dirItemHTML . '" target="_blank">' . $dirItemHTML . '</a>' . (pathinfo($dirItem, PATHINFO_EXTENSION) == 'sql' ? ' &nbsp;&nbsp;(<a href="javascript:export_import_db(\'importt\',\'' . $dirItemHTML . '\')">RESTORE INTO DATABASE</a>)' : '') . "\n\t" . '<span class="fs"  title="file size">' . getfs($path . '/' . $dirItem) . '</span>' . "\n\t" . '<span class="extension" title="file extension">' . $ext . '</span>' . "\n\t" . '<span class="filemtime" title="' . date('c', $mtime) . '">' . date('y-m-d | H:i:s', $mtime + $tz_offset) . '</span>' . "\n\t" . '<span class="mode" title="mode">' . $mod . '</span>' . ($zipSupport && $ext == 'zip' ? "\n\t" . '<a href="?do=extract&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;nonce=' . $nonce . '" title="Extract ' . $dirItemHTML . '" class="extract b"></a>' : '') . (filesize($fullPath) <= 1048576 * MaxEditableSize ? "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $ext . '\', ' . $codeMirrorExists . '); return false;" class="edit ' . $cmSupport . 'b"></a>' : '') . "\n\t" . '<a href="#" title="Chmod ' . $dirItemHTML . '" onclick="fOp.chmod(\'' . $pathURL . '\', \'' . $dirItemURL . '\', \'' . $mod . '\'); return false;" class="chmod b"></a>' . "\n\t" . '<a href="#" title="Move ' . $dirItemHTML . '" onclick="fOp.moveList(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="move b"></a>' . "\n\t" . '<a href="#" title="Copy ' . $dirItemHTML . '" onclick="fOp.copy(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="copy b"></a>' . "\n\t" . '<a href="#" title="Rename ' . $dirItemHTML . '" onclick="fOp.rename(\'' . $dirItemHTML . '\', \'' . $pathURL . '\'); return false;" class="rename b"></a>' . "\n\t" . '<a href="?do=delete&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;nonce=' . $nonce . '" title="Delete ' . $dirItemHTML . '" onclick="return confirm(\'Are you sure you want to delete ' . removeQuotes($dirItem) . '?\');" class="del b"></a>' . "\n  </li>\n";
    }
}
<?php

require_once 'includes/helpers.php';
require_once 'includes/config.php';
require_once '../src/includes.php';
$post = removeQuotes($_POST);
$id = $post['id'];
if (!isset($shopItems[$id])) {
    redirect_to(get_address());
}
$item = $shopItems[$id];
$amount = $item['price'];
$currency = $item['currency'];
// get payment methods available for this project with min/max amounts in specified currency
$methods = WebToPay::getPaymentMethodList($config['projectid'], $currency)->filterForAmount($amount, $currency)->setDefaultLanguage('en');
// set default language for titles (default: lt)
echo template('paymentMethod.html', array('methods' => $methods, 'post' => $post));
<?php

include_once '../global/ranvier.php';
function removeQuotes($str)
{
    return str_replace(array('"', "'"), '', $str);
}
$js = readRanvierFile('/src/player.js');
preg_match('/self.attributes = \\{(.*?)\\};/s', $js, $contents);
$lines = explode("\n", $contents[1]);
$attr = array();
foreach ($lines as $l) {
    if (trim($l) != '') {
        preg_match('#(.*?):(.*?), // type: (.*)#', trim($l), $parts);
        $a = array('field' => removeQuotes(trim($parts[1])), 'default' => removeQuotes(trim($parts[2])), 'type' => $parts[3], 'extra' => '');
        if (strpos($a['type'], '[') !== false) {
            list($type, $stuff) = explode('[', $a['type']);
            $a['type'] = $type;
            $a['extra'] = explode(',', substr($stuff, 0, -1));
        }
        if ($a['field'] != '') {
            $attr[] = $a;
        }
    }
}
echo json_encode($attr);
Пример #8
0
function getFiles($path)
{
    global $dirContents, $pathURL, $codeMirrorModes, $token;
    $filePath = $path == '.' ? '/' : '/' . $path . '/';
    if (!count($dirContents['files'])) {
        return;
    }
    natcasesort($dirContents['files']);
    $codeMirrorExists = (int) is_dir(CODEMIRROR_PATH);
    $zipSupport = zipSupport();
    foreach ($dirContents['files'] as $dirItem) {
        $dirItemURL = escape($dirItem);
        $dirItemHTML = htmlspecialchars($dirItem);
        $fullPath = $path . '/' . $dirItem;
        $mtime = filemtime($fullPath);
        $mod = getMod($fullPath);
        $ext = getExt($dirItem);
        $cmSupport = in_array($ext, $codeMirrorModes) ? 'cp ' : '';
        echo '  <li title="' . $dirItemHTML . '">' . "\n\t" . '<a href="' . escape(ROOT . $filePath . $dirItem) . '" title="' . $dirItemHTML . '" class="file">' . $dirItemHTML . '</a>' . "\n\t" . '<span class="fs"  title="file size">' . getfs($path . '/' . $dirItem) . '</span>' . "\n\t" . '<span class="extension" title="file extension">' . $ext . '</span>' . "\n\t" . '<span class="filemtime" title="' . date('c', $mtime) . '">' . date('y-m-d | H:i:s', $mtime) . '</span>' . "\n\t" . '<span class="mode" title="mode">' . $mod . '</span>' . ($zipSupport && $ext == 'zip' ? "\n\t" . '<a href="?do=extract&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;token=' . $token . '" title="Extract ' . $dirItemHTML . '" class="extract b"></a>' : '') . (filesize($fullPath) <= 1048576 * MaxEditableSize ? "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $ext . '\', ' . $codeMirrorExists . '); return false;" class="edit ' . $cmSupport . 'b"></a>' : '') . "\n\t" . '<a href="#" title="Chmod ' . $dirItemHTML . '" onclick="fOp.chmod(\'' . $pathURL . '\', \'' . $dirItemURL . '\', \'' . $mod . '\'); return false;" class="chmod b"></a>' . "\n\t" . '<a href="#" title="Move ' . $dirItemHTML . '" onclick="fOp.moveList(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="move b"></a>' . "\n\t" . '<a href="#" title="Copy ' . $dirItemHTML . '" onclick="fOp.copy(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="copy b"></a>' . "\n\t" . '<a href="#" title="Rename ' . $dirItemHTML . '" onclick="fOp.rename(\'' . $dirItemHTML . '\', \'' . $pathURL . '\'); return false;" class="rename b"></a>' . "\n\t" . '<a href="?do=delete&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '&amp;token=' . $token . '" title="Delete ' . $dirItemHTML . '" onclick="return confirm(\'Are you sure you want to delete ' . removeQuotes($dirItem) . '?\');" class="del b"></a>' . "\n  </li>\n";
    }
}
function getLinksForUrl($url, $useProxy = true)
{
    $linksCount = 0;
    $linksCountNoIndex = 0;
    $linkCountIn = 0;
    $linkCountOut = 0;
    $linkCountOur = 0;
    $params = array();
    if ($useProxy) {
        $proxyService = new ProxiesService();
        $res = $proxyService->getRandomProxyData();
        if (PEAR::isError($res)) {
            return $res;
        }
        $params["proxyData"] = $res;
    }
    $pageContent = UrlUtils::loadPage($url, $params);
    if (strlen($pageContent) == 0) {
        return new PEAR_Error("Empty content");
    }
    $pattern = "{<a[^>]+?(href=\".+?\"|href='.+?'|href=.+?\\s)[^>]*>}si";
    if (!preg_match_all($pattern, $pageContent, $matches, PREG_SET_ORDER)) {
        return array($linksCount, $linksCountNoIndex, $linkCountIn, $linkCountOut, $linkCountOur);
    }
    $linksCount = sizeof($matches);
    $currUrl = parse_url($url);
    foreach ($matches as $m) {
        $m[1] = strtolower($m[1]);
        $url = removeQuotes(str_replace("href=", "", $m[1]));
        $u = parse_url($url);
        if (!isset($u["host"])) {
            $linkCountIn++;
        } else {
            if (strcmp(removeWWW($u["host"]), removeWWW($currUrl["host"])) == 0) {
                $linkCountIn++;
            } else {
                if (strpos(removeWWW($u["host"]), "." . removeWWW($currUrl["host"])) !== false) {
                    $linkCountOur++;
                } else {
                    $linkCountOut++;
                }
            }
        }
    }
    $pageContent = preg_replace("{<noindex>.+?</noindex>}si", "", $pageContent);
    preg_match_all($pattern, $pageContent, $matches, PREG_SET_ORDER);
    $linksCountNoIndex = sizeof($matches);
    return array($linksCount, $linksCountNoIndex, $linkCountIn, $linkCountOut, $linkCountOur);
}
Пример #10
0
<?php

require_once 'includes/helpers.php';
require_once 'includes/config.php';
require_once '../src/includes.php';
$get = removeQuotes($_GET);
try {
    $parsedData = WebToPay::validateAndParseData($get, $config['projectid'], $config['sign_password']);
} catch (WebToPayException $e) {
    $parsedData = 'Error: ' . $e->getMessage();
}
$data = load_data();
$data['sms'][] = array('_GET' => $get, 'parsedData' => $parsedData);
save_data($data);
Пример #11
0
 if (get_sub_field('top_right_image')) {
     echo '<div class="small-12 medium-6 column">';
     echo '<figure class="media photo grid pad-right">';
     $image = get_sub_field('top_right_image');
     $url = str_replace($site, 'http://eberhardtsmith.imgix.net', $image['url']);
     $caption = removeQuotes($image['caption']);
     echo '<div><a href="' . $image['url'] . '" data-lightbox="' . get_the_title() . '" data-title="' . $caption . '"><img class="img-fluid" data-sr="ease" src="' . $url . '" alt="' . $image['alt'] . '" /></a></div>';
     echo '</figure>';
     echo '</div>';
 }
 if (get_sub_field('bottom_left_image')) {
     echo '<div class="small-12 medium-6 column">';
     echo '<figure class="media photo grid pad-top pad-left">';
     $image = get_sub_field('bottom_left_image');
     $url = str_replace($site, 'http://eberhardtsmith.imgix.net', $image['url']);
     $caption = removeQuotes($image['caption']);
     echo '<div><a href="' . $image['url'] . '" data-lightbox="' . get_the_title() . '" data-title="' . $caption . '"><img class="img-fluid" data-sr="ease" src="' . $url . '" alt="' . $image['alt'] . '" /></a></div>';
     echo '</figure>';
     echo '</div>';
 }
 if (get_sub_field('caption_area')) {
     echo '<div class="small-12 medium-6 column">';
     echo '<div class="caption-area pad-top pad-right">';
     echo '<div class="grid-caption">';
     the_sub_field('caption_area');
     echo '</div>';
     echo '</div>';
     echo '</div>';
 }
 echo '</div>';
 echo '</div>';
function getFiles($path)
{
    global $dirContents, $pathURL, $cpExts, $denyAccess;
    $filePath = $path == '.' ? '/' : '/' . $path . '/';
    for ($i = 0, $l = count($dirContents['files']); $i < $l; $i++) {
        $dirItem = $dirContents['files'][$i];
        $dirItemURL = escape($dirItem);
        $dirItemHTML = htmlspecialchars($dirItem);
        $fullPath = $path . '/' . $dirItem;
        $ext = getext($dirItem);
        $mod = getmod($fullPath);
        echo '  <li title="' . $dirItemHTML . '">' . "\n\t" . '<a href="' . escape(ROOT . $filePath . $dirItem) . '" title="' . $dirItemHTML . '" class="file">' . $dirItemHTML . '</a><!-- ' . $dirItemHTML . " -->" . "\n\t" . '<span class="fs"  title="file size">' . getfs($path . '/' . $dirItem) . '</span>' . "\n\t" . '<span class="extension" title="file extension">' . $ext . '</span>' . "\n\t" . '<span class="mode" title="mode">' . $mod . '</span>' . (zipSupport() && $ext == 'zip' ? "\n\t" . '<a href="?do=extract&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '" title="Extract ' . $dirItemHTML . '" class="extract b"></a><!-- Extract ' . $dirItemHTML . " -->" : null) . (filesize($fullPath) <= 1048576 * MaxEditableSize ? in_array($ext, $cpExts) ? "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . getext($dirItem) . '\'); return false;" class="edit cp b"></a><!-- Edit ' . $dirItemHTML . " -->" : "\n\t" . '<a href="#" title="Edit ' . $dirItemHTML . '" onclick="edit.init(\'' . $dirItemURL . '\', \'' . $pathURL . '\', null); return false;" class="edit b"></a><!-- Edit ' . $dirItemHTML . " -->" : null) . "\n\t" . '<a href="#" title="Chmod ' . $dirItemHTML . '" onclick="fOp.chmod(\'' . $pathURL . '\', \'' . $dirItemURL . '\', \'' . $mod . '\'); return false;" class="chmod b"></a><!-- Chmod ' . $dirItemHTML . " -->" . "\n\t" . '<a href="#" title="Move ' . $dirItemHTML . '" onclick="fOp.moveList(\'' . $dirItemURL . '\', \'' . $pathURL . '\', \'' . $pathURL . '\'); return false;" class="move b"></a><!-- Move ' . $dirItemHTML . " -->" . "\n\t" . '<a href="#" title="Rename ' . $dirItemHTML . '" onclick="fOp.rename(\'' . $dirItemURL . '\', \'' . $pathURL . '\'); return false;" class="rename b"></a><!-- Rename ' . $dirItemHTML . ' -->' . "\n\t" . '<a href="?do=delete&amp;path=' . $pathURL . '&amp;subject=' . $dirItemURL . '" title="Delete ' . $dirItemHTML . '" onclick="return confirm(\'Are you sure you want to delete ' . removeQuotes($dirItem) . '?\');" class="del b"></a><!-- Delete ' . $dirItemHTML . " -->" . "\n  </li>\n";
    }
}