Browse files

Set include_path to point to LAMPCMS_LIB_DIR first in require.php. Up…

…dated HtmlSafe.php to use relative path to Pear. It will make use on new include_path now.
  • Loading branch information...
1 parent f29e3d7 commit ad990c3a5db86e482e8f3d76119dfc2f70f39208 @snytkine committed Aug 7, 2012
Showing with 9 additions and 10 deletions.
  1. +2 −4 lib/Lampcms/Captcha/Captcha.php
  2. +6 −3 lib/Lampcms/HtmlSafe.php
  3. +1 −1 lib/require.php
  4. +0 −2 sitemap.php
View
6 lib/Lampcms/Captcha/Captcha.php
@@ -710,7 +710,7 @@ public function get_try($in = true)
}
if ($in) {
- return (int)substr(strip_tags($_POST['hncaptcha']), ($this->secretposition - 1), 1);
+ return (int)substr(\strip_tags($_POST['hncaptcha']), ($this->secretposition - 1), 1);
} else {
$a = "";
$b = "";
@@ -784,9 +784,8 @@ protected function generate_private($public = "")
}
d("public key WHICH USED for generate private key $public");
- d("\$this->public_key " . $this->public_key);
- $key = substr(md5($this->key . $public), 16 - $this->chars / 2, $this->chars);
+ $key = \substr(md5($this->key . $public), 16 - $this->chars / 2, $this->chars);
/**
* 0 will be replaced with Z
* because 0 renders badly in our font
@@ -838,7 +837,6 @@ public function getCaptchaArray()
* of any form
*
* @return string html block with Captcha
- * @todo Translate string of label
*/
public function getCaptchaBlock()
{
View
9 lib/Lampcms/HtmlSafe.php
@@ -632,9 +632,12 @@ public function clear()
*/
public function parse($doc)
{
- require_once(LAMPCMS_LIB_DIR . DIRECTORY_SEPARATOR . 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3.php');
+ /*require_once(LAMPCMS_LIB_DIR . DIRECTORY_SEPARATOR . 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3.php');
require_once(LAMPCMS_LIB_DIR . DIRECTORY_SEPARATOR . 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3' . DIRECTORY_SEPARATOR . 'States.php');
- require_once(LAMPCMS_LIB_DIR . DIRECTORY_SEPARATOR . 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3' . DIRECTORY_SEPARATOR . 'Decorators.php');
+ require_once(LAMPCMS_LIB_DIR . DIRECTORY_SEPARATOR . 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3' . DIRECTORY_SEPARATOR . 'Decorators.php');*/
+ require_once 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3.php';
+ require_once 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3' . DIRECTORY_SEPARATOR . 'States.php';
+ require_once 'Pear' . DIRECTORY_SEPARATOR . 'XML' . DIRECTORY_SEPARATOR . 'HTMLSax3' . DIRECTORY_SEPARATOR . 'Decorators.php';
// Save all '<' symbols
/**
* @todo this will replace
@@ -712,4 +715,4 @@ public function repackUTF7Back($str)
}
}
-?>
+?>
View
2 lib/require.php
@@ -56,7 +56,7 @@
* loaded and instead a phar's own stub file
* has all the necessary initialization functions
*/
+set_include_path(LAMPCMS_LIB_DIR . PATH_SEPARATOR . get_include_path());
require 'SwiftMailer/lib/swift_required.php';
require 'autoload.php';
-$oLoader->setIncludePath(LAMPCMS_LIB_DIR);
require '!inc.php';
View
2 sitemap.php
@@ -43,8 +43,6 @@
* or better from cron daily
*
*/
-
-require LAMPCMS_LIB_DIR . DIRECTORY_SEPARATOR . '!inc.php';
try {
$o = \Lampcms\SiteMap::factory($Registry);
$o->run();

0 comments on commit ad990c3

Please sign in to comment.