Plugin Directory

Changeset 2369311


Ignore:
Timestamp:
08/26/2020 09:28:21 AM (6 years ago)
Author:
marguspala
Message:

utf8 multibyte fix

Location:
smartaccounts/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • smartaccounts/trunk/SmartAccountsArticle.php

    r2001667 r2369311  
    11<?php
    22
    3 if ( ! defined('ABSPATH')) {
     3if (!defined('ABSPATH')) {
    44    exit;
    55} // Exit if accessed directly
     
    2121            $articles = $this->api->sendRequest($body, $getApiUrl, "code=" . urlencode($row->code));
    2222            $settings = json_decode(get_option("sa_settings"));
    23             if ( ! (array_key_exists("articles", $articles) && count($articles["articles"]) == 1)) {
     23            if (!(array_key_exists("articles", $articles) && count($articles["articles"]) == 1)) {
    2424                $body              = new stdClass();
    2525                $body->code        = $row->code;
    26                 $body->description = $row->description;
     26                $body->description = preg_replace('/[\xF0-\xF7].../s', '_', $row->description);
    2727                $body->type        = $row->code == $settings->defaultShipping ? "SERVICE" : "PRODUCT";
    2828                $body->activeSales = true;
  • smartaccounts/trunk/SmartAccountsSalesInvoice.php

    r2275740 r2369311  
    129129                $row->description = $code;
    130130            }
     131            // Remove unsupported UTF-8 multibyte characters.
     132            $row->description = preg_replace('/[\xF0-\xF7].../s', '_', $row->description);
    131133
    132134            $row->code = $code;
  • smartaccounts/trunk/readme.txt

    r2328274 r2369311  
    5959== Changelog ==
    6060
     61= 3.2 =
     62Strip unsupported characters when creating invoices.
    6163
    6264= 3.1 =
  • smartaccounts/trunk/smartaccounts.php

    r2328274 r2369311  
    44 * Plugin URI: https://github.com/smartman/woocommerce_smartaccounts
    55 * Description: This plugin creates sales invoices in the smartaccounts.ee Online Accounting Software after Woocommerce order creation
    6  * Version: 3.1
     6 * Version: 3.2
    77 * Author: Margus Pala
    88 * Author URI: https://marguspala.com
     
    1010 * License URI:  https://www.gnu.org/licenses/gpl-2.0.html
    1111 * Requires at least: 4.8.0
    12  * Tested up to: 5.4.2
     12 * Tested up to: 5.5
    1313 */
    1414
Note: See TracChangeset for help on using the changeset viewer.