Use Any Font - Version 6.2.7

Version Description

  • Early sanitization.
Download this release

Release Info

Developer dnesscarkey
Plugin Icon 128x128 Use Any Font
Version 6.2.7
Comparing to
See all releases

Code changes from version 6.2.6 to 6.2.7

includes/functions/uaf_font_functions.php CHANGED
@@ -281,8 +281,12 @@ function uaf_get_language_selector(){
281
  }
282
 
283
  function uaf_save_font_assign(){
 
 
 
 
284
  $fontsData = uaf_get_uploaded_font_data();
285
- $font_name = $fontsData[$_POST['font_key']]['font_name'];
286
  $fontsImplementRawData = get_option('uaf_font_implement');
287
  $fontsImplementData = json_decode($fontsImplementRawData, true);
288
 
@@ -291,17 +295,17 @@ function uaf_save_font_assign(){
291
  endif;
292
 
293
  $fontElements = array();
294
- $fontElements[] = @join(', ',$_POST['elements']);
295
- $fontElements[] = @join(', ',array_filter(array_map('trim',explode("\n", trim($_POST['custom_elements'])))));
296
  $fontElements = array_filter(array_map('trim',$fontElements));
297
  $finalElements = join(', ', $fontElements);
298
  $finalElements = uaf_langutizse_elements($finalElements);
299
 
300
  if (!empty($finalElements) && !empty($_POST['font_key'])){
301
  $fontsImplementData[date('ymdhis')] = array(
302
- 'font_key' => sanitize_title($_POST['font_key']),
303
- 'font_name' => sanitize_title($font_name),
304
- 'font_elements' => sanitize_text_field($finalElements)
305
  );
306
  $updateFontsImplementData = json_encode($fontsImplementData);
307
  update_option('uaf_font_implement',$updateFontsImplementData);
@@ -317,9 +321,10 @@ function uaf_save_font_assign(){
317
 
318
  function uaf_langutizse_elements($finalElements){
319
  if (isset($_POST['language']) && ($_POST['language'] != 'all_lang')){
 
320
  $finalElementArray = explode(',', $finalElements);
321
  $finalElementArray = array_map('trim', $finalElementArray);
322
- $prefixed_array = preg_filter('/^/', $_POST['language'].' ', $finalElementArray);
323
  $finalElements = join(', ', $prefixed_array);
324
  }
325
  return $finalElements;
281
  }
282
 
283
  function uaf_save_font_assign(){
284
+ $font_key = sanitize_key($_POST['font_key']);
285
+ $elements = array_map('sanitize_title', $_POST['elements']);
286
+ $custom_elements = trim(sanitize_text_field($_POST['custom_elements']));
287
+
288
  $fontsData = uaf_get_uploaded_font_data();
289
+ $font_name = $fontsData[$font_key]['font_name'];
290
  $fontsImplementRawData = get_option('uaf_font_implement');
291
  $fontsImplementData = json_decode($fontsImplementRawData, true);
292
 
295
  endif;
296
 
297
  $fontElements = array();
298
+ $fontElements[] = @join(', ',$elements);
299
+ $fontElements[] = @join(', ',array_filter(array_map('trim',explode("\n", $custom_elements))));
300
  $fontElements = array_filter(array_map('trim',$fontElements));
301
  $finalElements = join(', ', $fontElements);
302
  $finalElements = uaf_langutizse_elements($finalElements);
303
 
304
  if (!empty($finalElements) && !empty($_POST['font_key'])){
305
  $fontsImplementData[date('ymdhis')] = array(
306
+ 'font_key' => $font_key,
307
+ 'font_name' => $font_name,
308
+ 'font_elements' => $finalElements
309
  );
310
  $updateFontsImplementData = json_encode($fontsImplementData);
311
  update_option('uaf_font_implement',$updateFontsImplementData);
321
 
322
  function uaf_langutizse_elements($finalElements){
323
  if (isset($_POST['language']) && ($_POST['language'] != 'all_lang')){
324
+ $language = sanitize_title($_POST['language']);
325
  $finalElementArray = explode(',', $finalElements);
326
  $finalElementArray = array_map('trim', $finalElementArray);
327
+ $prefixed_array = preg_filter('/^/', $language.' ', $finalElementArray);
328
  $finalElements = join(', ', $prefixed_array);
329
  }
330
  return $finalElements;
includes/uaf_config.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
- $GLOBALS['uaf_current_version'] = '6.2.6';
5
 
6
 
7
  $GLOBALS['uaf_fix_settings'] = array(
1
  <?php
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
+ $GLOBALS['uaf_current_version'] = '6.2.7';
5
 
6
 
7
  $GLOBALS['uaf_fix_settings'] = array(
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: dnesscarkey
3
  Tags: custom fonts, font embed, font uploader, typography, install font
4
  Requires at least: 3.0
5
  Tested up to: 5.9
6
- Stable tag: 6.2.6
7
 
8
  Embed any custom font using font uploader and assign to elements. Upload font in 1 format and other needed formats are auto converted even woff2.
9
 
@@ -148,6 +148,9 @@ Please do write us after integration and we will add it in our supported list.
148
 
149
  == Changelog ==
150
 
 
 
 
151
  = 6.2.6 =
152
  * Removed use of PHP uploader.
153
 
3
  Tags: custom fonts, font embed, font uploader, typography, install font
4
  Requires at least: 3.0
5
  Tested up to: 5.9
6
+ Stable tag: 6.2.7
7
 
8
  Embed any custom font using font uploader and assign to elements. Upload font in 1 format and other needed formats are auto converted even woff2.
9
 
148
 
149
  == Changelog ==
150
 
151
+ = 6.2.7 =
152
+ * Early sanitization.
153
+
154
  = 6.2.6 =
155
  * Removed use of PHP uploader.
156
 
use-any-font.php CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Use Any Font
5
  Plugin URI: https://dineshkarki.com.np/use-any-font
6
  Description: Embed any font in your website
7
  Author: Dnesscarkey
8
- Version: 6.2.6
9
  Author URI: https://dineshkarki.com.np/use-any-font
10
  */
11
 
5
  Plugin URI: https://dineshkarki.com.np/use-any-font
6
  Description: Embed any font in your website
7
  Author: Dnesscarkey
8
+ Version: 6.2.7
9
  Author URI: https://dineshkarki.com.np/use-any-font
10
  */
11