| @@ -1,8 +1,10 @@ | ||
| 1 | 1 | <?php |
| 2 | +defined('ABSPATH') || die('Restricted Access'); | |
| 2 | 3 | |
| 3 | 4 | include_once __DIR__.DIRECTORY_SEPARATOR.'AcymJFormField.php'; |
| 4 | 5 | |
| 6 | +// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- Joomla specific class naming with imposed prefix "JFormField". | |
| 5 | 7 | class JFormFieldArticle extends AcymJFormField |
| 6 | 8 | { |
| 7 | 9 | public function __construct($form = null) |
| 8 | 10 | { |
| @@ -20,8 +22,9 @@ | ||
| 20 | 22 | if (!empty($value)) { |
| 21 | 23 | $title = acym_CMSArticleTitle($value); |
| 22 | 24 | } |
| 23 | 25 | |
| 26 | + // Callback function from the modal to the main window | |
| 24 | 27 | acym_addScript( |
| 25 | 28 | true, |
| 26 | 29 | " |
| 27 | 30 | function $callback(id, title, catid, object, url, language) { |
| @@ -48,9 +51,9 @@ | ||
| 48 | 51 | });" |
| 49 | 52 | ); |
| 50 | 53 | |
| 51 | 54 | $html = '<span class="input-append">'; |
| 52 | - $html .= '<input class="input-medium" id="'.$this->id.'_name" type="text" value="'.acym_escape($title).'" disabled="disabled" size="35" />'; | |
| 55 | + $html .= '<input class="input-medium" id="'.$this->id.'_name" type="text" value="'.esc_attr($title).'" disabled="disabled" size="35" />'; | |
| 53 | 56 | $urlSelect = acym_articleSelectionPage().'&function='.$callback; |
| 54 | 57 | $html .= acym_cmsModal( |
| 55 | 58 | true, |
| 56 | 59 | $urlSelect, |