HEX
Server: Apache/2
System: Linux localhost 5.4.0-131-generic #147-Ubuntu SMP Fri Oct 14 17:07:22 UTC 2022 x86_64
User: rasad (1007)
PHP: 7.4.33
Disabled: shell_exec,system,passthru,exec,popen,ini_restore,socket_create,socket_create_listen,socket_create_pair,socket_listen,socket_bind,symlink,link,pfsockopen,ini_alter,dl,pcntl_exec,pcntl_fork,proc_close,proc_open,proc_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_uname,show_source,getfile,mkfifo
Upload Files
File: /home/rasad/public_html/wp-content/plugins/wp-persian/includes/wpp-farsi.php
<?php
/**
 * Created by Siavash Salemi
 * Date: 17/05/2018
 * Time: 01:10 PM
 */

if ( ! defined( 'ABSPATH' ) ) exit;


function wpp_letters_ar2fa( $content ) {
    return str_replace( array( 'ي', 'ك', 'ة', '٤', '٥', '٦' ), array( 'ی', 'ک', 'ه', '۴', '۵', '۶' ), $content );
}


function wpp_numbers_en2fa( $content ) {
    return preg_replace_callback( '/(?:&#\d{2,4};)|(\d+[\.\d]*)|(?:[a-z](?:[\x00-\x3B\x3D-\x7F]|<\s*[^>]+>)*)|<\s*[^>]+>/i',
        'wpp_numbers_to_farsi', $content );
}


function wpp_numbers_to_farsi( $matches ) {
    $farsi_array   = array( "۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "." );
    $english_array = array( "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "." );
    if ( isset( $matches[1] ) ) {
        return str_replace( $english_array, $farsi_array, $matches[1] );
    }
    return $matches[0];
}


function wpp_numbers_to_english( $num ) {
    $farsi_array   = array( "۰", "۱", "۲", "۳", "۴", "۵", "۶", "۷", "۸", "۹", "." );
    $english_array = array( "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "." );

    return str_replace( $farsi_array, $english_array, $num );
}