Skip to content

Commit

Permalink
Merge d3ac667 into 6f0d4f2
Browse files Browse the repository at this point in the history
  • Loading branch information
geekwright committed Mar 7, 2021
2 parents 6f0d4f2 + d3ac667 commit 8004e7b
Show file tree
Hide file tree
Showing 41 changed files with 484 additions and 146 deletions.
18 changes: 12 additions & 6 deletions docs/changelog.250.txt
@@ -1,7 +1,7 @@
XOOPS 2.5.x Changelog (Language changes: see: /docs/lang_diff.txt)

===================================
2.5.11 Beta2 NOT RELEASED
2.5.11 Beta2 2021/03/06
===================================

- update xmsocial, xmmodules, xmdoc and xmnews (mage)
Expand All @@ -10,7 +10,7 @@ XOOPS 2.5.x Changelog (Language changes: see: /docs/lang_diff.txt)
- Add missing "dropdown-item" class on list items (geekwright)
- Use mixed case constants in DHTML editor controls (geekwright)
- Correct issues in dhtmltextarea
- Fix:https://github.com/XOOPS/XoopsCore25/issues/783 (mage)
- Fix changing avatar with profile module and xswatch4 #784 (mage)
- Tweak feeds used in XOOPS News in admin.php (geekwright)
- use https and no "www." for xoops.org feeds
- give priority to feed(s) in htdocs/language/.../backend.php
Expand All @@ -23,7 +23,7 @@ XOOPS 2.5.x Changelog (Language changes: see: /docs/lang_diff.txt)
- Fix docblock \XoopsNotificationHandler::triggerEvent() - Fixes #794 (geekwright)
- cloning of all xswatch derivatives (alain01)
- Update style.css (alain01)
- Delete little space between pages number
- Delete little space between pages number
- Modified: htdocs/class/snoopy.php (mage)
- Fix Error when no modules installed (geekwright)
- Add meaningful default page to xswatch4 (geekwright)
Expand Down Expand Up @@ -52,14 +52,20 @@ XOOPS 2.5.x Changelog (Language changes: see: /docs/lang_diff.txt)
- Fix: count search (mage)
- Fixed error when redirect (luciorota)
- Return proper null value for integer columns (geekwright)
- Add macro substitutions for {X_SITEURL} and {X_YEAR}
- Patch a few issues when using PHP 8 (geekwright)
- Add macro substitutions for {X_SITEURL} and {X_YEAR} #850
- Patch issues when using PHP 8.0 (mamba, et al.)
- explicitly require fileinfo extension in install
- XoopsModelRead::getAll() now recognizes database errors #943
- fix "array to string conversion error" in module install #944 (mamba)
- Make $redirect_message available in system_siteclosed.tpl #952
- fix default for debugLevel configuration #953
- remove non-useful links from module admin page #956 (mage)
- stop overwriting config files when updating XOOPS

Updated libraries and assets:
- Smarty: allow StdClass to be cast to array when compiling foreach (mamba)
- HTML Purifier to 4.13 (mamba)
- phpThumb to 1.7.16-202008101454 (mamba)
- phpThumb has been removed #939
- bootstrap 3.4.1 (geekwright)
- jQuery to 3.5.1 (geekwright)

Expand Down
2 changes: 2 additions & 0 deletions docs/lang_diff.txt
Expand Up @@ -11,6 +11,8 @@ htdocs/language/english/global.php
- changed define('_SIZE', 'Size'); // font size
- changed define('_FONT', 'Font'); // font family
- changed define('_COLOR', 'Color'); // font color
htdocs/install/language/english/install.php
- added define('ERR_COPY_CONFIG_FILE', 'Could not copy the configuration file %s');
htdocs/install/language/english/welcome.php
- changed recommended PHP & MySQL versions, links changed to "https:"
htdocs/modules/system/language/english/admin/preferences.php
Expand Down
Expand Up @@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @subpackage CAPTCHA
Expand Down
Expand Up @@ -11,7 +11,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @subpackage CAPTCHA
Expand Down
Expand Up @@ -15,7 +15,7 @@
* @package class
* @subpackage CAPTCHA
* @author Grégory Mage
* @copyright 2016 XOOPS Project (http://xoops.org)
* @copyright 2016-2021 XOOPS Project (http://xoops.org)
* @license GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
* @link http://xoops.org
*/
Expand Down
Expand Up @@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @subpackage CAPTCHA
Expand Down
26 changes: 10 additions & 16 deletions htdocs/class/captcha/image/scripts/image.php
Expand Up @@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @since 2.3.0
* @author Taiwen Jiang <phppp@users.sourceforge.net>
Expand All @@ -22,12 +22,6 @@
error_reporting(0);
$xoopsLogger->activated = false;

/*
if (empty($_SERVER['HTTP_REFERER']) || !preg_match("/^" . preg_quote(XOOPS_URL, '/') . "/", $_SERVER['HTTP_REFERER'])) {
exit();
}
*/

/**
* Class XoopsCaptchaImageHandler
*/
Expand Down Expand Up @@ -137,17 +131,17 @@ public function getList($name, $extension = '')
return $items;
}

/**#@+
/**
* Create CAPTCHA iamge with GD
* Originated by DuGris' SecurityImage
* --------------------------------------------------------------------------- //
* Class : SecurityImage 1.5 //
* Author: DuGris aka L. Jen <http://www.dugris.info> //
* Email : DuGris@wanadoo.fr //
* Licence: GNU //
* Project: The XOOPS Project //
* --------------------------------------------------------------------------- //
*/
// --------------------------------------------------------------------------- //
// Class : SecurityImage 1.5 //
// Author: DuGris aka L. Jen <http://www.dugris.info> //
// Email : DuGris@wanadoo.fr //
// Licence: GNU //
// Project: The XOOPS Project //
// --------------------------------------------------------------------------- //
public function createImageGd()
{
$this->loadFont();
Expand Down Expand Up @@ -284,7 +278,7 @@ public function drawCode()
// write text to image
$Angle = mt_rand(10, 30);
if ($i % 2) {
$Angle = mt_rand(-10, -30);
$Angle = mt_rand(-30, -10);
}

// select random font size
Expand Down
23 changes: 15 additions & 8 deletions htdocs/class/captcha/xoopscaptcha.php
Expand Up @@ -14,7 +14,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @subpackage CAPTCHA
Expand All @@ -28,10 +28,10 @@
*/
class XoopsCaptcha
{
// static $instance;
public $active;
public $handler;
public $path_basic;
public $path_config;
public $path_plugin;
public $name;
public $config = array();
Expand All @@ -45,6 +45,7 @@ protected function __construct()
xoops_loadLanguage('captcha');
// Load static configurations
$this->path_basic = XOOPS_ROOT_PATH . '/class/captcha';
$this->path_config = XOOPS_VAR_PATH . '/configs/captcha';
$this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/captcha';
$this->config = $this->loadConfig();
$this->name = $this->config['name'];
Expand All @@ -68,25 +69,32 @@ public static function getInstance()
/**
* XoopsCaptcha::loadConfig()
*
* @param mixed $filename
* @param string|null $methodname the captcha method, i.e. text, image, recaptcha2, etc
*
* @return array
*/
public function loadConfig($filename = null)
public function loadConfig($methodname = null)
{
$basic_config = array();
$plugin_config = array();
$filename = empty($filename) ? 'config.php' : 'config.' . $filename . '.php';
if (file_exists($file = $this->path_basic . '/' . $filename)) {
$filename = empty($methodname) ? 'config.php' : 'config.' . $methodname . '.php';
$distfilename = empty($methodname) ? 'config.dist.php' : 'config.' . $methodname . '.dist.php';
if (file_exists($file = $this->path_config . '/' . $filename)) {
$basic_config = include $file;
} elseif (file_exists($distfile = $this->path_basic . '/' . $distfilename)) {
$basic_config = include $distfile;
if (false===copy($distfile, $file)) {
trigger_error('Could not create captcha config file ' . $filename);
}
}
// use of the path_plugin
if (file_exists($file = $this->path_plugin . '/' . $filename)) {
$plugin_config = include $file;
}

$config = array_merge($basic_config, $plugin_config);
foreach ($config as $key => $val) {
$config[$key] = $val;
$this->config[$key] = $val;
}

return $config;
Expand Down Expand Up @@ -436,7 +444,6 @@ public function verify($sessionName = null)
$is_valid = false;
if (!empty($_SESSION["{$sessionName}_code"])) {
$func = !empty($this->config['casesensitive']) ? 'strcmp' : 'strcasecmp';
// $is_valid = !$func(trim(@$_POST[$sessionName]), $_SESSION["{$sessionName}_code"]);
$is_valid = !$func(trim(Request::getString($sessionName, '', 'POST')), $_SESSION["{$sessionName}_code"]);
}

Expand Down
68 changes: 38 additions & 30 deletions htdocs/class/module.textsanitizer.php
Expand Up @@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @since 2.0.0
Expand All @@ -22,7 +22,7 @@
* Abstract class for extensions
*
* @author Taiwen Jiang <phppp@users.sourceforge.net>
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
*/
class MyTextSanitizerExtension
{
Expand Down Expand Up @@ -51,26 +51,25 @@ public function __construct(MyTextSanitizer $ts)
public static function loadConfig($path = null)
{
$ts = MyTextSanitizer::getInstance();
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
if (false === strpos($path, '/')) {
if (is_dir($ts->path_basic . '/' . $path)) {
$path = $ts->path_basic . '/' . $path;
} else {
if (is_dir($ts->path_plugin . '/' . $path)) {
$path = $ts->path_plugin . '/' . $path;
}
}
}
$config_default = array();
$config_custom = array();
if (file_exists($path . '/config.php')) {
$config_default = include $path . '/config.php';
$extensionName = (null === $path) ? '' : basename($path);
$pathDist = $ts->path_basic;
$pathConfig = $ts->path_config;

if ('' !== $extensionName) {
$configFileName = $pathConfig . '/config.' . $extensionName . '.php';
$distFileName = $pathDist . '/' . $extensionName . '/config.' . $extensionName . '.dist.php';
} else {
$configFileName = $pathConfig . '/config.php';
$distFileName = $pathDist . '/config.dist.php';
}
if (file_exists($path . '/config.custom.php')) {
$config_custom = include $path . '/config.custom.php';
if (!file_exists($configFileName)) {
if (false === copy($distFileName, $configFileName)) {
trigger_error('Could not create textsanitizer config file ' . basename($configFileName));
return $a = array();
}
}

return self::mergeConfig($config_default, $config_custom);
$configs = include $configFileName;
return $configs;
}

/**
Expand Down Expand Up @@ -110,6 +109,10 @@ public function encode($textarea_id)
/**
* decode
*
* @param string $url
* @param string|integer $width
* @param string|integer $height
*
* @return Null
*/
public static function decode($url, $width, $height)
Expand All @@ -128,7 +131,7 @@ public static function decode($url, $width, $height)
* @author Kazumi Ono <onokazu@xoops.org>
* @author Taiwen Jiang <phppp@users.sourceforge.net>
* @author Goghs Cheng
* @copyright (c) 2000-2016 XOOPS Project - www.xoops.org
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
*/
class MyTextSanitizer
{
Expand Down Expand Up @@ -156,6 +159,7 @@ class MyTextSanitizer
//mb------------------------------

public $path_basic;
public $path_config;
public $path_plugin;

public $config;
Expand All @@ -173,6 +177,7 @@ class MyTextSanitizer
public function __construct()
{
$this->path_basic = XOOPS_ROOT_PATH . '/class/textsanitizer';
$this->path_config = XOOPS_VAR_PATH . '/configs/textsanitizer';
$this->path_plugin = XOOPS_ROOT_PATH . '/Frameworks/textsanitizer';
$this->config = $this->loadConfig();
}
Expand All @@ -185,16 +190,21 @@ public function __construct()
*/
public function loadConfig($name = null)
{
// NB: sending a null name results in an infinite loop
if (!empty($name)) {
return MyTextSanitizerExtension::loadConfig($name);
}
$config_default = include $this->path_basic . '/config.php';
$config_custom = array();
if (file_exists($file = $this->path_basic . '/config.custom.php')) {
$config_custom = include $file;
}

return $this->mergeConfig($config_default, $config_custom);
$configFileName = $this->path_config . '/config.php';
$distFileName = $this->path_basic . '/config.dist.php';

if (!file_exists($configFileName)) {
if (false===copy($distFileName, $configFileName)) {
trigger_error('Could not create textsanitizer config file ' . basename($configFileName));
return array();
}
}
return include $configFileName;
}

/**
Expand Down Expand Up @@ -222,9 +232,7 @@ public function mergeConfig($config_default, $config_custom)
/**
* Access the only instance of this class
*
* @return object
* @static
* @staticvar object
* @return MyTextSanitizer
*/
public static function getInstance()
{
Expand Down
Expand Up @@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @subpackage textsanitizer
Expand Down
Expand Up @@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @subpackage textsanitizer
Expand Down
Expand Up @@ -9,7 +9,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @copyright (c) 2000-2017 XOOPS Project (www.xoops.org)
* @copyright (c) 2000-2021 XOOPS Project (https://xoops.org)
* @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
* @package class
* @subpackage textsanitizer
Expand Down

0 comments on commit 8004e7b

Please sign in to comment.