<commit_before><?php
/**
 * @author         <NAME> <<EMAIL>>
 * @copyright      (c) 2012-2017, <NAME>. All Rights Reserved.
 * @license        GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package        PH7 / App / System / Core / Form
 */

namespace PH7;

defined('PH7') or exit('Restricted access');

/** For "user", "affiliate" and "admin" module **/
class ChangePasswordCoreForm
{
    public static function display()
    {
        if (isset($_POST['submit_change_password'])) {
            if (\PFBC\Form::isValid($_POST['submit_change_password']))
                new ChangePasswordCoreFormProcess();

            Framework\Url\Header::redirect();
        }

        $oForm = new \PFBC\Form('form_change_password');
        $oForm->configure(array('action' => ''));
        $oForm->addElement(new \PFBC\Element\Hidden('submit_change_password', 'form_change_password'));
        $oForm->addElement(new \PFBC\Element\Token('change_password'));
        $oForm->addElement(new \PFBC\Element\Password(t('Old password:'), 'old_password', array('required' => 1)));
        $oForm->addElement(new \PFBC\Element\Password(t('New password:'), 'new_password', array('id' => 'password', 'onkeyup' => 'checkPassword(this.value)', 'onblur' => 'CValid(this.value, this.id)', 'required' => 1, 'validation' => new \PFBC\Validation\Password)));
        $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error password"></span>'));
        $oForm->addElement(new \PFBC\Element\Password(t('Repeat new password:'), '<PASSWORD>', array('required' => 1)));
        $oForm->addElement(new \PFBC\Element\Button(t('Change Password!'), 'submit', array('icon' => 'key')));
        $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script>'));
        $oForm->render();
    }
}<commit_msg>Use short array syntax (PHP >=5.4)<commit_after><?php
/**
 * @author         <NAME> <<EMAIL>>
 * @copyright      (c) 2012-2017, <NAME>. All Rights Reserved.
 * @license        GNU General Public License; See PH7.LICENSE.txt and PH7.COPYRIGHT.txt in the root directory.
 * @package        PH7 / App / System / Core / Form
 */

namespace PH7;

defined('PH7') or exit('Restricted access');

use PH7\Framework\Url\Header;

/** For "user", "affiliate" and "admin" module **/
class ChangePasswordCoreForm
{
    public static function display()
    {
        if (isset($_POST['submit_change_password'])) {
            if (\PFBC\Form::isValid($_POST['submit_change_password'])) {
                new ChangePasswordCoreFormProcess();
            }

            Header::redirect();
        }

        $oForm = new \PFBC\Form('form_change_password');
        $oForm->configure(['action' => '']);
        $oForm->addElement(new \PFBC\Element\Hidden('submit_change_password', 'form_change_password'));
        $oForm->addElement(new \PFBC\Element\Token('change_password'));
        $oForm->addElement(new \PFBC\Element\Password(t('Old password:'), 'old_password', ['required' => 1]));
        $oForm->addElement(new \PFBC\Element\Password(t('New password:'), 'new_password', ['id' => 'password', 'onkeyup' => 'checkPassword(this.value)', 'onblur' => 'CValid(this.value, this.id)', 'required' => 1, 'validation' => new \PFBC\Validation\Password]));
        $oForm->addElement(new \PFBC\Element\HTMLExternal('<span class="input_error password"></span>'));
        $oForm->addElement(new \PFBC\Element\Password(t('Repeat new password:'), '<PASSWORD>', ['required' => 1]));
        $oForm->addElement(new \PFBC\Element\Button(t('Change Password!'), 'submit', ['icon' => 'key']));
        $oForm->addElement(new \PFBC\Element\HTMLExternal('<script src="' . PH7_URL_STATIC . PH7_JS . 'validate.js"></script>'));
        $oForm->render();
    }
}
{'fraction_non_alphanumeric': 0.18859534397070363, 'fraction_numerical': 0.010201412503269683, 'mean_word_length': 3.6127864897466826, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1369785', 'n_tokens_mistral': 1198, 'n_tokens_neox': 1162, 'n_words': 227}