update
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
/**
|
||||
* $Id: Controller.mod.php 394 2008-05-28 19:28:03Z dakl $
|
||||
* Klasa kontrolera v 1.2.0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -79,9 +79,9 @@ class DBMysql implements DBConnection {
|
||||
protected function DbConnect() {
|
||||
//echo"konekt";
|
||||
Profiler::log('mysqlStart', '', microtime());
|
||||
$this->dbh = new mysqli($this->dbHost, $this->user, $this->pass, $this->dbName);
|
||||
$this->dbh = @new mysqli($this->dbHost, $this->user, $this->pass, $this->dbName);
|
||||
if ($this->dbh->connect_errno) {
|
||||
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
|
||||
throw new MysqlException("Failed to connect to MySQL: (" . $this->dbh->connect_errno . ") " . $this->dbh->connect_error, $this->dbh->connect_errno);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -346,6 +346,9 @@ class DBMysqlStatement implements DBStatement {
|
||||
$this->Execute();
|
||||
//var_dump($this->result);
|
||||
//Utils::ArrayDisplay($this);
|
||||
if (!($this->result instanceof mysqli_result)) {
|
||||
return false;
|
||||
}
|
||||
$result = \mysqli_fetch_assoc($this->result);
|
||||
}
|
||||
|
||||
@@ -353,6 +356,9 @@ class DBMysqlStatement implements DBStatement {
|
||||
|
||||
//$this->dbMysql->Connect(__METHOD__);
|
||||
$this->Execute();
|
||||
if (!($this->result instanceof mysqli_result)) {
|
||||
return false;
|
||||
}
|
||||
$result = mysqli_fetch_assoc($this->result);
|
||||
$this->CacheWrite($result);
|
||||
} else {
|
||||
@@ -701,4 +707,4 @@ class DBProd extends DBMysql {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -22,7 +22,7 @@ class Dictionary {
|
||||
|
||||
$langs = Router::$arrayLang;
|
||||
//$langs = array_filter($langs, create_function('$x', 'return $x != "' . $lang . '";'));
|
||||
$langs = array_filter($langs, function($x) {return $x != "' ".self::$lang.'"';});
|
||||
$langs = array_filter($langs, function($x) {return $x != self::$lang;});
|
||||
foreach ($langs as $lang) {
|
||||
self::$allLangs[$lang] = MfDictionaryDAL::GetAllVariables($lang, 0, $location);
|
||||
}
|
||||
@@ -44,6 +44,9 @@ class Dictionary {
|
||||
}
|
||||
|
||||
public static function CheckAndAdd($keyword, $location) {
|
||||
if (Core::GetAppSafeMode()) {
|
||||
return;
|
||||
}
|
||||
// $lang = 'pl';
|
||||
$lang = Router::$curLang;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
|
||||
/**
|
||||
@@ -78,13 +78,13 @@ class MysqlException extends FileException {
|
||||
*/
|
||||
public function __construct($message=false, $code=false) {
|
||||
if(!$message) {
|
||||
$this->message = mysql_error();
|
||||
$this->message = '';
|
||||
}
|
||||
else
|
||||
$this->message = $message;
|
||||
|
||||
if(!$code) {
|
||||
$this->code = mysqli_errno(1);
|
||||
$this->code = 0;
|
||||
}
|
||||
else
|
||||
$this->code = $code;
|
||||
@@ -159,4 +159,4 @@ class SecurityException extends ApiException {
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
/**
|
||||
* Klasa FrontControllera
|
||||
*
|
||||
@@ -168,7 +168,8 @@ class FrontController {
|
||||
if((!method_exists($this->controllerObj, $method) && !method_exists($this->controllerObj, $method.'Action'))) {
|
||||
$this->method = 'Index';
|
||||
}
|
||||
if($this->loadError && ($this->method=='Index' && $this->route['param']['urlParam']!='')) {
|
||||
$urlParam = isset($this->route['param']['urlParam']) ? $this->route['param']['urlParam'] : '';
|
||||
if($this->loadError && ($this->method=='Index' && $urlParam!='')) {
|
||||
//Utils::ArrayDisplay($this->route, __FILE__.' Line: '.__LINE__);
|
||||
$this->method = 'Error404';
|
||||
}
|
||||
@@ -651,4 +652,4 @@ class FrontController {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
/*
|
||||
* Klasa buttonow html
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
/**
|
||||
* Interfejs do obs<62>ugi dost<73>pu do danych dla wybranego obiektu
|
||||
*
|
||||
|
||||
@@ -79,7 +79,7 @@ class MFLog {
|
||||
* Logowanie an konsole
|
||||
*/
|
||||
private static function ConsoleLog($data, $type) {
|
||||
if(self::$consolePrivateIp==null || (self::$consolePrivateIp!=null && $_SERVER['REMOTE_ADDR'] == self::$consolePrivateIp)) {
|
||||
if(self::$consolePrivateIp==null || (self::$consolePrivateIp!=null && isset($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] == self::$consolePrivateIp)) {
|
||||
|
||||
if($type<4) {
|
||||
Core::LoadPlugin('fb');
|
||||
@@ -201,4 +201,4 @@ class MFLog {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -18,6 +18,9 @@ abstract class MainController extends Controller {
|
||||
*
|
||||
*/
|
||||
protected function Run($param = array()) {
|
||||
if(!is_array($param)) {
|
||||
$param = array();
|
||||
}
|
||||
//$this->SetAjaxRender();
|
||||
$urlMain = URL_MAIN;
|
||||
$this->smarty->assign('urlMain', $urlMain);
|
||||
@@ -34,7 +37,7 @@ abstract class MainController extends Controller {
|
||||
|
||||
case 'Strona':
|
||||
session_start();
|
||||
if ($param['lang'] == '') {
|
||||
if (!isset($param['lang']) || $param['lang'] == '') {
|
||||
$param['lang'] = 'pl';
|
||||
Router::$curLang = $param['lang'];
|
||||
}
|
||||
@@ -527,4 +530,4 @@ abstract class MainController extends Controller {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -158,7 +158,7 @@ class MfCurl {
|
||||
$this->lastRequest = $url;
|
||||
$this->lastRequestMethod = $method;
|
||||
|
||||
if (ereg("^(https)", $url)) {
|
||||
if (preg_match('/^(https)/', $url)) {
|
||||
$this->SetOption(CURLOPT_SSL_VERIFYPEER, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ class Profiler {
|
||||
?>
|
||||
<table style='background-color: white; position:fixed; bottom:0; left:0; border: 1px solid #000000;' onclick="if(document.getElementById('profilerDialog').style.display=='none'){document.getElementById('profilerDialog').style.display='block';}else{document.getElementById('profilerDialog').style.display='none';}">
|
||||
<tr><td>
|
||||
<?
|
||||
<?php
|
||||
foreach(self::getLog('page') as $item) {
|
||||
echo $item['message'].':'.$item['value'].', ';
|
||||
}
|
||||
@@ -141,13 +141,13 @@ class Profiler {
|
||||
</td></tr>
|
||||
</table>
|
||||
<div id="profilerDialog" style="display: none; background-color: white; position:fixed; bottom:0; left:0; width: 300px; height: 60px; border: 1px solid #000000;">
|
||||
lista sql: <input type="checkbox" <?if(isset($_COOKIE['sql'])) {echo"checked='checked'";}?> onclick="if(this.checked){document.location.href='?profileSql=true'}else{document.location.href='?profileSql=false';}" />
|
||||
lista sql: <input type="checkbox" <?php if(isset($_COOKIE['sql'])) {echo"checked='checked'";}?> onclick="if(this.checked){document.location.href='?profileSql=true'}else{document.location.href='?profileSql=false';}" />
|
||||
<br />
|
||||
phpinfo: <input type="checkbox" <?if(isset($_COOKIE['php'])) {echo"checked='checked'";}?> onclick="if(this.checked){document.location.href='?profilePhp=true'}else{document.location.href='?profilePhp=false';}" />
|
||||
phpinfo: <input type="checkbox" <?php if(isset($_COOKIE['php'])) {echo"checked='checked'";}?> onclick="if(this.checked){document.location.href='?profilePhp=true'}else{document.location.href='?profilePhp=false';}" />
|
||||
<br />
|
||||
errorreporting-all: <input type="checkbox" <?if(isset($_COOKIE['error'])) {echo"checked='checked'";}?> onclick="if(this.checked){document.location.href='?profileError=true'}else{document.location.href='?profileError=false';}" />
|
||||
errorreporting-all: <input type="checkbox" <?php if(isset($_COOKIE['error'])) {echo"checked='checked'";}?> onclick="if(this.checked){document.location.href='?profileError=true'}else{document.location.href='?profileError=false';}" />
|
||||
</div>
|
||||
<?
|
||||
<?php
|
||||
}
|
||||
|
||||
private static function sqlDisplay() {
|
||||
@@ -159,7 +159,7 @@ class Profiler {
|
||||
foreach($queries as $query) {
|
||||
?>
|
||||
<tr><td><?= $query['message']; ?></td><td><?= $query['value']; ?></td></tr>
|
||||
<?
|
||||
<?php
|
||||
$totalTime = ($totalTime+$query['value']);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ echo"<tr><td><br /></td><td><br /></td></tr>";
|
||||
if(self::$profiling) {
|
||||
$return = true;
|
||||
}
|
||||
if(in_array($_SERVER['REMOTE_ADDR'], self::$clientIp) && self::$profiling) {
|
||||
if(isset($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], self::$clientIp) && self::$profiling) {
|
||||
$return = true;
|
||||
} else {
|
||||
$return = false;
|
||||
@@ -196,4 +196,4 @@ echo"<tr><td><br /></td><td><br /></td></tr>";
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
/**
|
||||
* $Id: Request.class.php 395 2008-05-28 19:41:06Z dakl $
|
||||
@@ -18,7 +18,7 @@ class Request {
|
||||
if (isset($_REQUEST[$value])) {
|
||||
|
||||
if ($xssremover == true) {
|
||||
$func = create_function('$a', 'return Utils::RemoveXss($a);'); //FIXME: Gdy wejdzie php5.3 mo<6D>na to troche przerobi<62> bo wprowadzaj? now? wersj<73> funkcji lambda
|
||||
$func = array('Utils', 'RemoveXss'); //FIXME: Gdy wejdzie php5.3 mo<6D>na to troche przerobi<62> bo wprowadzaj? now? wersj<73> funkcji lambda
|
||||
|
||||
return array_map($func, $_REQUEST[$value]);
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
/**
|
||||
* $Id: SessionProxy.class.php 693 2008-06-25 12:13:38Z pawy $
|
||||
*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Klasa posredniczaca w dostepie do smarty, obsluguje kontrole cacheowania
|
||||
|
||||
@@ -23,7 +23,7 @@ abstract class UserValidator {
|
||||
$sql = "SELECT count(login) FROM wp_preserve WHERE login=:01";
|
||||
|
||||
$stmt = $db->prepare($sql)
|
||||
->bindParam("01", mysql_escape_string(strip_tags($login)) )
|
||||
->bindParam("01", strip_tags($login) )
|
||||
->execute();
|
||||
|
||||
$amout=$stmt->FetchRow();
|
||||
@@ -45,7 +45,7 @@ abstract class UserValidator {
|
||||
$sql = "SELECT count(email) FROM wp_preserve WHERE email=:01";
|
||||
|
||||
$stmt = $db->prepare($sql)
|
||||
->bindParam("01", mysql_escape_string(strip_tags($email)) )
|
||||
->bindParam("01", strip_tags($email) )
|
||||
->execute();
|
||||
|
||||
$amout=$stmt->FetchRow();
|
||||
@@ -60,8 +60,8 @@ abstract class UserValidator {
|
||||
$sql="SELECT count(login) FROM wp_preserve WHERE hash=:01 AND passwd=:02";
|
||||
|
||||
$stmt = $db->prepare($sql)
|
||||
->bindParam("01",mysql_escape_string(strip_tags($hash)) )
|
||||
->bindParam("02",mysql_escape_string(strip_tags($password)) )
|
||||
->bindParam("01",strip_tags($hash) )
|
||||
->bindParam("02",strip_tags($password) )
|
||||
->execute();
|
||||
|
||||
$amout=$stmt->FetchRow();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* Klasa statyczna z funkcjami pomocniczymi
|
||||
@@ -42,7 +42,7 @@ class Utils {
|
||||
print("<table border=1 cellspacing=1 style=\"font-family: Verdana; font-size: 10 pt;\" width=\"100%\">\n");
|
||||
print("<tr><th colspan=2 bgcolor=\"#DDDDDD\">".$array_name."</TR>\n");
|
||||
// for (reset($array_name); (strcmp(($key=key($array_name)) ,"")); next($array_name)){
|
||||
while (list($key, $value) = each($array_name)) {
|
||||
foreach ($array_name as $key => $value) {
|
||||
if (strcmp($key,"GLOBALS") == 0) $user_defined = 0;
|
||||
if ($user_defined == 1) continue;
|
||||
if ((is_array($value) || is_object($value)) && (strcmp($key,"GLOBALS") != 0)) {
|
||||
@@ -739,7 +739,7 @@ class Utils {
|
||||
}
|
||||
|
||||
public static function DisplayBackTrace($backtrace) {
|
||||
$backtrace = array_map(create_function('$a', 'return array($a["line"], $a["file"], $a["function"]);'), $backtrace);
|
||||
$backtrace = array_map(function ($a) { return array($a["line"], $a["file"], $a["function"]); }, $backtrace);
|
||||
var_dump($backtrace);
|
||||
}
|
||||
|
||||
@@ -1466,7 +1466,7 @@ class Utils {
|
||||
$pageNum = $param[ROUTER_PAGE_LABEL];
|
||||
$page = explode('-', $pageNum);
|
||||
|
||||
array_filter($page, create_function('$x', 'if ((int)$x <= 0) { throw new UserException("Strona poza zakresem"); }'));
|
||||
array_filter($page, function ($x) { if ((int)$x <= 0) { throw new UserException("Strona poza zakresem"); } });
|
||||
|
||||
|
||||
if ($smarty != null)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -440,7 +440,7 @@ class Validator extends UserValidator {
|
||||
|
||||
$pattern = "^[a-zA-Z0-9_<39><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>桦<EFBFBD><E6A1A6><EFBFBD>Ư<EFBFBD><C6AF> \+\-]$len$";
|
||||
//!@\$%\*\(\)\^\-
|
||||
if(strlen($value)>=3 && strlen($value)<=15 && ereg($pattern,$value,$matches)) {
|
||||
if(strlen($value)>=3 && strlen($value)<=15 && preg_match('/' . str_replace('/', '\\/', $pattern) . '/', $value, $matches)) {
|
||||
//var_dump($matches);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user