move class to namespace (dc 2.25 src)
This commit is contained in:
parent
2845234c7d
commit
6ea0866697
@ -10,6 +10,10 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-3.0 https://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\cleanURLs;
|
||||
|
||||
/**
|
||||
* Class to remove problematic characters from URLs
|
||||
*
|
||||
|
@ -10,10 +10,30 @@
|
||||
* @copyright Jean-Christian Denis
|
||||
* @copyright GPL-3.0 https://www.gnu.org/licenses/gpl-3.0.html
|
||||
*/
|
||||
if (!defined('DC_RC_PATH')) {
|
||||
return;
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Dotclear\Plugin\cleanURLs;
|
||||
|
||||
use dcCore;
|
||||
use dcNsProcess;
|
||||
|
||||
class Prepend extends dcNsProcess
|
||||
{
|
||||
public static function init(): bool
|
||||
{
|
||||
self::$init = true;
|
||||
|
||||
return self::$init;
|
||||
}
|
||||
|
||||
public static function process(): bool
|
||||
{
|
||||
if (!self::$init) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dcCore::app()->addBehavior('coreBeforePostCreate', [CleanURLs::class, 'clean']);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Clearbricks::lib()->autoload(['CleanURLs' => __DIR__ . '/inc/class.cleanurls.php']);
|
||||
|
||||
dcCore::app()->addBehavior('coreBeforePostCreate', ['CleanURLs', 'clean']);
|
||||
|
Loading…
Reference in New Issue
Block a user