Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Replaced with for escaping html in templates and added where missing.

givanz0331f4b1f3f7
diff --git a/admin/template/admin.tpl b/admin/template/admin.tpl
index 834ba1d..5e6881a 100755
--- a/admin/template/admin.tpl
+++ b/admin/template/admin.tpl
@@ -1,5 +1,5 @@
-[data-v-url]|href = <?php echo htmlentities(Vvveb\url('@@__data-v-url__@@'));?>
-form[data-v-url]|action = <?php echo htmlentities(Vvveb\url('@@__data-v-url__@@'));?>
+[data-v-url]|href = <?php echo htmlspecialchars(Vvveb\url('@@__data-v-url__@@'));?>
+form[data-v-url]|action = <?php echo htmlspecialchars(Vvveb\url('@@__data-v-url__@@'));?>
[data-v-url-params]|href = <?php echo Vvveb\url(@@__data-v-url-params__@@);?>
form[data-v-url-params]|action = <?php echo Vvveb\url(@@__data-v-url-params__@@);?>
diff --git a/admin/template/admin/role.tpl b/admin/template/admin/role.tpl
index a11bb96..d373951 100755
--- a/admin/template/admin/role.tpl
+++ b/admin/template/admin/role.tpl
@@ -6,9 +6,9 @@ import(common.tpl)
[data-v-role] input[data-v-role-*]|value =
<?php
if (isset($_POST['role']['@@__data-v-role-(*)__@@']))
- echo $_POST['role']['@@__data-v-role-(*)__@@'];
+ echo htmlspecialchars($_POST['role']['@@__data-v-role-(*)__@@']);
else if (isset($this->role['@@__data-v-role-(*)__@@']))
- echo $this->role['@@__data-v-role-(*)__@@'];
+ echo htmlspecialchars($this->role['@@__data-v-role-(*)__@@']);
?>
@@ -16,12 +16,10 @@ import(common.tpl)
[data-v-role] textarea[data-v-role-*] =
<?php
if (isset($_POST['role']['@@__data-v-role-(*)__@@']))
- echo $_POST['role']['@@__data-v-role-(*)__@@'];
+ echo htmlspecialchars($_POST['role']['@@__data-v-role-(*)__@@']);
else if (isset($this->role['@@__data-v-role-(*)__@@']))
- echo $this->role['@@__data-v-role-(*)__@@'];
-?>/* textarea elements */
-
-
+ echo htmlspecialchars($this->role['@@__data-v-role-(*)__@@']);
+?>
[data-v-role] select[data-v-role-*]|before =
<?php
diff --git a/admin/template/admin/user.tpl b/admin/template/admin/user.tpl
index b64c04c..50e6eed 100755
--- a/admin/template/admin/user.tpl
+++ b/admin/template/admin/user.tpl
@@ -6,9 +6,9 @@ import(common.tpl)
[data-v-user] input[data-v-user-*]|value =
<?php
if (isset($_POST['@@__data-v-user-(*)__@@']))
- echo $_POST['@@__data-v-user-(*)__@@'];
+ echo htmlspecialchars($_POST['@@__data-v-user-(*)__@@']);
else if (isset($this->user['@@__data-v-user-(*)__@@']))
- echo $this->user['@@__data-v-user-(*)__@@'];
+ echo htmlspecialchars($this->user['@@__data-v-user-(*)__@@']);
?>
@@ -16,9 +16,9 @@ import(common.tpl)
[data-v-user] textarea[data-v-user-*] =
<?php
if (isset($_POST['@@__data-v-user-(*)__@@']))
- echo $_POST['@@__data-v-user-(*)__@@'];
+ echo htmlspecialchars($_POST['@@__data-v-user-(*)__@@']);
else if (isset($this->user['@@__data-v-user-(*)__@@']))
- echo $this->user['@@__data-v-user-(*)__@@'];
+ echo htmlspecialchars($this->user['@@__data-v-user-(*)__@@']);
?>/* textarea elements */
diff --git a/admin/template/common.tpl b/admin/template/common.tpl
index 3eca3dd..fd9662e 100755
--- a/admin/template/common.tpl
+++ b/admin/template/common.tpl
@@ -12,11 +12,21 @@ import(menu.tpl)
[data-v-check-action-permission]|if_exists = $this->actionPermissions['@@__data-v-check-action-permission__@@']
[data-v-check-permission]|if_exists = $this->modulePermissions['@@__data-v-check-permission__@@']
-html|addNewAttribute = <?php if (isset($_COOKIE['theme'])) {
+html|addNewAttribute = <?php
+$vvveb_is_page_edit = Vvveb\isEditor();
+
+if (isset($_COOKIE['theme']) && !$vvveb_is_page_edit) {
echo 'data-bs-theme="';
if ($_COOKIE['theme'] == 'dark') echo 'dark'; else if ($_COOKIE['theme'] == 'light') echo 'light';else echo 'auto';
echo '"';
-} ?>
+}
+
+if (isset($this->global['rtl']) && $this->global['rtl'] && !$vvveb_is_page_edit) {
+ echo 'dir="rtl"';
+}
+?>
+
+html|lang = $this->global['locale']
#container|addClass = <?php if (isset($_COOKIE['sidebar-size']) && ($_COOKIE['sidebar-size'] == 'small-nav')) {
echo 'small-nav';
diff --git a/admin/template/components/categories.tpl b/admin/template/components/categories.tpl
index 347b60c..5a11c0f 100755
--- a/admin/template/components/categories.tpl
+++ b/admin/template/components/categories.tpl
@@ -24,7 +24,7 @@ if(isset($this->_component['categories']) && is_array($this->_component['categor
@category [data-v-img]|src =
<?php
echo '/image/' .$category['image'];
- //echo htmlentities(str_replace('large', '@@__class:image_([a-zA-Z_]+)__@@', $category['images'][$category['main_image']]['url']));
+ //echo htmlspecialchars(str_replace('large', '@@__class:image_([a-zA-Z_]+)__@@', $category['images'][$category['main_image']]['url']));
?>
diff --git a/admin/template/components/notifications.tpl b/admin/template/components/notifications.tpl
index 8ce97a8..ff471cc 100644
--- a/admin/template/components/notifications.tpl
+++ b/admin/template/components/notifications.tpl
@@ -18,7 +18,7 @@ $count = $notificationComponent['count'] ?? 0;
if ($name == 'updates') continue;
?>
- @notifications [data-v-group-name] = $name
+ @notifications [data-v-group-name] = <?php if ($name) echo Vvveb\__(ucfirst($name));?>
@notifications [data-v-group-notification]|deleteAllButFirstChild
@@ -30,7 +30,7 @@ $count = $notificationComponent['count'] ?? 0;
@notifications a[data-v-group-notification-*]|href = $notification['@@__data-v-group-notification-(*)__@@']
@notifications [data-v-group-notification-*]|innerText = <?php
$name = '@@__data-v-group-notification-(*)__@@';
- if (isset($notification[$name])) echo Vvveb\humanReadable($notification[$name]);
+ if (isset($notification[$name]) && $notification[$name]) echo Vvveb\humanReadable(Vvveb\__(ucfirst($notification[$name])));
?>
diff --git a/admin/template/components/posts.tpl b/admin/template/components/posts.tpl
index be4a222..9b6f76e 100755
--- a/admin/template/components/posts.tpl
+++ b/admin/template/components/posts.tpl
@@ -8,8 +8,8 @@ $_pagination_count = $this->_component['posts'][$_posts_idx]['count'];
$_pagination_limit = isset($this->_component['posts'][$_posts_idx]['limit'])? $this->_component['posts'][$_posts_idx]['limit'] : 5;
?>
-[data-v-component-posts] [data-v-category] = <?php $_category = current($this->_component['posts'][$_posts_idx]['posts']);echo $_category['category'];?>
-[data-v-component-posts] [data-v-manufacturer] = <?php $_manufacturer = current($this->_component['posts'][$_posts_idx]['posts']);echo $_manufacturer['manufacturer'];?>
+[data-v-component-posts] [data-v-category] = <?php $_category = current($this->_component['posts'][$_posts_idx]['posts']);echo htmlspecialchars($_category['category']);?>
+[data-v-component-posts] [data-v-manufacturer] = <?php $_manufacturer = current($this->_component['posts'][$_posts_idx]['posts']);echo htmlspecialchars($_manufacturer['manufacturer']);?>
//$post = [data-v-component-posts] [data-v-post]
@@ -18,35 +18,30 @@ $_pagination_limit = isset($this->_component['posts'][$_posts_idx]['limit'])? $t
if(isset($this->_component['posts']) && is_array($this->_component['posts'][$_posts_idx]['post']))
{
//$pagination = $this->posts[$_posts_idx]['pagination'];
- foreach ($this->_component['posts'][$_posts_idx]['post'] as $index => $post)
- {
- ?>
+ foreach ($this->_component['posts'][$_posts_idx]['post'] as $index => $post) {?>
- @post [data-v-name] = <?php echo $post['name'];?>
- @post [data-v-content] = $post['content']
- @post [data-v-excerpt] = <?php echo substr(strip_tags($post['content']), 0, 50);?>
+ @post [data-v-name] = $post['name']
+ @post [data-v-content] = $post['content']
+ @post [data-v-excerpt] = <?php echo $post['excerpt'] ? $post['excerpt'] : substr(strip_tags($post['content']), 0, 50);?>
@post [data-v-warranty] = $post['warranty']
- @post [data-v-stock] = $post['stock']
- @post [data-v-sku] = $post['sku']
- @post [data-v-weight] = $post['weight']
- @post [data-v-sales] = $post['sales']
- @post [data-v-id] = $post['id']
+ @post [data-v-stock] = $post['stock']
+ @post [data-v-sku] = $post['sku']
+ @post [data-v-weight] = $post['weight']
+ @post [data-v-sales] = $post['sales']
+ @post [data-v-id] = $post['id']
- @post [data-v-price] = $post['price']
+ @post [data-v-price] = $post['price']
@post [data-v-promotional_price] = $post['promotional_price']
- @post [data-v-selling_price] = $post['selling_price']
+ @post [data-v-selling_price] = $post['selling_price']
-
- @post [data-v-img]|src = <?php echo $post['images'][0];?>
-
+ @post [data-v-img]|src = $post['images'][0]
- @post [data-v-url]|href =<?php echo htmlentities(Vvveb\url('content/post/index', $post));?>
+ @post [data-v-url]|href = <?php echo htmlspecialchars(Vvveb\url('content/post/index', $post));?>
@post [data-v-url]|title = $post['title']
- @post [data-v-category] = $post['category'];
+ @post [data-v-category] = $post['category'];
@post [data-v-manufacturer] = $post['manufacturer'];
-
@post|after = <?php
}
}?>
\ No newline at end of file
diff --git a/admin/template/components/products.tpl b/admin/template/components/products.tpl
index c9d470b..eb21e4d 100755
--- a/admin/template/components/products.tpl
+++ b/admin/template/components/products.tpl
@@ -15,8 +15,8 @@ $_pagination_count = $count;
$_pagination_limit = $products['limit'] ?? 5;
?>
-[data-v-component-products] [data-v-category] = <?php $_category = current($products['products']);echo $_category['category'];?>
-[data-v-component-products] [data-v-manufacturer] = <?php $_manufacturer = current($products['products']);echo $_manufacturer['manufacturer'];?>
+[data-v-component-products] [data-v-category] = <?php $_category = current($products['products']); echo htmlspecialchars($_category['category']);?>
+[data-v-component-products] [data-v-manufacturer] = <?php $_manufacturer = current($products['products']); echo htmlspecialchars($_manufacturer['manufacturer']);?>
[data-v-component-products] [data-v-product]|before = <?php
@@ -34,10 +34,10 @@ if(is_array($products['product'])) {
@product [data-v-product-content] = <?php echo $product['content'];?>
- @product [data-v-product-cart-url]|href = <?php echo htmlentities(Vvveb\url('checkout/cart' ,$product));?>
+ @product [data-v-product-cart-url]|href = <?php echo htmlspecialchars(Vvveb\url('checkout/cart' ,$product));?>
@product [data-v-product-cart-url]|data-v-product_id = $product['product_id']
- @product [data-v-product-url]|href =<?php echo htmlentities(Vvveb\url('product/product/index', $product));?>
+ @product [data-v-product-url]|href = <?php echo htmlspecialchars(Vvveb\url('product/product/index', $product));?>
@product [data-v-product-url]|title = $product['title']
@product|after = <?php
diff --git a/admin/template/content/_comments.tpl b/admin/template/content/_comments.tpl
index 4533a06..cbf87a2 100755
--- a/admin/template/content/_comments.tpl
+++ b/admin/template/content/_comments.tpl
@@ -11,7 +11,7 @@ foreach ($this->{{type}}_status as $type => $status) {?>
@status [data-v-status-link] = $status
@status [data-v-status-link]|addClass = <?php if (isset($this->status) && $type == $this->status) echo 'active';?>
- @status [data-v-status-link]|href = <?php echo htmlentities(Vvveb\url(['module' => $this->module . str_replace('_','-','/{{list}}'), 'status' => $type]));?>
+ @status [data-v-status-link]|href = <?php echo htmlspecialchars(Vvveb\url(['module' => $this->module . str_replace('_','-','/{{list}}'), 'status' => $type]));?>
@status|after = <?php }
}?>
diff --git a/admin/template/content/categories.tpl b/admin/template/content/categories.tpl
index d3e985d..1ca54de 100755
--- a/admin/template/content/categories.tpl
+++ b/admin/template/content/categories.tpl
@@ -37,7 +37,7 @@ if ($_categories) {
//catch all data attributes
@taxonomy_item [data-v-taxonomy_item-*] = $taxonomy_item['@@__data-v-taxonomy_item-(*)__@@']
- @taxonomy_item [data-v-taxonomy_item-url]|href = <?php echo htmlentities(Vvveb\url('post/taxonomy_item/index', $taxonomy_item));?>
+ @taxonomy_item [data-v-taxonomy_item-url]|href = <?php echo htmlspecialchars(Vvveb\url('post/taxonomy_item/index', $taxonomy_item));?>
@taxonomy_item [data-v-taxonomy_item-img]|src = $taxonomy_item['images'][0]
@taxonomy_item|append = <?php
diff --git a/admin/template/content/menus/menu.tpl b/admin/template/content/menus/menu.tpl
index 5cb095b..9457bfa 100755
--- a/admin/template/content/menus/menu.tpl
+++ b/admin/template/content/menus/menu.tpl
@@ -1,16 +1,16 @@
import(common.tpl)
@categories = [data-v-categories] [data-v-cats]
-@menu = [data-v-categories] [data-v-cats] [data-v-taxonomy_item]
+@menu = [data-v-categories] [data-v-cats] [data-v-taxonomy_item]
@language = [data-v-languages] [data-v-language]
@categories|deleteAllButFirstChild
@menu|deleteAllButFirstChild
-[data-v-taxonomy_id] = <?php echo $this->menu_data['menu_id'] ?? '';?>
-[data-v-name] = <?php echo $this->menu_data['name'] ?? '';?>
-[data-v-slug] = <?php echo $this->menu_data['slug'] ?? '';?>
+[data-v-taxonomy_id] = <?php echo (int)$this->menu_data['menu_id'];?>
+[data-v-name] = <?php echo htmlspecialchars($this->menu_data['name'] ?? '');?>
+[data-v-slug] = <?php echo htmlspecialchars($this->menu_data['slug'] ?? '');?>
@categories|before = <?php
@@ -57,7 +57,7 @@ if ($_categories) {
@menu [data-v-taxonomy_item-*] = $menu['@@__data-v-taxonomy_item-(*)__@@']
- @menu [data-v-taxonomy_item-url]|href = <?php echo htmlentities(Vvveb\url('post/menu/index', $menu));?>
+ @menu [data-v-taxonomy_item-url]|href = <?php echo htmlspecialchars(Vvveb\url('post/menu/index', $menu));?>
@menu [data-v-taxonomy_item-img]|src = $menu['images'][0]
@menu|append = <?php
@@ -88,22 +88,22 @@ foreach ($languages as $key => $language) {
$code = $language['code'];
?>
- [data-v-languages] [data-v-language-id]|id = <?php echo 'lang-' . $language_id . '-' . $_lang_instance . '-' . $uniq;?>
- [data-v-languages] [data-v-language-id]|addClass = <?php if ($_i == 0) echo 'show active';?>
+ [data-v-languages] [data-v-language-id]|id = <?php echo 'lang-' . $language_id . '-' . $_lang_instance . '-' . $uniq;?>
+ [data-v-languages] [data-v-language-id]|addClass = <?php if ($_i == 0) echo 'show active';?>
[data-v-languages] input[data-v-language_id]|value = <?php echo $language_id;?>
- [data-v-languages] input[data-v-language_id]|name = <?php echo "menu_item_content[$language_id][language_id]";?>
+ [data-v-languages] input[data-v-language_id]|name = <?php echo "menu_item_content[$language_id][language_id]";?>
@language [data-v-language-lang-name]|innerText = <?php echo ucfirst($language['name']);?>
- @language [data-v-language-*]|innerText = $menu['languages'][$language_id]['@@__data-v-language-(*)__@@']
- @language [data-v-language-*]|name = <?php echo "menu_item_content[$language_id][@@__data-v-language-(*)__@@]";?>
- @language input[data-v-language-*]|value = $menu['languages'][$language_id]['@@__data-v-language-(*)__@@']
+ @language [data-v-language-*]|innerText = $menu['languages'][$language_id]['@@__data-v-language-(*)__@@']
+ @language [data-v-language-*]|name = <?php echo "menu_item_content[$language_id][@@__data-v-language-(*)__@@]";?>
+ @language input[data-v-language-*]|value = $menu['languages'][$language_id]['@@__data-v-language-(*)__@@']
- @language [data-v-language-img]|title = $language['name']
- @language [data-v-language-img]|src = <?php echo 'language/' . $language_id . '/' . $language_id . '.png';?>
- @language [data-v-language-link]|href = <?php echo '#lang-' . $language_id . '-' . $_lang_instance . '-' . $uniq;?>
+ @language [data-v-language-img]|title = $language['name']
+ @language [data-v-language-img]|src = <?php echo 'language/' . $language_id . '/' . $language_id . '.png';?>
+ @language [data-v-language-link]|href = <?php echo '#lang-' . $language_id . '-' . $_lang_instance . '-' . $uniq;?>
@language [data-v-language-link]|addClass = <?php if ($_i == 0) echo 'active';?>
@language|after = <?php
-$_i++;
+ $_i++;
}
-?>
\ No newline at end of file
+?>
diff --git a/admin/template/content/pages.tpl b/admin/template/content/pages.tpl
index cb3683c..b19fdfe 100755
--- a/admin/template/content/pages.tpl
+++ b/admin/template/content/pages.tpl
@@ -30,13 +30,13 @@ if(isset($this->posts) && is_array($this->posts))
[data-v-posts] [data-v-post] [data-v-img]|src =
<?php
echo 'http://anne2.givan.ro/image/' .$post['image'];
- //echo htmlentities(str_replace('large', '@@__class:image_([a-zA-Z_]+)__@@', $post['images'][$post['main_image']]['url']));
+ //echo htmlspecialchars(str_replace('large', '@@__class:image_([a-zA-Z_]+)__@@', $post['images'][$post['main_image']]['url']));
?>
- [data-v-posts] [data-v-post] [data-v-post-cart-url]|href = <?php echo htmlentities(Vvveb\url(['module' => 'content/post', 'post_id' => $post['post_id']]));?>
+ [data-v-posts] [data-v-post] [data-v-post-cart-url]|href = <?php echo htmlspecialchars(Vvveb\url(['module' => 'content/post', 'post_id' => $post['post_id']]));?>
- [data-v-posts] [data-v-post] [data-v-url]|href =<?php echo htmlentities(Vvveb\url(['module' => 'content/post', 'post_id' => $post['post_id']]));?>
+ [data-v-posts] [data-v-post] [data-v-url]|href =<?php echo htmlspecialchars(Vvveb\url(['module' => 'content/post', 'post_id' => $post['post_id']]));?>
[data-v-posts] [data-v-post] [data-v-url]|title = $post['title']
[data-v-posts] [data-v-post] [data-v-category] = $post['category'];
diff --git a/admin/template/content/post.tpl b/admin/template/content/post.tpl
index 5facabf..34fb1d7 100755
--- a/admin/template/content/post.tpl
+++ b/admin/template/content/post.tpl
@@ -6,7 +6,7 @@ import(content/edit.tpl, {"type":"post"})
[data-v-post] [data-v-url] = $this->post['url']
[data-v-post] [data-v-design_url]|href = $this->post['design_url']
-[data-v-template_missing] = <?php echo $this->template_missing;?>
+[data-v-template_missing] = $this->template_missing
[data-v-type_name_plural] = $this->type_name_plural
[data-v-type-name] = $this->type_name
[data-v-type] = $this->type
diff --git a/admin/template/content/post_taxonomy.tpl b/admin/template/content/post_taxonomy.tpl
index 78d7471..36fcd66 100755
--- a/admin/template/content/post_taxonomy.tpl
+++ b/admin/template/content/post_taxonomy.tpl
@@ -55,7 +55,7 @@ if(isset($this->taxonomies) && is_array($this->taxonomies)) {
//catch all data attributes
@category [data-v-taxonomy_item-*] = $taxonomyItem['@@__data-v-taxonomy_item-(*)__@@']
- @category [data-v-taxonomy_item-url]|href = <?php echo htmlentities(Vvveb\url('product/taxonomy_item/index', $taxonomyItem));?>
+ @category [data-v-taxonomy_item-url]|href = <?php echo htmlspecialchars(Vvveb\url('product/taxonomy_item/index', $taxonomyItem));?>
@category [data-v-taxonomy_item-img]|src = $taxonomyItem['images'][0]
@category|append = <?php
@@ -94,10 +94,10 @@ if(isset($this->taxonomies) && is_array($this->taxonomies)) {
//catch all data attributes
@tag [data-v-taxonomy_item-*] = $taxonomyItem['@@__data-v-taxonomy_item-(*)__@@']
- @tag [data-v-taxonomy_item-url]|href = <?php echo htmlentities(Vvveb\url('product/taxonomy_item/index', $taxonomyItem));?>
+ @tag [data-v-taxonomy_item-url]|href = <?php echo htmlspecialchars(Vvveb\url('product/taxonomy_item/index', $taxonomyItem));?>
@tag [data-v-taxonomy_item-img]|src = $taxonomyItem['images'][0]
@tag [data-v-taxonomy_item-list-name]|name = <?php echo "tag[$taxonomy_item[taxonomy_id]][$taxonomyItem[taxonomy_item_id]]";?>
- @tag [data-v-taxonomy_item-list-name]|value = <?php echo $taxonomyItem['name'];?>
+ @tag [data-v-taxonomy_item-list-name]|value = $taxonomyItem['name']
@tag|append = <?php
}?>
diff --git a/admin/template/crud.tpl b/admin/template/crud.tpl
index 8817c02..80e0f8f 100755
--- a/admin/template/crud.tpl
+++ b/admin/template/crud.tpl
@@ -10,7 +10,7 @@ import(common.tpl)
$value = $this->{{type}}[$name];
else $value = '@@__value__@@';
- echo $value;
+ echo htmlspecialchars($value);
?>
/* textarea elements */
@@ -23,7 +23,7 @@ import(common.tpl)
$value = $this->{{type}}[$name];
else $value = '@@__innerHTML__@@';
- echo $value;
+ echo htmlspecialchars($value);
?>
[data-v-{{type}}] select[data-v-{{type}}-*]|before =
diff --git a/admin/template/editor/editor.tpl b/admin/template/editor/editor.tpl
index 01e85e9..3eac349 100755
--- a/admin/template/editor/editor.tpl
+++ b/admin/template/editor/editor.tpl
@@ -93,8 +93,8 @@ if (isset($this->$name)) {
}
?>
- @templates-select-option|value = <?php echo $option['file'];?>
- @templates-select-option = <?php echo ucfirst($option['title']);?>
+ @templates-select-option|value = echo $option['file'];
+ @templates-select-option = <?php echo htmlspecialchars(ucfirst($option['title']));?>
@templates-select-option|addNewAttribute = <?php if ($option['file'] == 'blank.html') echo 'selected';?>
@templates-select-option|after = <?php
diff --git a/admin/template/filters.tpl b/admin/template/filters.tpl
index 54e94d0..209c492 100755
--- a/admin/template/filters.tpl
+++ b/admin/template/filters.tpl
@@ -1,16 +1,16 @@
-input[name="module"]|value = <?php echo htmlentities(Vvveb\get('module'));?>
-input[name="action"]|value = <?php echo htmlentities(Vvveb\get('action'));?>
-input[name="type"]|value = <?php echo htmlentities(Vvveb\get('type'));?>
+input[name="module"]|value = <?php echo htmlspecialchars(Vvveb\get('module'));?>
+input[name="action"]|value = <?php echo htmlspecialchars(Vvveb\get('action'));?>
+input[name="type"]|value = <?php echo htmlspecialchars(Vvveb\get('type'));?>
#filters|addClass = <?php if ($this->filter) echo 'show';?>
#filters input[type="text"],#filters input[type="search"]|value = <?php
$name = str_replace(['filter[',']'], '', '@@__name__@@');
- if (isset($this->filter[$name])) echo $this->filter[$name];
+ if (isset($this->filter[$name])) echo htmlspecialchars($this->filter[$name]);
?>
#filters input.autocomplete|data-text = <?php
$text = $name. '_text';
-if (isset($this->filter[$text])) echo $this->filter[$text];
+if (isset($this->filter[$text])) echo htmlspecialchars($this->filter[$text]);
?>
@@ -36,7 +36,7 @@ if (isset($this->filter[$text])) echo $this->filter[$text];
foreach($options as $key => $option){?>
@option|value = $key
- @option = <?php echo Vvveb\humanReadable($option);?>
+ @option = <?php echo htmlspecialchars(Vvveb\humanReadable($option));?>
@option|after = <?php
}}?>
diff --git a/admin/template/ifmacros.tpl b/admin/template/ifmacros.tpl
index 4607583..8e89566 100755
--- a/admin/template/ifmacros.tpl
+++ b/admin/template/ifmacros.tpl
@@ -16,4 +16,7 @@ if (!@($condition) || (isset($vvveb_is_page_edit) && $vvveb_is_page_edit)) {
[data-v-if-not]|after = <?php } ?>
[data-v-class-if-*]|addClass = <?php @@macro IfClass("")@@?>
-[data-v-class-if-not-*]|addClass = <?php @@macro IfClass("")@@?>
\ No newline at end of file
+[data-v-class-if-not-*]|addClass = <?php @@macro IfClass("")@@?>
+
+[data-v-attr-if-*]|addClass = <?php @@macro IfAttr("")@@?>
+[data-v-attr-if-not-*]|addClass = <?php @@macro IfAttr("")@@?>
\ No newline at end of file
diff --git a/admin/template/localization/region-group.tpl b/admin/template/localization/region-group.tpl
index f5b6a52..1470a90 100755
--- a/admin/template/localization/region-group.tpl
+++ b/admin/template/localization/region-group.tpl
@@ -11,7 +11,7 @@ if(isset($this->regions) && is_array($this->regions)) {
foreach ($this->regions as $region_index => $region) { ?>
@region [data-v-region-*]|name = <?php echo "region[$region_index][@@__data-v-region-(*)__@@]";?>
- @region [data-v-region-*]|data-v-region-id = <?php echo $region['region_id'];?>
+ @region [data-v-region-*]|data-v-region-id = $region['region_id']
@region [data-v-region-*]|innerText = $region['@@__data-v-region-(*)__@@']
@region input[data-v-region-*]|value = $region['@@__data-v-region-(*)__@@']
diff --git a/admin/template/notifications.tpl b/admin/template/notifications.tpl
index 114d752..32cdb53 100755
--- a/admin/template/notifications.tpl
+++ b/admin/template/notifications.tpl
@@ -3,7 +3,7 @@
@error|before = <?php
if (isset($this->errors) && is_array($this->errors)) foreach($this->errors as $message) {?>
- @error [data-v-notification-text] = <?php echo $message;?>
+ @error [data-v-notification-text] = $message
@error|after = <?php
}
@@ -13,7 +13,7 @@ if (isset($this->errors) && is_array($this->errors)) foreach($this->errors as $m
@success|before = <?php
if (isset($this->success) && is_array($this->success)) foreach($this->success as $message) {?>
- @success [data-v-notification-text] = <?php echo $message;?>
+ @success [data-v-notification-text] = $message
@success|after = <?php
}
@@ -23,7 +23,7 @@ if (isset($this->success) && is_array($this->success)) foreach($this->success as
@warning|before = <?php
if (isset($this->warning) && is_array($this->warning)) foreach($this->warning as $message) {?>
- @warning [data-v-notification-text] = <?php echo $message;?>
+ @warning [data-v-notification-text] = $message
@warning|after = <?php
}
@@ -33,7 +33,7 @@ if (isset($this->warning) && is_array($this->warning)) foreach($this->warning as
@info|before = <?php
if (isset($this->info) && is_array($this->info)) foreach($this->info as $message) {?>
- @info [data-v-notification-text] = <?php echo $message;?>
+ @info [data-v-notification-text] = $message
@info|after = <?php
}
@@ -43,7 +43,7 @@ if (isset($this->info) && is_array($this->info)) foreach($this->info as $message
@message|before = <?php
if (isset($this->message) && is_array($this->message)) foreach($this->message as $message) {?>
- @message [data-v-notification-text] = <?php echo $message;?>
+ @message [data-v-notification-text] = $message
@message|after = <?php
}
diff --git a/admin/template/order/order.tpl b/admin/template/order/order.tpl
index f4ad5a1..df474fe 100755
--- a/admin/template/order/order.tpl
+++ b/admin/template/order/order.tpl
@@ -48,7 +48,7 @@ if(is_array($logs)) foreach ($logs as $index => $log) {
?>
//catch all data attributes
- @log [data-v-order-log-note]|innerText = <?php echo nl2br(htmlentities($log['@@__data-v-order-log-(*)__@@']));?>
+ @log [data-v-order-log-note]|innerText = <?php echo nl2br(htmlspecialchars($log['@@__data-v-order-log-(*)__@@']));?>
@log [data-v-order-log-*]|innerText = $log['@@__data-v-order-log-(*)__@@']
@log a[data-v-order-log-*]|href = $log['@@__data-v-order-log-(*)__@@']
@log input[data-v-order-log-*]|value = $log['@@__data-v-order-log-(*)__@@']
@@ -58,6 +58,7 @@ if(is_array($logs)) foreach ($logs as $index => $log) {
[data-v-order] [data-v-order-*]|innerText = $this->order['@@__data-v-order-(*)__@@']
+[data-v-order] a[data-v-order-*]|href = $this->order['@@__data-v-order-(*)__@@']
[data-v-order] [data-v-order-site_url]|href = $this->order['site_url']
diff --git a/admin/template/pagination.tpl b/admin/template/pagination.tpl
index e6d5c50..7ba79c1 100755
--- a/admin/template/pagination.tpl
+++ b/admin/template/pagination.tpl
@@ -38,22 +38,21 @@ if ($pagecount > $maxpages)
}
?>
-@page|before = <?php for (;$page <= $page_stop;$page++) {
-?>
+@page|before = <?php for (;$page <= $page_stop;$page++) { ?>
[data-pagination] [data-count] = $this->count
[data-pagination] [data-current-page] = $current_page
[data-pagination] [data-pagecount] = $pagecount
+
@page [data-page-no] = $page
-@page [data-page-url]|href = <?php echo htmlentities(Vvveb\url(['page' => $page] , true));?>
+@page [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url(['page' => $page] , true));?>
@page|addClass = <?php if ($current_page == $page) echo 'active'?>
-[data-pagination] [data-current-url]|action = <?php echo htmlentities(Vvveb\url(['page' => $current_page], true));?>
-
-[data-pagination] [data-first] [data-page-url]|href = <?php echo htmlentities(Vvveb\url(['page' => 1], true));?>
-[data-pagination] [data-prev] [data-page-url]|href = <?php echo htmlentities(Vvveb\url(['page' => max($current_page - 1, 1)], true));?>
-[data-pagination] [data-next] [data-page-url]|href = <?php echo htmlentities(Vvveb\url(['page' => min($current_page + 1, $pagecount)], true));?>
-[data-pagination] [data-last] [data-page-url]|href = <?php echo htmlentities(Vvveb\url(['page' => $pagecount], true));?>
+[data-pagination] [data-current-url]|action = <?php echo htmlspecialchars(Vvveb\url(['page' => $current_page], true));?>
+[data-pagination] [data-first] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url(['page' => 1], true));?>
+[data-pagination] [data-prev] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url(['page' => max($current_page - 1, 1)], true));?>
+[data-pagination] [data-next] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url(['page' => min($current_page + 1, $pagecount)], true));?>
+[data-pagination] [data-last] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url(['page' => $pagecount], true));?>
@page|after = <?php } ?>
diff --git a/admin/template/plugin/market.tpl b/admin/template/plugin/market.tpl
index c4b8dff..e42f2c5 100755
--- a/admin/template/plugin/market.tpl
+++ b/admin/template/plugin/market.tpl
@@ -19,7 +19,7 @@ if(isset($this->plugins) && is_array($this->plugins))
@plugin [data-v-plugin-install-url]|href = <?php echo Vvveb\url( ['module' => 'plugin/market', 'action' => 'install', 'slug' => $plugin['slug']]); ?>
@plugin [data-v-plugin-install-url]|data-slug = $plugin['slug']
- //@plugin [data-v-plugin-author] = <?php echo $plugin['author'];?>
+ //@plugin [data-v-plugin-author] = $plugin['author'];
[data-v-plugins] [data-v-plugin]|after = <?php
}
diff --git a/admin/template/plugin/market/install.tpl b/admin/template/plugin/market/install.tpl
index 091f9f9..a497141 100755
--- a/admin/template/plugin/market/install.tpl
+++ b/admin/template/plugin/market/install.tpl
@@ -5,7 +5,7 @@ import(common.tpl)
@log|before = <?php
if (isset($this->log) && is_array($this->log)) foreach($this->log as $message) {?>
- @log [data-v-log-text] = <?php echo $message;?>
+ @log [data-v-log-text] = $message
@log|after = <?php
}
diff --git a/admin/template/plugin/plugins.tpl b/admin/template/plugin/plugins.tpl
index 44686f5..5755485 100755
--- a/admin/template/plugin/plugins.tpl
+++ b/admin/template/plugin/plugins.tpl
@@ -10,7 +10,7 @@ foreach ($this->categories as $category => $plugins) {?>
@category [data-v-category-link] = $category
@category [data-v-category-link]|addClass = <?php if (isset($this->category) && $category == $this->category) echo 'active';?>
- @category [data-v-category-link]|href = <?php echo htmlentities(Vvveb\url(['module' => 'plugin/plugins', 'category' => $category]));?>
+ @category [data-v-category-link]|href = <?php echo htmlspecialchars(Vvveb\url(['module' => 'plugin/plugins', 'category' => $category]));?>
@category|after = <?php }
}?>
diff --git a/admin/template/plugin/plugins_list.tpl b/admin/template/plugin/plugins_list.tpl
index 0db2c78..c386185 100755
--- a/admin/template/plugin/plugins_list.tpl
+++ b/admin/template/plugin/plugins_list.tpl
@@ -16,7 +16,7 @@ if(isset($this->plugins) && is_array($this->plugins)) {
@plugin [data-v-plugin-*]|innerText = $plugin['@@__data-v-plugin-([-_\w]+)__@@']
@plugin a[data-v-plugin-*]|href = $plugin['@@__data-v-plugin-([-_\w]+)__@@']
- @plugin [data-v-plugin-author-url]|href = <?php echo $plugin['author-url'] ?? '';?>
+ @plugin [data-v-plugin-author-url]|href = $plugin['author-url']
@plugin [data-v-plugin-activate-url]|href = <?php echo Vvveb\url(['module' => 'plugin/plugins', 'action'=> 'checkPluginAndActivate', 'plugin' => $plugin['slug'], 'category' => $category]);?>
@plugin [data-v-plugin-deactivate-url]|href = <?php echo Vvveb\url(['module' => 'plugin/plugins', 'action'=> 'deactivate', 'plugin' => $plugin['slug'], 'category' => $category]);?>
diff --git a/admin/template/product/attribute-group.tpl b/admin/template/product/attribute-group.tpl
index 2ff2d81..547c466 100755
--- a/admin/template/product/attribute-group.tpl
+++ b/admin/template/product/attribute-group.tpl
@@ -12,14 +12,13 @@ if(isset($this->attributes) && is_array($this->attributes)) {
@attribute [data-v-attribute-*]|innerText = $attribute['@@__data-v-attribute-(*)__@@']
- @attribute input[data-v-attribute-*]|value = $attribute['@@__data-v-attribute-(*)__@@']
+ @attribute input[data-v-attribute-*]|value = $attribute['@@__data-v-attribute-(*)__@@']
@attribute input[data-v-attribute-*]|value = $attribute['@@__data-v-attribute-(*)__@@']
- @attribute a[data-v-attribute-*]|href = $attribute['@@__data-v-attribute-(*)__@@']
+ @attribute a[data-v-attribute-*]|href = $attribute['@@__data-v-attribute-(*)__@@']
@attribute [data-v-attribute-*]|name = <?php echo "attribute[$attribute_index][@@__data-v-attribute-(*)__@@]";?>
- @attribute [data-v-attribute-*]|data-v-attribute-id = <?php echo $attribute['attribute_id'];?>
- @attribute|data-id = <?php echo $attribute['attribute_id'];?>
-
+ @attribute [data-v-attribute-*]|data-v-attribute-id = $attribute['attribute_id']
+ @attribute|data-id = $attribute['attribute_id']
@attribute|after = <?php
$count++;
diff --git a/admin/template/product/categories.tpl b/admin/template/product/categories.tpl
index d3e985d..756bb8f 100755
--- a/admin/template/product/categories.tpl
+++ b/admin/template/product/categories.tpl
@@ -37,7 +37,7 @@ if ($_categories) {
//catch all data attributes
@taxonomy_item [data-v-taxonomy_item-*] = $taxonomy_item['@@__data-v-taxonomy_item-(*)__@@']
- @taxonomy_item [data-v-taxonomy_item-url]|href = <?php echo htmlentities(Vvveb\url('post/taxonomy_item/index', $taxonomy_item));?>
+ @taxonomy_item [data-v-taxonomy_item-url]|href = <?php echo htmlspecialchars(Vvveb\url('post/taxonomy_item/index', $taxonomy_item));?>
@taxonomy_item [data-v-taxonomy_item-img]|src = $taxonomy_item['images'][0]
@taxonomy_item|append = <?php
@@ -70,7 +70,7 @@ foreach ($languages as $key => $language) {
[data-v-languages] [data-v-language-id]|id = <?php echo 'lang-' . $language_id . '-' . $_lang_instance . '-' . $uniq;?>
[data-v-languages] [data-v-language-id]|addClass = <?php if ($_i == 0) echo 'show active';?>
[data-v-languages] [data-v-language_id]|name = <?php echo "taxonomy_item_content[$language_id][language_id]";?>
- [data-v-languages] [data-v-language_id]|value = <?php echo $language_id;?>
+ [data-v-languages] [data-v-language_id]|value = $language_id
@language [data-v-language-lang-name]|innerText = <?php echo ucfirst($language['name']);?>
@language [data-v-language-*]|innerText = $taxonomy_item['languages'][$language_id]['@@__data-v-language-(*)__@@']
diff --git a/admin/template/product/option.tpl b/admin/template/product/option.tpl
index c74c92a..ded6b53 100644
--- a/admin/template/product/option.tpl
+++ b/admin/template/product/option.tpl
@@ -17,23 +17,23 @@ if(isset($this->option_values) && is_array($this->option_values)) {
@option_value a[data-v-option_value-*]|href = $option_value['@@__data-v-option_value-(*)__@@']
@option_value [data-v-option_value-*]|name = <?php echo "option_value[$option_value_index][@@__data-v-option_value-(*)__@@]";?>
- @option_value [data-v-option_value-*]|data-v-option_value-id = <?php echo $option_value['option_value_id'];?>
+ @option_value [data-v-option_value-*]|data-v-option_value-id = $option_value['option_value_id']
// image input
- @option_value input[data-v-image]|name = <?php echo 'option_value[' . $option_value_index . '][image]';?>
- @option_value input[data-v-image]|value = $option_value['image']
- @option_value input[data-v-image]|id = <?php echo 'option_value_' . $option_value_index . '-input';?>
+ @option_value input[data-v-image]|name = <?php echo 'option_value[' . $option_value_index . '][image]';?>
+ @option_value input[data-v-image]|value = $option_value['image']
+ @option_value input[data-v-image]|id = <?php echo 'option_value_' . $option_value_index . '-input';?>
// image
- @option_value img[data-v-image]|id = <?php echo 'option_value_' . $option_value_index. '-thumb';?>
- @option_value img[data-v-image]|src = $option_value['image_url']
+ @option_value img[data-v-image]|id = <?php echo 'option_value_' . $option_value_index. '-thumb';?>
+ @option_value img[data-v-image]|src = $option_value['image_url']
@option_value img[data-v-image]|data-target-input = <?php echo '#option_value_' . $option_value_index . '-input';?>
@option_value img[data-v-image]|data-target-thumb = <?php echo '#option_value_' . $option_value_index . '-thumb';?>
@option_value button[data-media-gallery]|data-target-input = <?php echo '#option_value_' . $option_value_index . '-input';?>
@option_value button[data-media-gallery]|data-target-thumb = <?php echo '#option_value_' . $option_value_index . '-thumb';?>
- @option_value|data-id = <?php echo $option_value['option_value_id'];?>
+ @option_value|data-id = $option_value['option_value_id']
@option_value|after = <?php
$count++;
diff --git a/admin/template/product/product.tpl b/admin/template/product/product.tpl
index 60c8a52..98ed303 100755
--- a/admin/template/product/product.tpl
+++ b/admin/template/product/product.tpl
@@ -4,7 +4,7 @@ import(content/edit.tpl, {"type":"product"})
[data-v-product] .autocomplete|data-text = <?php
$text = '@@__data-v-product-(*)__@@_text';
$value = $this->$text ?? '';
- echo $value;
+ echo htmlspecialchars($value);
?>
import(product/product/variant.tpl)
@@ -28,8 +28,8 @@ import(product/product/digital_asset.tpl)
if ($value) echo 'checked';
?>
-[data-v-template_missing] = <?php echo $this->template_missing;?>
-[data-v-type_name_plural] = $this->type_name_plural
-[data-v-type-name] = $this->type_name
-[data-v-type] = $this->type
+[data-v-template_missing] = $this->template_missing
+[data-v-type_name_plural] = $this->type_name_plural
+[data-v-type-name] = $this->type_name
+[data-v-type] = $this->type
[data-v-products-list-url]|href = $this->posts_list_url
diff --git a/admin/template/product/product/option.tpl b/admin/template/product/product/option.tpl
index 2004131..1a8309b 100644
--- a/admin/template/product/product/option.tpl
+++ b/admin/template/product/product/option.tpl
@@ -8,7 +8,7 @@
if(isset($this->product['product_option']) && is_array($this->product['product_option'])) {
$index = 0;
foreach ($this->product['product_option'] as $product_option_id => $poption) {
- $index++;
+ $index++;
?>
@product-option .values|addClass = <?php if (! ($poption['type'] == 'radio' || $poption['type'] == 'checkbox' || $poption['type'] == 'select') ) echo 'd-none';?>
@@ -17,14 +17,14 @@ foreach ($this->product['product_option'] as $product_option_id => $poption) {
@product-option [data-v-poption-*]|name = <?php echo "product_option[$product_option_id][@@__data-v-poption-(*)__@@]";?>
@product-option input[data-v-poption-*]|value = $poption['@@__data-v-poption-(*)__@@']
- @product-option [data-v-poption-*]|innerText = <?php echo $poption['@@__data-v-poption-(*)__@@'];?>
+ @product-option [data-v-poption-*]|innerText = $poption['@@__data-v-poption-(*)__@@']
@product-option [data-v-poption-option_id]|before = <?php $selected = $poption['option_id'] ?? false;?>
@product-option [data-v-poption-required]|addNewAttribute = <?php if ($poption['required'] == '1') echo 'checked';?>
- @product-option a[data-v-poption-product_option_id]|href = <?php echo '#option-' . $poption['product_option_id'];?>
- @product-option a[data-v-poption-product_option_id]|data-id = <?php echo $poption['product_option_id'];?>
- @product-option div[data-v-poption-product_option_id]|id = <?php echo 'option-' . $poption['product_option_id'];?>
+ @product-option a[data-v-poption-product_option_id]|href = <?php echo '#option-' . $poption['product_option_id'];?>
+ @product-option a[data-v-poption-product_option_id]|data-id = $poption['product_option_id']
+ @product-option div[data-v-poption-product_option_id]|id = <?php echo 'option-' . $poption['product_option_id'];?>
@product-option a[data-v-poption-product_option_id]|addClass = <?php if ($index == 1) echo 'active';?>
[data-v-product] [data-v-product-poption] div[data-v-poption]|addClass = <?php if ($index == 1) echo 'active show';?>
@@ -40,11 +40,11 @@ foreach ($this->product['product_option'] as $product_option_id => $poption) {
@value input[type="radio"]|addNewAttribute = <?php if ($poption_value['@@__data-v-option-value-(*)__@@'] == '@@__value__@@') echo 'checked';?>
@value input[type="checkbox"]|addNewAttribute = <?php if ($poption_value['@@__data-v-option-value-(*)__@@'] == 1) echo 'checked';?>
- @value|data-id = <?php echo $poption_value['product_option_value_id'];?>
+ @value|data-id = $poption_value['product_option_value_id']
- @value [data-v-option-value-*]|name = <?php echo "product_option[$product_option_id][product_option_value][$product_option_value_id][@@__data-v-option-value-(*)__@@]";?>
- [data-v-poption] .template [data-v-option-value-*]|name = <?php echo "product_option[$product_option_id][product_option_value][#][@@__data-v-option-value-(*)__@@]";?>
- @value [data-v-option-value-*]|innerText = <?php echo $poption_value['@@__data-v-option-value-(*)__@@'] ?? '';?>
+ @value [data-v-option-value-*]|name = <?php echo "product_option[$product_option_id][product_option_value][$product_option_value_id][@@__data-v-option-value-(*)__@@]";?>
+ [data-v-poption] .template [data-v-option-value-*]|name = <?php echo "product_option[$product_option_id][product_option_value][#][@@__data-v-option-value-(*)__@@]";?>
+ @value [data-v-option-value-*]|innerText = $poption_value['@@__data-v-option-value-(*)__@@']
@value|after = <?php
}
@@ -62,8 +62,8 @@ foreach ($this->product['product_option'] as $product_option_id => $poption) {
if (isset($poption['option_id']) && isset($this->product['option_value_content'][$poption['option_id']]))
foreach ($this->product['option_value_content'][$poption['option_id']] as $poption_value_id => $poption_value_content) {?>
- @option = <?php echo $poption_value_content['name'] ?? '';?>
- @option|value = <?php echo $poption_value_content['option_value_id'] ?? '';?>
+ @option = $poption_value_content['name']
+ @option|value = $poption_value_content['option_value_id']
@option|addNewAttribute = <?php if ($poption_value_content['option_value_id'] == $poption_value['option_value_id']) echo 'selected';?>
@option|after = <?php
diff --git a/admin/template/settings/email.tpl b/admin/template/settings/email.tpl
index 0afbc4c..a57424d 100755
--- a/admin/template/settings/email.tpl
+++ b/admin/template/settings/email.tpl
@@ -5,12 +5,12 @@ import(common.tpl)
.settings input[data-v-setting]|value = <?php
$_setting = '@@__data-v-setting__@@';
- echo $_POST['settings'][$_setting] ?? \Vvveb\arrayPath($this->email, $_setting) ?? '';
+ echo htmlspecialchars($_POST['settings'][$_setting] ?? \Vvveb\arrayPath($this->email, $_setting) ?? '');
?>
.settings textarea[data-v-setting] = <?php
$_setting = '@@__data-v-setting__@@';
- echo $_POST['settings'][$_setting] ?? \Vvveb\arrayPath($this->email, $_setting) ?? '';
+ echo htmlspecialchars($_POST['settings'][$_setting] ?? \Vvveb\arrayPath($this->email, $_setting) ?? '');
?>
@@ -18,8 +18,26 @@ import(common.tpl)
$_setting = '@@__data-v-setting__@@';
?>
+#input-mail-driver option|deleteAllButFirst
+
+#input-mail-driver option|before = <?php
+ if (isset($this->drivers)) {
+ $setting = $_POST['settings'][$_setting] ?? \Vvveb\arrayPath($this->email, $_setting) ?? '';
+ foreach ($this->drivers as $value => $text) {
+ ?>
+
+ #input-mail-driver option|innerText = $text
+ #input-mail-driver option|value = $value
+ #input-mail-driver option|addNewAttribute = <?php if ($setting == $value) echo 'selected';?>
+
+#input-mail-driver option|after = <?php
+} } ?>
+
+/*
.settings select[data-v-setting] option|addNewAttribute = <?php
$value = '@@__value__@@';
$setting = $_POST['settings'][$_setting] ?? \Vvveb\arrayPath($this->email, $_setting) ?? '';
if ($setting == $value) echo 'selected';
?>
+
+*/
diff --git a/admin/template/settings/site.tpl b/admin/template/settings/site.tpl
index 533964f..24fe446 100755
--- a/admin/template/settings/site.tpl
+++ b/admin/template/settings/site.tpl
@@ -8,9 +8,7 @@ import(crud.tpl, {"type":"site"})
[data-v-theme-list] option|value = $code
[data-v-theme-list] option|addNewAttribute = <?php if (isset($this->site['theme']) && ($code == $this->site['theme'])) echo 'selected';?>
- [data-v-theme-list] option = <?php
- echo $theme['name'];
- ?>
+ [data-v-theme-list] option = $theme['name']
[data-v-theme-list] option|after = <?php
} ?>
@@ -26,7 +24,7 @@ import(crud.tpl, {"type":"site"})
foreach($options as $key => $option){?>
@templates-select-option|value = $option
- @templates-select-option = <?php echo ucfirst($option);?>
+ @templates-select-option = <?php echo htmlspecialchars(ucfirst($option));?>
@templates-select-option|after = <?php
}?>
@@ -48,9 +46,9 @@ if (($optgroup != $option['folder'])) {
}
?>
-@templates-select-option|value = <?php echo $option['file'];?>
+@templates-select-option|value = $option['file']
@templates-select-option|addNewAttribute = <?php if (isset($this->site['template']) && $option['file']== $this->site['template']) echo 'selected';?>
-@templates-select-option = <?php echo ucfirst($option['title']);?>
+@templates-select-option = <?php echo htmlspecialchars(ucfirst($option['title']));?>
input[data-v-site-*]|value = <?php
@@ -64,7 +62,7 @@ input[data-v-site-*]|value = <?php
$value = $_default;
}
- echo $value;
+ echo htmlspecialchars($value);
?>
input[data-v-site-*][type=checkbox]|addNewAttribute = <?php
@@ -81,7 +79,7 @@ input[data-v-setting]|value = <?php
$_setting = '@@__data-v-setting__@@';
$_default = '@@__value__@@';
$value = $_POST['settings'][$_setting] ?? $this->setting[$_setting] ?? $_default;
- echo $value;
+ echo htmlspecialchars($value);
//name="settings[setting-name] > get only setting-name
//$_setting = '@@__name:\[(.*)\]__@@';
?>
@@ -90,7 +88,7 @@ img[data-v-setting]|src = <?php
$_setting = '@@__data-v-setting__@@';
$_default = '@@__value__@@';
$value = $this->setting[$_setting] ?? $_default;
- echo $value;
+ echo htmlspecialchars($value);
//name="settings[setting-name] > get only setting-name
//$_setting = '@@__name:\[(.*)\]__@@';
?>
@@ -148,9 +146,7 @@ $setting = '@@__name:\[(.*)\]__@@';
[data-v-resize] option|value = $value
[data-v-resize] option|addNewAttribute = <?php if (isset($this->site[$setting]) && $this->site[$setting] == $value) echo 'selected';?>
- [data-v-resize] option = <?php
- echo $name;
- ?>
+ [data-v-resize] option = $name
[data-v-resize] option|after = <?php
} ?>
@@ -218,11 +214,11 @@ $_i++;
[data-v-languages] input[data-v-site-description-*]|value = <?php
$desc = '@@__data-v-site-description-(*)__@@';
if (isset($content[$desc]))
- echo $content[$desc];
+ echo htmlspecialchars($content[$desc]);
?>
[data-v-languages] [data-v-site-description-*]|innerText = <?php
$desc = '@@__data-v-site-description-(*)__@@';
if (isset($this->site['description'][$language['language_id']][$desc]))
- echo $this->site['description'][$language['language_id']][$desc];
+ echo htmlspecialchars($this->site['description'][$language['language_id']][$desc]);
?>
\ No newline at end of file
diff --git a/admin/template/theme/themes_list.tpl b/admin/template/theme/themes_list.tpl
index 58ff334..8810889 100755
--- a/admin/template/theme/themes_list.tpl
+++ b/admin/template/theme/themes_list.tpl
@@ -37,7 +37,7 @@ if (!function_exists("import_generate_list")) {
?>
-[data-v-import] [data-v-list] [data-v-list-item-name] = <?php echo ucfirst($name);?>
+[data-v-import] [data-v-list] [data-v-list-item-name] = <?php echo htmlspecialchars(ucfirst($name));?>
[data-v-import] [data-v-list] label|for = <?php echo 'menu-' . $uniqId;?>
[data-v-import] [data-v-list] input|id = <?php echo 'menu-' . $uniqId;?>
diff --git a/admin/template/tools/systeminfo.tpl b/admin/template/tools/systeminfo.tpl
index 7c3d332..4e000fb 100755
--- a/admin/template/tools/systeminfo.tpl
+++ b/admin/template/tools/systeminfo.tpl
@@ -6,7 +6,7 @@ import(common.tpl)
foreach ($this->info as $category => $info) {
?>
- [data-v-category] = <?php echo ucfirst($category);?>
+ [data-v-category] = <?php echo htmlspecialchars(ucfirst($category));?>
.header|for = $category
.header_check|id = $category
@@ -17,7 +17,7 @@ foreach ($this->info as $category => $info) {
@entry [data-v-name] = $name
@entry [data-v-value] = <?php
if (is_string($value)) {
- echo htmlentities($value);
+ echo htmlspecialchars($value);
} else {
highlight_string(var_export($value, true));
}
@@ -29,4 +29,4 @@ foreach ($this->info as $category => $info) {
[data-v-info]|after = <?php } ?>
-[data-v-phpinfo] = <?php echo $this->phpinfo ?? '';?>
+[data-v-phpinfo] = $this->phpinfo
diff --git a/admin/template/user/login.tpl b/admin/template/user/login.tpl
index bc52739..81bda11 100755
--- a/admin/template/user/login.tpl
+++ b/admin/template/user/login.tpl
@@ -1,8 +1,8 @@
//keep post values
-input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@']; else echo '@@__value__@@';?>
+input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']); else echo '@@__value__@@';?>
#redir|value = <?php
if (isset($this->redir)) {
- echo $this->redir;
+ echo htmlspecialchars($this->redir);
} else {
//echo '/admin';
//echo Vvveb\escUrl($_SERVER['REQUEST_URI']);
diff --git a/admin/template/user/reset.tpl b/admin/template/user/reset.tpl
index d1fd9ce..6f14e21 100755
--- a/admin/template/user/reset.tpl
+++ b/admin/template/user/reset.tpl
@@ -1,4 +1,4 @@
//keep post values
-input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
+input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']);?>
import(common.tpl)
diff --git a/admin/template/user/reset/reset.tpl b/admin/template/user/reset/reset.tpl
index d1fd9ce..6f14e21 100755
--- a/admin/template/user/reset/reset.tpl
+++ b/admin/template/user/reset/reset.tpl
@@ -1,4 +1,4 @@
//keep post values
-input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
+input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']);?>
import(common.tpl)
diff --git a/admin/template/user/users.tpl b/admin/template/user/users.tpl
index 739e917..b975257 100755
--- a/admin/template/user/users.tpl
+++ b/admin/template/user/users.tpl
@@ -15,18 +15,15 @@ if(isset($this->users) && is_array($this->users)) {
$status_class = $user['status'] == 1 ? 'bg-success' :($user['status'] == 0 ? 'bg-body-secondary text-muted' : $user['status']);
?>
- @user [data-v-*]|innerText = $user['@@__data-v-(*)__@@']
- @user input[data-v-*]|value = $user['@@__data-v-(*)__@@']
-
- @user img[data-v-*]|src = $user['@@__data-v-(*)__@@']
-
-
- @user [data-v-url]|href =<?php echo htmlentities($url);?>
- @user a[data-v-*]|href = $user['@@__data-v-(*)__@@']
- @user [data-v-edit-url]|href =<?php echo htmlentities($url);?>
- @user [data-v-url]|title = $user['title']
- @user [data-v-status]|addClass = <?php echo $status_class;?>
- @user [data-v-status] = <?php echo $status;?>
+ @user [data-v-*]|innerText = $user['@@__data-v-(*)__@@']
+ @user input[data-v-*]|value = $user['@@__data-v-(*)__@@']
+ @user img[data-v-*]|src = $user['@@__data-v-(*)__@@']
+ @user [data-v-url]|href = $url
+ @user a[data-v-*]|href = $user['@@__data-v-(*)__@@']
+ @user [data-v-edit-url]|href = $url
+ @user [data-v-url]|title = $user['title']
+ @user [data-v-status]|addClass = $status_class
+ @user [data-v-status] = $status
@user|after = <?php
diff --git a/app/template/cart/cart.tpl b/app/template/cart/cart.tpl
index 2cbeb3e..e105447 100755
--- a/app/template/cart/cart.tpl
+++ b/app/template/cart/cart.tpl
@@ -16,7 +16,7 @@ if(is_array($products)) foreach ($products as $key => $product) {
//@cart-product [data-v-cart-product-name] = $product['name']
//@cart-product [data-v-cart-product-content] = $product['content']
- //@cart-product [data-v-cart-product-amount] = <?php echo $product['amount'];?>
+ //@cart-product [data-v-cart-product-amount] = <?php echo htmlspecialchars($product['amount']);?>
@cart-product|data-product_id = $product['product_id']
@cart-product|data-key = $key
diff --git a/app/template/cart/compare.tpl b/app/template/cart/compare.tpl
index cf73573..e292625 100644
--- a/app/template/cart/compare.tpl
+++ b/app/template/cart/compare.tpl
@@ -17,7 +17,7 @@ if(is_array($products)) foreach ($products as $key => $product) {
//@compare-product [data-v-product-name] = $product['name']
//@compare-product [data-v-product-content] = $product['content']
- //@compare-product [data-v-product-amount] = <?php echo $product['amount'];?>
+ //@compare-product [data-v-product-amount] = <?php echo htmlspecialchars($product['amount']);?>
@compare-product|data-product_id = $product['product_id']
@compare-product|data-key = $key
diff --git a/app/template/checkout/checkout.tpl b/app/template/checkout/checkout.tpl
index 20d8b66..b38455d 100755
--- a/app/template/checkout/checkout.tpl
+++ b/app/template/checkout/checkout.tpl
@@ -1,32 +1,35 @@
//keep post values
-//input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
+//input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']);?>
/* input elements */
input[type="text"]|value =
<?php
$post = $_POST@@macro postNameToArrayKey("@@__name__@@")@@ ?? $this->checkout@@macro postNameToArrayKey("@@__name__@@")@@ ?? '';
$value = '@@__value__@@';
- if ($post)
- echo $post;
- else echo $value;
+ if ($post) {
+ $value = $post;
+ }
+ echo htmlspecialchars($value);
?>
input[type="email"]|value =
<?php
$post = $_POST@@macro postNameToArrayKey("@@__name__@@")@@ ?? $this->checkout@@macro postNameToArrayKey("@@__name__@@")@@ ?? '';
$value = '@@__value__@@';
- if ($post)
- echo $post;
- else echo $value;
+ if ($post) {
+ $value = $post;
+ }
+ echo htmlspecialchars($value);
?>
input[type="password"]|value =
<?php
$post = $_POST@@macro postNameToArrayKey("@@__name__@@")@@ ?? $this->checkout@@macro postNameToArrayKey("@@__name__@@")@@ ?? '';
$value = '@@__value__@@';
- if ($post)
- echo $post;
- else echo $value;
+ if ($post) {
+ $value = $post;
+ }
+ echo htmlspecialchars($value);
?>
@@ -35,9 +38,10 @@ textarea =
<?php
$post = $_POST@@macro postNameToArrayKey("@@__name__@@")@@ ?? $this->checkout@@macro postNameToArrayKey("@@__name__@@")@@ ?? '';
$value = '@@__value__@@';
- if ($post)
- echo $post;
- else echo $value;
+ if ($post) {
+ $value = $post;
+ }
+ echo htmlspecialchars($value);
?>
diff --git a/app/template/checkout/confirm.tpl b/app/template/checkout/confirm.tpl
index 5de2eb5..2bb34df 100755
--- a/app/template/checkout/confirm.tpl
+++ b/app/template/checkout/confirm.tpl
@@ -1,5 +1,5 @@
//keep post values
-input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
+input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']);?>
[data-v-order-*] = $this->order['@@__data-v-order-(*)__@@']
diff --git a/app/template/checkout/order.tpl b/app/template/checkout/order.tpl
index d1fd9ce..6f14e21 100755
--- a/app/template/checkout/order.tpl
+++ b/app/template/checkout/order.tpl
@@ -1,4 +1,4 @@
//keep post values
-input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
+input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']);?>
import(common.tpl)
diff --git a/app/template/common.tpl b/app/template/common.tpl
index 7596e06..4af77a6 100755
--- a/app/template/common.tpl
+++ b/app/template/common.tpl
@@ -2,13 +2,13 @@
[data-v-copy-from]|outerHTML = from(@@__data-v-copy-from:([^\,]+)__@@|@@__data-v-copy-from:[^\,]+\,([^\,]+)__@@)
[data-v-save-global]|outerHTML = from(@@__data-v-save-global:([^\,]+)__@@|@@__data-v-save-global:[^\,]+\,([^\,]+)__@@)
-a[data-v-url]|href = <?php echo htmlentities(Vvveb\url('@@__data-v-url__@@'));?>
-form[data-v-url]|action = <?php echo htmlentities(Vvveb\url('@@__data-v-url__@@'));?>
+a[data-v-url]|href = <?php echo htmlspecialchars(Vvveb\url('@@__data-v-url__@@'));?>
+form[data-v-url]|action = <?php echo htmlspecialchars(Vvveb\url('@@__data-v-url__@@'));?>
a[data-v-url-params]|href = <?php echo Vvveb\url('@@__data-v-url__@@' , @@__data-v-url-params__@@, false);?>
form[data-v-url-params]|action = <?php echo Vvveb\url('@@__data-v-url__@@' , @@__data-v-url-params__@@);?>
-/* [data-v-img]|href = <?php echo htmlentities(Vvveb\url('@@__data-v-img__@@'));?> */
+/* [data-v-img]|href = <?php echo htmlspecialchars(Vvveb\url('@@__data-v-img__@@'));?> */
head base|href = <?php echo Vvveb\themeUrlPath()?>
@@ -22,40 +22,50 @@ import(editor.tpl)
import(pagination.tpl)
html|addNewAttribute = <?php
-if (isset($_COOKIE['theme'])) {
+$vvveb_is_page_edit = Vvveb\isEditor();
+
+if (isset($_COOKIE['theme']) && !$vvveb_is_page_edit) {
echo 'data-bs-theme="';
if ($_COOKIE['theme'] == 'dark') echo 'dark'; else if ($_COOKIE['theme'] == 'light') echo 'light';else echo 'auto';
echo '"';
}
-$vvveb_is_page_edit = Vvveb\isEditor();
+if (isset($this->global['rtl']) && $this->global['rtl'] && !$vvveb_is_page_edit) {
+ echo 'dir="rtl"';
+}
?>
+html|lang = $this->global['locale']
+
[data-v-global-*]|innerText = <?php
$name = '@@__data-v-global-(*)__@@';
-if (isset($this->global) && $name) {
- echo \Vvveb\arrayPath($this->global, $name);
+if (isset($this->global) && $name
+ && ($value = \Vvveb\arrayPath($this->global, $name))) {
+ echo htmlspecialchars($value);
}
?>
img[data-v-global-*]|src = <?php
$name = '@@__data-v-global-(*)__@@';
-if (isset($this->global) && $name) {
- echo \Vvveb\arrayPath($this->global, $name);
+if (isset($this->global) && $name
+ && ($value = \Vvveb\arrayPath($this->global, $name))) {
+ echo htmlspecialchars($value);
}
?>
a[data-v-global-*]|href = <?php
$name = '@@__data-v-global-(*)__@@';
-if (isset($this->global) && $name) {
- echo \Vvveb\arrayPath($this->global, $name);
+if (isset($this->global) && $name
+ && ($value = \Vvveb\arrayPath($this->global, $name))) {
+ echo htmlspecialchars($value);
}
?>
link[data-v-global-*]|href = <?php
$name = '@@__data-v-global-(*)__@@';
-if (isset($this->global) && $name) {
- echo \Vvveb\arrayPath($this->global, $name);
+if (isset($this->global) && $name
+ && ($value = \Vvveb\arrayPath($this->global, $name))) {
+ echo htmlspecialchars($value);
}
?>
@@ -74,6 +84,6 @@ head > link[hreflang]|after = <?php
}
?>
-head > title = <?php echo $this->global['site']['description']['title'] ?? '@@__innerText__@@';?>
-head > meta[name="description"]|content = <?php echo $this->global['site']['description']['meta-description'] ?? '@@__content__@@';?>
-head > meta[name="keywords"]|content = <?php echo $this->global['site']['description']['meta-keywords'] ?? '@@__content__@@';?>
+head > title = <?php echo htmlspecialchars($this->global['site']['description']['title'] ?? '@@__innerText__@@');?>
+head > meta[name="description"]|content = <?php echo htmlspecialchars($this->global['site']['description']['meta-description'] ?? '@@__content__@@');?>
+head > meta[name="keywords"]|content = <?php echo htmlspecialchars($this->global['site']['description']['meta-keywords'] ?? '@@__content__@@');?>
diff --git a/app/template/components/admin.tpl b/app/template/components/admin.tpl
index 452db33..6b4ce3d 100644
--- a/app/template/components/admin.tpl
+++ b/app/template/components/admin.tpl
@@ -9,7 +9,7 @@
[data-v-component-admin] a[data-v-admin-*]|href = $admin['@@__data-v-admin-(*)__@@']
[data-v-component-admin] img[data-v-admin-*]|src = <?php
if (isset($admin['@@__data-v-admin-(*)__@@'])) {
- echo $admin['@@__data-v-admin-(*)__@@'];
+ echo htmlspecialchars($admin['@@__data-v-admin-(*)__@@']);
} else if ('@@__src__@@') {
echo '@@__src__@@';
} else {
diff --git a/app/template/components/cart.tpl b/app/template/components/cart.tpl
index 084632c..898f7d6 100755
--- a/app/template/components/cart.tpl
+++ b/app/template/components/cart.tpl
@@ -36,7 +36,7 @@ if($products) {
@cart-product a[data-v-cart-product-url]|href = $product['url']
@cart-product [data-v-cart-product-remove-url]|href =
- <?php echo htmlentities(Vvveb\url(['module' => 'cart', 'action' => 'remove', 'product_id' => $product['product_id']]));?>
+ <?php echo htmlspecialchars(Vvveb\url(['module' => 'cart', 'action' => 'remove', 'product_id' => $product['product_id']]));?>
@cart-product|data-product_id = $product['product_id']
@cart-product|data-key = $key
diff --git a/app/template/components/categories.tpl b/app/template/components/categories.tpl
index 5d76e24..498a0ca 100755
--- a/app/template/components/categories.tpl
+++ b/app/template/components/categories.tpl
@@ -28,7 +28,7 @@ $generate_menu = function ($parent) use (&$_categories, &$generate_menu) {
//catch all data attributes
@category [data-v-cat-*]|innerText = $category['@@__data-v-cat-(*)__@@']
- @category [data-v-cat-url]|href = <?php echo htmlentities(Vvveb\url('content/category/index', $category));?>
+ @category [data-v-cat-url]|href = <?php echo htmlspecialchars(Vvveb\url('content/category/index', $category));?>
@category [data-v-cat-img]|src = $category['images'][0]
@category|append = <?php
diff --git a/app/template/components/categories/pages.tpl b/app/template/components/categories/pages.tpl
index 3826c7c..784d23c 100755
--- a/app/template/components/categories/pages.tpl
+++ b/app/template/components/categories/pages.tpl
@@ -35,17 +35,17 @@ $generate_menu = function ($parent) use (&$_categories, &$generate_menu) {
//catch all data attributes
@category [data-v-cat-*]|innerText = $category['@@__data-v-cat-(*)__@@']
- @category [data-v-cat-url]|href = <?php echo htmlentities(Vvveb\url('content/category/index', $category));?>
+ @category [data-v-cat-url]|href = <?php echo htmlspecialchars(Vvveb\url('content/category/index', $category));?>
@category [data-v-cat-img]|src = $category['images'][0]
@post|before = <?php
- if (isset($category['posts']) && $category['post'])
- foreach($category['posts'] as $key => $post) {?>
+ if (isset($category['post']) && $category['post'])
+ foreach($category['post'] as $key => $post) {?>
//catch all data attributes
@post [data-v-post-*]|innerText = $post['@@__data-v-post-(*)__@@']
- @post a[data-v-post-url]|href = <?php echo htmlentities(Vvveb\url('content/post/index', $post));?>
+ @post a[data-v-post-url]|href = <?php echo htmlspecialchars(Vvveb\url('content/post/index', $post));?>
@post|after = <?php
}
diff --git a/app/template/components/cateogires_simple.tpl b/app/template/components/cateogires_simple.tpl
index 048fc76..d365ada 100755
--- a/app/template/components/cateogires_simple.tpl
+++ b/app/template/components/cateogires_simple.tpl
@@ -19,7 +19,7 @@ if(isset($this->categories) && is_array($this->categories[$_categories_idx]['cat
//catch all data attributes
[data-v-component-categories] [data-v-cat] [data-v-cat-*] = $category['@@__data-v-cat-(*)__@@']
- [data-v-component-categories] [data-v-cat] [data-v-cat-url]|href = <?php echo htmlentities(Vvveb\url('product/category/index', $category));?>
+ [data-v-component-categories] [data-v-cat] [data-v-cat-url]|href = <?php echo htmlspecialchars(Vvveb\url('product/category/index', $category));?>
[data-v-component-categories] [data-v-cat] [data-v-cat-img]|src = $category['images'][0]
diff --git a/app/template/components/checkout/payment.tpl b/app/template/components/checkout/payment.tpl
index 84ccbc1..bd8e6a5 100755
--- a/app/template/components/checkout/payment.tpl
+++ b/app/template/components/checkout/payment.tpl
@@ -31,7 +31,7 @@ if($payments && is_array($payments['payment'])) {
@payment img[data-v-payment-*]|src = $payment['@@__data-v-payment-(*)__@@']
- @payment [data-v-payment-render]|innerText = <?php echo $payment['@@__data-v-payment-(*)__@@'] ?? '';?>
+ @payment [data-v-payment-render]|innerText = $payment['@@__data-v-payment-(*)__@@']
@payment [data-v-payment-*]|innerText = $payment['@@__data-v-payment-(*)__@@']
diff --git a/app/template/components/comments.tpl b/app/template/components/comments.tpl
index 5cee6e1..1ea8372 100755
--- a/app/template/components/comments.tpl
+++ b/app/template/components/comments.tpl
@@ -28,10 +28,10 @@ if($_comments && is_array($_comments)) {
@comment|id = <?php if (!$vvveb_is_page_edit) echo 'comment-' . $comment['comment_id'];?>
- @comment [data-v-comment-content] = <?php echo($comment['content']);?>
+ @comment [data-v-comment-content] = $comment['content']
@comment img[data-v-comment-*]|src = $comment['@@__data-v-comment-(*)__@@']
- @comment img[data-v-comment-*]|width = <?php echo $comment['size'] ?? '60';?>
+ @comment img[data-v-comment-*]|width = <?php echo (int)($review['size'] ?? 60);?>
@comment [data-v-comment-*]|innerText = $comment['@@__data-v-comment-(*)__@@']
diff --git a/app/template/components/content/categories.tpl b/app/template/components/content/categories.tpl
index 188e864..3665c71 100755
--- a/app/template/components/content/categories.tpl
+++ b/app/template/components/content/categories.tpl
@@ -42,7 +42,7 @@ $generate_menu = function ($parent) use (&$_categories, &$generate_menu) {
//catch all data attributes
@cats [data-v-cat] [data-v-cat-*]|innerText = $category['@@__data-v-cat-(*)__@@']
- @cats [data-v-cat] [data-v-cat-url]|href = <?php echo htmlentities(Vvveb\url('content/category/index', $category));?>
+ @cats [data-v-cat] [data-v-cat-url]|href = <?php echo htmlspecialchars(Vvveb\url('content/category/index', $category));?>
@cats [data-v-cat] [data-v-cat-img]|src = $category['images'][0]
@cats [data-v-cat]|after = <?php
diff --git a/app/template/components/menu.tpl b/app/template/components/menu.tpl
index 077ad0b..d28f53a 100755
--- a/app/template/components/menu.tpl
+++ b/app/template/components/menu.tpl
@@ -44,8 +44,8 @@ if (isset($this->_component['menu']) && isset($this->_component['menu'][$_menu_i
@category [data-v-menu-item-*]|innerText = $category['@@__data-v-menu-item-(*)__@@']
@category [data-v-menu-item-content] = <?php echo($category['content'] ?? '');?>
- @category [data-v-menu-item-url]|href = <?php if (isset($category['url'])) echo Vvveb\System\Sites::url($category['url']);?>
- @category [data-v-menu-item-img]|src = $category['images'][0]
+ @category [data-v-menu-item-url]|href = $category['url']
+ @category [data-v-menu-item-img]|src = $category['images'][0]
@category|append = <?php
if ($category['children'] > 0 && isset($generate_menu)) {
@@ -60,7 +60,7 @@ if (isset($this->_component['menu']) && isset($this->_component['menu'][$_menu_i
?>
-@category|addClass = <?php if (isset($category['class']) && !$vvveb_is_page_edit) echo $category['class'];?>
+@category|addClass = <?php if (isset($category['class']) && !$vvveb_is_page_edit) echo htmlspecialchars($category['class']);?>
@category-recursive|before = <?php
$generate_menu = function ($parent_id) use (&$_categories, &$generate_menu, &$parents) {
diff --git a/app/template/components/posts.tpl b/app/template/components/posts.tpl
index 3d3ebd9..f5acbfd 100755
--- a/app/template/components/posts.tpl
+++ b/app/template/components/posts.tpl
@@ -22,8 +22,8 @@
@post|deleteAllButFirstChild
-@posts [data-v-posts-category] = <?php $_category = current($posts['posts']);echo $_category['category'];?>
-@posts [data-v-posts-count] = <?php echo $posts['count'] ?? ''?>
+@posts [data-v-posts-category] = <?php $_category = current($posts['posts']);echo htmlspecialchars($_category['category']);?>
+@posts [data-v-posts-count] = $posts['count']
@post|before = <?php
@@ -46,9 +46,9 @@ foreach ($_posts as $index => $post) {?>
$size = '@@__data-v-size__@@';
if ($size) {
//$image = Vvveb\System\Images::size($image, $size);
- echo $image;
+ echo htmlspecialchars($image);
} else {
- echo $image;
+ echo htmlspecialchars($image);
}
?>
diff --git a/app/template/components/product.tpl b/app/template/components/product.tpl
index f200a72..a2e6ede 100755
--- a/app/template/components/product.tpl
+++ b/app/template/components/product.tpl
@@ -35,7 +35,7 @@ $_pagination_limit = isset($product['limit']) ? $product['limit'] : 5;
@product a[data-v-product-*]|href = $product['@@__data-v-product-(*)__@@']
-@product img[data-v-product-main-image]|src = <?php echo($product['image']);?>
+@product img[data-v-product-main-image]|src = $product['image']
@product [data-v-product-main-image-background-image]|style = <?php echo 'background-image: url(\'' . $product['image'] . '\');';?>
@product a[data-v-product-main-image]|href = <?php echo reset($product['images'])['image'];?>
@@ -68,4 +68,4 @@ $component = $previous_component;
?>
-
+
\ No newline at end of file
diff --git a/app/template/components/product/categories.tpl b/app/template/components/product/categories.tpl
index d619a53..484dbed 100755
--- a/app/template/components/product/categories.tpl
+++ b/app/template/components/product/categories.tpl
@@ -43,7 +43,7 @@ $generate_menu = function ($parent) use (&$_categories, &$generate_menu) {
//catch all data attributes
@cats [data-v-cat] [data-v-cat-*]|innerText = $category['@@__data-v-cat-(*)__@@']
- @cats [data-v-cat] [data-v-cat-url]|href = <?php echo htmlentities(Vvveb\url('product/category/index', $category));?>
+ @cats [data-v-cat] [data-v-cat-url]|href = <?php echo htmlspecialchars(Vvveb\url('product/category/index', $category));?>
@cats [data-v-cat] [data-v-cat-img]|src = $category['images'][0]
@cats [data-v-cat]|after = <?php
diff --git a/app/template/components/products.tpl b/app/template/components/products.tpl
index 1056ba2..4a6fa97 100755
--- a/app/template/components/products.tpl
+++ b/app/template/components/products.tpl
@@ -23,43 +23,44 @@
//to render an empty product to avoid losing the html on edit
$_default = (isset($vvveb_is_page_edit) && $vvveb_is_page_edit ) ? [0 => []] : false;
//$_default = [0 => []];
- $_products = empty($products['product']) ? $_default : $products['product'];
+ $prods = empty($products['product']) ? $_default : $products['product'];
?>
-@products [data-v-products-category] = <?php $_category = current($products);echo $_category['category'];?>
-@products [data-v-products-count] = <?php echo $products['count'] ?? ''?>
-@products [data-v-products-manufacturer] = <?php $_manufacturer = current($products);echo $_manufacturer['manufacturer'];?>
+@products [data-v-products-category] = <?php $_category = current($products);echo htmlspecialchars($_category['category']);?>
+@products [data-v-products-count] = $products['count']
+@products [data-v-products-manufacturer] = <?php $_manufacturer = current($products);echo htmlspecialchars($_manufacturer['manufacturer']);?>
@product|before = <?php
-if ($_products) {
- foreach ($_products as $index => $_product) { $index++;?>
+if ($prods) {
+ foreach ($prods as $index => $prod) { $index++;?>
- @product [data-v-product-*]|innerText = $_product['@@__data-v-product-(*)__@@']
- @product a[data-v-product-*]|href = $_product['@@__data-v-product-(*)__@@']
+ @product [data-v-product-*]|innerText = $prod['@@__data-v-product-(*)__@@']
+ @product a[data-v-product-*]|href = $prod['@@__data-v-product-(*)__@@']
+
//editor attributes
- @product|data-v-id = $_product['product_id']
+ @product|data-v-id = $prod['product_id']
@product|data-v-type = 'product'
//title attributes
- @product [data-v-product-alt]|alt = $_product['name']
+ @product [data-v-product-alt]|alt = $prod['name']
- @product [data-product_id]|data-product_id = $_product['product_id']
+ @product [data-product_id]|data-product_id = $prod['product_id']
//url
- @product [data-v-product-url]|title = $_product['name']
- @product a[data-v-product-url]|href = $_product['url']
+ @product [data-v-product-url]|title = $prod['name']
+ @product a[data-v-product-url]|href = $prod['url']
//image
- //@product [data-v-product-image]|src = $_product['images'][0]['image']
- //@product [data-v-product-image]|data-v-id = $_product['images'][0]['id']
+ //@product [data-v-product-image]|src = $prod['images'][0]['image']
+ //@product [data-v-product-image]|data-v-id = $prod['images'][0]['id']
//@product [data-v-product-image]|data-v-type = 'product_image'
@product [data-v-product-image]|src = <?php
- if (isset($_product['image'])) {
- $image = $_product['image'] ?? '';
+ if (isset($prod['image'])) {
+ $image = $prod['image'] ?? '';
//$size = '@@__data-v-product-image__@@';
$size = '@@__data-v-size__@@';
if ($size) {
@@ -71,21 +72,21 @@ if ($_products) {
}
?>
- @product [data-v-product-image-url] = $_product['image']
+ @product [data-v-product-image-url] = $prod['image']
//@product [data-v-product-image]|data-v-id = 'image'
//@product [data-v-product-image]|data-v-type = 'product_image'
//usually used for second image to show hover [data-v-product-image-0] [data-v-product-image-1]
- //@product [data-v-product-image-*]|src = $_product['images']['@@__data-v-product-image-(\d+)__@@']['image']
+ //@product [data-v-product-image-*]|src = $prod['images']['@@__data-v-product-image-(\d+)__@@']['image']
@product [data-v-product-image-*]|src = <?php
//$size = '@@__data-v-product-image-\d+__@@';
$size = '@@__data-v-size__@@';
$nr = '@@__data-v-product-image-(\d+)__@@';
- if (isset($_product['images'][$nr]['image'])) {
- $image = $_product['images'][$nr]['image'];
+ if (isset($prod['images'][$nr]['image'])) {
+ $image = $prod['images'][$nr]['image'];
if ($size) {
- //echo imageSize($_product['image'], $size);
+ //echo imageSize($prod['image'], $size);
//$image = Vvveb\System\Images::size($image, $size);
echo $image;
} else {
@@ -96,17 +97,17 @@ if ($_products) {
- @product [data-v-product-image-*]|data-v-id = $_product['images']['@@__data-v-product-image-(\d+)__@@']['id']
+ @product [data-v-product-image-*]|data-v-id = $prod['images']['@@__data-v-product-image-(\d+)__@@']['id']
@product [data-v-product-image-*]|data-v-type = 'product_image'
//image gallery
@product [data-v-product-images] [data-v-product-image]|before = <?php
- if(isset($_product['images']) && is_array($_product['images']))
- foreach ($_product['images'] as $_product_image_id => $image) {
+ if(isset($prod['images']) && is_array($prod['images']))
+ foreach ($prod['images'] as $prod_image_id => $image) {
?>
@product [data-v-product-images] img[data-v-product-image-src]|src = $image['image']
- @product [data-v-product-images] img[data-v-product-image-src]|data-v-id = $_product_image_id
+ @product [data-v-product-images] img[data-v-product-image-src]|data-v-id = $prod_image_id
@product [data-v-product-images] img[data-v-product-image-src]|data-v-type = 'product_image'
@product [data-v-product-images] a[data-v-product-image-src]|href = $image['image']
@@ -114,9 +115,9 @@ if ($_products) {
} ?>
//catch all data attributes
- @product [data-v-product-*]|innerText = $_product['@@__data-v-product-(*)__@@']
- //echo description directly to avoid htmlentities escape
- @product [data-v-product-content] = <?php echo($_product['content']);?>
+ @product [data-v-product-*]|innerText = $prod['@@__data-v-product-(*)__@@']
+ //echo description directly to avoid htmlspecialchars escape
+ @product [data-v-product-content] = <?php echo($prod['content']);?>
@product|after = <?php
}
diff --git a/app/template/components/questions.tpl b/app/template/components/questions.tpl
index 8d16085..8cc5a6f 100644
--- a/app/template/components/questions.tpl
+++ b/app/template/components/questions.tpl
@@ -28,10 +28,10 @@ if($questions && is_array($questions)) {
@question|id = <?php if (!$vvveb_is_page_edit) echo 'question-' . $question['product_question_id'];?>
- @question [data-v-question-content] = <?php echo($question['content']);?>
+ @question [data-v-question-content] = $question['content']
@question img[data-v-question-*]|src = $question['@@__data-v-question-(*)__@@']
- @question img[data-v-question-avatar]|width = <?php echo $question['size'] ?? '60';?>
+ @question img[data-v-question-avatar]|width = <?php echo (int)($review['size'] ?? 60);?>
@question [data-v-question-*]|innerText = $question['@@__data-v-question-(*)__@@']
diff --git a/app/template/components/reviews.tpl b/app/template/components/reviews.tpl
index 561d79a..52f4728 100755
--- a/app/template/components/reviews.tpl
+++ b/app/template/components/reviews.tpl
@@ -31,8 +31,8 @@ if($reviews && is_array($reviews)) {
@review|id = <?php if (!$vvveb_is_page_edit) echo 'review-' . $review['product_review_id'];?>
- @review [data-v-review-content] = <?php echo $review['content'];?>
- @review img[data-v-review-avatar]|width = <?php echo $review['size'] ?? '60';?>
+ @review [data-v-review-content] = $review['content']
+ @review img[data-v-review-avatar]|width = <?php echo (int)($review['size'] ?? 60);?>
@review img[data-v-review-*]|src = $review['@@__data-v-review-(*)__@@']
diff --git a/app/template/components/site.tpl b/app/template/components/site.tpl
index eab0824..d4fe12c 100755
--- a/app/template/components/site.tpl
+++ b/app/template/components/site.tpl
@@ -13,14 +13,14 @@
$name = '@@__data-v-site-(*)__@@';
if (strpos($name, 'phone-number') !== false) echo 'tel:';
if (strpos($name, 'email') !== false) echo 'mailto:';
-echo $site[$name] ?? '';
+echo htmlspecialchars($site[$name] ?? '');
?>
[data-v-component-site] a[data-v-site-description-*]|href = <?php
$name = '@@__data-v-site-description-(*)__@@';
if (strpos($name, 'phone-number') !== false) echo 'tel:';
if (strpos($name, 'email') !== false) echo 'mailto:';
-echo $site['description'][$name] ?? '';
+echo htmlspecialchars($site['description'][$name] ?? '');
?>
diff --git a/app/template/components/user.tpl b/app/template/components/user.tpl
index b05b9de..ee06b92 100755
--- a/app/template/components/user.tpl
+++ b/app/template/components/user.tpl
@@ -9,7 +9,7 @@
[data-v-component-user] a[data-v-user-*]|href = $user['@@__data-v-user-(*)__@@']
[data-v-component-user] img[data-v-user-*]|src = <?php
if (isset($user['@@__data-v-user-(*)__@@'])) {
- echo $user['@@__data-v-user-(*)__@@'];
+ echo htmlspecialchars($user['@@__data-v-user-(*)__@@']);
} else if ('@@__src__@@') {
echo '@@__src__@@';
} else {
diff --git a/app/template/components/user/wishlist.tpl b/app/template/components/user/wishlist.tpl
index 0ee6800..0d7697f 100644
--- a/app/template/components/user/wishlist.tpl
+++ b/app/template/components/user/wishlist.tpl
@@ -26,9 +26,9 @@
$_wishlist = empty($wishlist['user_wishlist']) ? $_default : $wishlist['user_wishlist'];
?>
-@wishlist [data-v-wishlist-category] = <?php $_category = current($wishlist);echo $_category['category'];?>
-@wishlist [data-v-wishlist-count] = <?php echo($wishlist['count'] ?? '')?>
-@wishlist [data-v-wishlist-manufacturer] = <?php $_manufacturer = current($wishlist);echo $_manufacturer['manufacturer'];?>
+@wishlist [data-v-wishlist-category] = <?php $_category = current($wishlist);echo htmlspecialchars($_category['category']);?>
+@wishlist [data-v-wishlist-count] = $wishlist['count']
+@wishlist [data-v-wishlist-manufacturer] = <?php $_manufacturer = current($wishlist);echo htmlspecialchars($_manufacturer['manufacturer']);?>
@product|before = <?php
@@ -85,7 +85,7 @@ if ($_wishlist) {
$size = '@@__data-v-size__@@';
$nr = '@@__data-v-product-image-(\d+)__@@';
if (isset($_product['images'][$nr]['image'])) {
- $image = $_product['images'][$nr]['image'];
+ $image = htmlspecialchars($_product['images'][$nr]['image']);
if ($size) {
//echo imageSize($_product['image'], $size);
//$image = Vvveb\System\Images::size($image, $size);
@@ -117,7 +117,7 @@ if ($_wishlist) {
//catch all data attributes
@product [data-v-product-*]|innerText = $_product['@@__data-v-product-(*)__@@']
- //echo description directly to avoid htmlentities escape
+ //echo description directly to avoid htmlspecialchars escape
@product [data-v-product-content] = <?php echo($_product['content']);?>
@product|after = <?php
diff --git a/app/template/content/category.tpl b/app/template/content/category.tpl
index 5320d73..1c55634 100755
--- a/app/template/content/category.tpl
+++ b/app/template/content/category.tpl
@@ -1,5 +1,5 @@
import(common.tpl)
-head > title = <?php echo htmlentities(ucfirst($this->category_name));?>
+head > title = <?php echo htmlspecialchars(ucfirst($this->category_name));?>
-[data-v-category-name] = <?php echo htmlentities(ucfirst($this->category_name));?>
\ No newline at end of file
+[data-v-category-name] = <?php echo htmlspecialchars(ucfirst($this->category_name));?>
\ No newline at end of file
diff --git a/app/template/pagination.tpl b/app/template/pagination.tpl
index c8b86c4..f3ecc4d 100755
--- a/app/template/pagination.tpl
+++ b/app/template/pagination.tpl
@@ -74,7 +74,7 @@ if ($pagecount > $maxpages)
[data-pagination] [data-pages] = $pagecount
@page [data-page-no] = $page
- @page [data-page-url]|href = <?php echo htmlentities(Vvveb\url($url, ['page' => $page] + $parameters)) . $query_string;?>
+ @page [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url($url, ['page' => $page] + $parameters)) . $query_string;?>
@page|addClass = <?php if (($current_page == $page) && !$vvveb_is_page_edit) echo 'active'?>
@page|after = <?php
@@ -83,12 +83,12 @@ if ($pagecount > $maxpages)
[data-pagination] [data-count] = $component['count']
[data-pagination] [data-current-page] = $current_page
- [data-pagination] [data-current-url]|action = <?php echo htmlentities(Vvveb\url($url, ['page' => $current_page] + $parameters)) . $query_string;?>
+ [data-pagination] [data-current-url]|action = <?php echo htmlspecialchars(Vvveb\url($url, ['page' => $current_page] + $parameters)) . $query_string;?>
- [data-pagination] [data-first] [data-page-url]|href = <?php echo htmlentities(Vvveb\url($url, ['page' => 1] + $parameters)) . $query_string;?>
- [data-pagination] [data-prev] [data-page-url]|href = <?php echo htmlentities(Vvveb\url($url, ['page' => max($current_page - 1, 1)] + $parameters)) . $query_string;?>
- [data-pagination] [data-next] [data-page-url]|href = <?php echo htmlentities(Vvveb\url($url, ['page' => min($current_page + 1, $pagecount)] + $parameters)) . $query_string;?>
- [data-pagination] [data-last] [data-page-url]|href = <?php echo htmlentities(Vvveb\url($url, ['page' => $pagecount] + $parameters)) . $query_string;?>
+ [data-pagination] [data-first] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url($url, ['page' => 1] + $parameters)) . $query_string;?>
+ [data-pagination] [data-prev] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url($url, ['page' => max($current_page - 1, 1)] + $parameters)) . $query_string;?>
+ [data-pagination] [data-next] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url($url, ['page' => min($current_page + 1, $pagecount)] + $parameters)) . $query_string;?>
+ [data-pagination] [data-last] [data-page-url]|href = <?php echo htmlspecialchars(Vvveb\url($url, ['page' => $pagecount] + $parameters)) . $query_string;?>
[data-pagination]|after = <?php
diff --git a/app/template/product/category.tpl b/app/template/product/category.tpl
index 5320d73..1c55634 100755
--- a/app/template/product/category.tpl
+++ b/app/template/product/category.tpl
@@ -1,5 +1,5 @@
import(common.tpl)
-head > title = <?php echo htmlentities(ucfirst($this->category_name));?>
+head > title = <?php echo htmlspecialchars(ucfirst($this->category_name));?>
-[data-v-category-name] = <?php echo htmlentities(ucfirst($this->category_name));?>
\ No newline at end of file
+[data-v-category-name] = <?php echo htmlspecialchars(ucfirst($this->category_name));?>
\ No newline at end of file
diff --git a/app/template/product/manufacturer.tpl b/app/template/product/manufacturer.tpl
index 9659252..690ce79 100755
--- a/app/template/product/manufacturer.tpl
+++ b/app/template/product/manufacturer.tpl
@@ -1,9 +1,9 @@
import(common.tpl)
-head > title = <?php echo htmlentities(ucfirst($this->manufacturer_name));?>
+head > title = <?php echo htmlspecialchars(ucfirst($this->manufacturer_name));?>
-[data-v-manufacturer-name] = <?php echo htmlentities(ucfirst($this->manufacturer_name));?>
+[data-v-manufacturer-name] = <?php echo htmlspecialchars(ucfirst($this->manufacturer_name));?>
[data-v-manufacturer-*]|innerText = $this->manufacturer['@@__data-v-manufacturer-(*)__@@']
img[data-v-manufacturer-*]|src = $this->manufacturer['@@__data-v-manufacturer-(*)__@@']
-[data-v-manufacturer-name] = <?php echo htmlentities(ucfirst($this->manufacturer['name'] ?? ''));?>
+[data-v-manufacturer-name] = <?php echo htmlspecialchars(ucfirst($this->manufacturer['name'] ?? ''));?>
diff --git a/app/template/product/vendor.tpl b/app/template/product/vendor.tpl
index 961425d..aeb6adb 100755
--- a/app/template/product/vendor.tpl
+++ b/app/template/product/vendor.tpl
@@ -1,7 +1,7 @@
import(common.tpl)
-head > title = <?php echo htmlentities(ucfirst($this->vendor_name));?>
+head > title = <?php echo htmlspecialchars(ucfirst($this->vendor_name));?>
[data-v-vendor-*]|innerText = $this->vendor['@@__data-v-vendor-(*)__@@']
img[data-v-vendor-*]|src = $this->vendor['@@__data-v-vendor-(*)__@@']
-[data-v-vendor-name] = <?php echo htmlentities(ucfirst($this->vendor['name'] ?? ''));?>
+[data-v-vendor-name] = <?php echo htmlspecialchars(ucfirst($this->vendor['name'] ?? ''));?>
diff --git a/app/template/user/address/edit.tpl b/app/template/user/address/edit.tpl
index 74800cb..eb8f8be 100755
--- a/app/template/user/address/edit.tpl
+++ b/app/template/user/address/edit.tpl
@@ -1,6 +1,6 @@
import(common.tpl)
-[data-v-user_address-*] = <?php echo($this->user_address['@@__data-v-user_address-(*)__@@'] ?? '');?>
+[data-v-user_address-*] = $this->user_address['@@__data-v-user_address-(*)__@@']
[data-v-countries]|data-v-region-id = $this->user_address['region_id']
diff --git a/app/template/user/login.tpl b/app/template/user/login.tpl
index 4309a67..c3ce6e9 100755
--- a/app/template/user/login.tpl
+++ b/app/template/user/login.tpl
@@ -2,7 +2,7 @@
input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
#redirect|value = <?php
if (isset($this->redirect)) {
- echo $this->redirect;
+ echo htmlspecialchars($this->redirect);
} else {
if (isset($_GET['module'])) {
echo Vvveb\escUrl($_SERVER['REQUEST_URI']);
diff --git a/app/template/user/profile.tpl b/app/template/user/profile.tpl
index a915271..fbc4dcc 100755
--- a/app/template/user/profile.tpl
+++ b/app/template/user/profile.tpl
@@ -1,3 +1,3 @@
import(common.tpl)
-[data-v-user-*] = <?php echo($this->user['@@__data-v-user-(*)__@@'] ?? '');?>
+[data-v-user-*] = $this->user['@@__data-v-user-(*)__@@']
diff --git a/app/template/user/reset/reset.tpl b/app/template/user/reset/reset.tpl
index d1fd9ce..6f14e21 100755
--- a/app/template/user/reset/reset.tpl
+++ b/app/template/user/reset/reset.tpl
@@ -1,4 +1,4 @@
//keep post values
-input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
+input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']);?>
import(common.tpl)
diff --git a/app/template/user/return-form.tpl b/app/template/user/return-form.tpl
index 996c991..ba9a7f1 100755
--- a/app/template/user/return-form.tpl
+++ b/app/template/user/return-form.tpl
@@ -1,9 +1,9 @@
//keep post values
input[type="radio"]|addNewAttribute = <?php if (isset($_POST['@@__name__@@']) && $_POST['@@__name__@@'] == '@@__value__@@') echo 'checked';?>
input[type="checkbox"]|addNewAttribute = <?php if (isset($_POST['@@__name__@@']) && $_POST['@@__name__@@'] == '@@__value__@@') echo 'checked';?>
-input[type="text"]|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@']; else echo '@@__value__@@';?>
-input[type="email"]|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@']; else echo '@@__value__@@';?>
-textarea = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@']; else echo '@@__value__@@';?>
+input[type="text"]|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']); else echo '@@__value__@@';?>
+input[type="email"]|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']); else echo '@@__value__@@';?>
+textarea = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']); else echo '@@__value__@@';?>
import(common.tpl)
@@ -26,7 +26,7 @@ import(common.tpl)
@reason [name="return_reason_id"]|value = $text['return_reason_id']
@reason [name="return_reason_id"]|addNewAttribute = <?php if ($text['return_reason_id'] == $selected) echo 'checked';?>
- @reason span = <?php if (is_array($text)) { if (isset($text['name'])) echo Vvveb\humanReadable($text['name']);} else echo $text;?>
+ @reason span = <?php if (is_array($text)) { if (isset($text['name'])) echo htmlspecialchars(Vvveb\humanReadable($text['name']));} else echo $text;?>
@reason|after = <?php
} }?>
diff --git a/app/template/user/signup.tpl b/app/template/user/signup.tpl
index 6700e90..ddd4246 100755
--- a/app/template/user/signup.tpl
+++ b/app/template/user/signup.tpl
@@ -1,4 +1,4 @@
//keep post values
-input|value = <?php if (isset($_POST['@@__name__@@'])) echo $_POST['@@__name__@@'];?>
+input|value = <?php if (isset($_POST['@@__name__@@'])) echo htmlspecialchars($_POST['@@__name__@@']);?>
import(common.tpl)
\ No newline at end of file
diff --git a/install/template/common.tpl b/install/template/common.tpl
index d9eb0eb..169216b 100755
--- a/install/template/common.tpl
+++ b/install/template/common.tpl
@@ -5,18 +5,18 @@ head base|href = <?php echo Vvveb\themeUrlPath()?>;
input[type="text"]|value =
<?php
if (isset($_POST['@@__name__@@']))
- echo $_POST['@@__name__@@'];
- else if (isset($this->config['@@__name__@@']))
- echo $this->config['@@__name__@@'];
+ echo htmlspecialchars($_POST['@@__name__@@']);
+ else if (isset(htmlspecialchars($this->config['@@__name__@@'])))
+ echo htmlspecialchars($this->config['@@__name__@@']);
else echo '@@__value__@@';
?>
input[type="password"]|value =
<?php
if (isset($_POST['@@__name__@@']))
- echo $_POST['@@__name__@@'];
- else if (isset($this->config['@@__name__@@']))
- echo $this->config['@@__name__@@'];
+ echo htmlspecialchars($_POST['@@__name__@@']);
+ else if (isset(htmlspecialchars($this->config['@@__name__@@'])))
+ echo htmlspecialchars($this->config['@@__name__@@']);
else echo '@@__value__@@';
?>
@@ -24,9 +24,9 @@ input[type="password"]|value =
input[type="email"]|value =
<?php
if (isset($_POST['@@__name__@@']))
- echo $_POST['@@__name__@@'];
- else if (isset($this->config['@@__name__@@']))
- echo $this->config['@@__name__@@'];
+ echo htmlspecialchars($_POST['@@__name__@@']);
+ else if (isset(htmlspecialchars($this->config['@@__name__@@'])))
+ echo htmlspecialchars($this->config['@@__name__@@']);
else echo '@@__value__@@';
?>
@@ -34,9 +34,9 @@ input[type="email"]|value =
input[type="checkbox"]|value =
<?php
if (isset($_POST['@@__name__@@']))
- echo $_POST['@@__name__@@'];
- else if (isset($this->config['@@__name__@@']))
- echo $this->config['@@__name__@@'];
+ echo htmlspecialchars($_POST['@@__name__@@']);
+ else if (isset(htmlspecialchars($this->config['@@__name__@@'])))
+ echo htmlspecialchars($this->config['@@__name__@@']);
else echo '@@__value__@@';
?>
@@ -69,7 +69,7 @@ input[type="checkbox"]|checked =
@error|before = <?php
if (isset($this->errors)) foreach($this->errors as $message) {?>
- @error [data-v-notification-text] = <?php echo $message;?>
+ @error [data-v-notification-text] = $message
@error|after = <?php
}
@@ -80,7 +80,7 @@ if (isset($this->errors)) foreach($this->errors as $message) {?>
@success|before = <?php
if (isset($this->success)) foreach($this->success as $message) {?>
- @success [data-v-notification-text] = <?php echo $message;?>
+ @success [data-v-notification-text] = $message
@success|after = <?php
}
@@ -91,7 +91,7 @@ if (isset($this->success)) foreach($this->success as $message) {?>
@info|before = <?php
if (isset($this->info)) foreach($this->info as $message) {?>
- @info [data-v-notification-text] = <?php echo $message;?>
+ @info [data-v-notification-text] = $message
@info|after = <?php
}
@@ -101,7 +101,7 @@ if (isset($this->info)) foreach($this->info as $message) {?>
@message|before = <?php
if (isset($this->message)) foreach($this->message as $message) {?>
- @message [data-v-notification-text] = <?php echo $message;?>
+ @message [data-v-notification-text] = $message
@message|after = <?php
}
diff --git a/install/template/language.tpl b/install/template/language.tpl
index 619077d..c3a79bd 100644
--- a/install/template/language.tpl
+++ b/install/template/language.tpl
@@ -25,7 +25,7 @@
if (isset($language['emoji'])) {
echo $language['emoji'] . ' ';
}
- echo $language['name'];
+ echo htmlspecialchars($language['name']);
?>