Announcement

Collapse
No announcement yet.

Miva Empresa 5.23 Has Been Released

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Miva Empresa 5.23 Has Been Released

    Miva Empresa 5.23 Release Notes

    New Features

    New Built-in Functions

    slugify( data )

    Use this function to create friendly URLs. It takes characters that are forbidden in URIs and either converts them to a valid ASCII character or remove thems completely. It adds a hyphen (-) in place of all space characters. For example, the product "Padre Baseball Hat!" becomes "Padre-Baseball-Hat" which is now URI friendly.

    Parameters:
    • data - The string to convert


    Return Value:
    • The converted URI friendly string

    miva_splitstring( string, sep, output var, flags )

    Splits a string into chunks in an array, using the separator parameter as the point to split the string.

    Parameters:
    • string – The input string
    • sep – A single character that will be used to split the string into multiple elements
    • output var – The array of elements
    • flags – A comma separated list of any of the following:
      • trim – removes extra space around the left and right sides of all elements
      • ltrim – removes extra space around the left side of all elements
      • rtrim – removes extra space around the right side of all elements
      • lower – converts all elements to lowercase
      • upper – converts all elements to uppercase
      • insensitive – searches for sep input parameter using a case-insensitive search


    Return Value:
    • The number of elements in the output array

    fssymlink( source, destination )

    This function creates a symbolic link from a file in the data directory to the scripts directory (Available on UNIX file systems only).

    Parameters:
    • source – source file fully qualified path in the data directory
    • destination – destination file fully qualified path in the scripts directory


    Return Value:
    • 1 if success
    • 0 if fail

    sfsymlink( source, destination )

    This function creates a symbolic from a file in the scripts directory to the data directory (Available on UNIX file systems only).

    Parameters:
    • source – source file fully qualified path in the scripts directory
    • destination – destination file fully qualified path in the data directory


    Return Value:
    • 1 if success
    • 0 if fail

    New API Methods

    mvProgram_CharacterSetIsUTF8 – Determines whether the current character set is set to UTF8

    Parameters:
    • mvProgram program: The current MivaVM


    Return Value:
    • 1 if the character set is UTF8
    • 0 otherwise

    mvProgram_GetCharacterSet – Returns the current character set

    Parameters:
    • mvProgram program: The current MivaVM


    Return Value:
    • A null terminated string containing the current character set

    mvLinkBuffer_Allocate – A wrapper method used to interact with the LinkBuffer class

    Parameters:
    • int first_block_size – The size in bytes of the first block to be created
    • int grow_size – The size in bytes of all subsequent blocks that are created


    Return Value:
    • Returns an mvLinkBuffer which is a pointer to the LinkBuffer class in memory

    mvLinkBuffer_Free – A wrapper method used to delete a previously allocated LinkBuffer

    Parameters:
    • mvLinkBuffer linkbuffer – A previously allocated mvLinkBuffer


    Return Value:
    • None

    mvLinkBuffer_Concat_String – A wrapper method used to append a string to the end of the LinkBuffer string

    Parameters:
    • mvLinkBuffer linkbuffer – A previously allocated mvLinkBuffer
    • const char *data – The data string to add to the end of the LinkBuffer string
    • int data_length – The length of the passed in data pointer


    Return Value:
    • None

    mvLinkBuffer_Concat_Char – A wrapper method used to append a character to the end of the LinkBuffer string

    Parameters:
    • mvLinkBuffer linkbuffer – A previously allocated mvLinkBuffer
    • char data – A single character to add to the end of the LinkBuffer string


    Return Value:
    • None

    mvLinkBuffer_Concat_HexChar – A wrapper method used to append a character in hex format to the end of the LinkBuffer string

    Parameters:
    • mvLinkBuffer linkbuffer – A previously allocated mvLinkBuffer
    • unsigned char data – A single character that will be converted to hex, then added to the end of the LinkBuffer string


    Return Value:
    • None

    mvLinkBuffer_Concat_Release – A wrapper method used to get the value of all LinkBuffer blocks glued together. Using this method will clear out the data from the LinkBuffer memory and you are responsible for freeing it from memory.

    Parameters:
    • mvLinkBuffer linkbuffer – A previously allocated mvLinkBuffer
    • int *data_length – An output parameter stating the length of the returned data string
    • int *data_size – An output parameter stating how many bytes are allocated for the returned data string
    • int headroom – A value that ensures X number of extra bytes are available in the size of the returned data string (useful if you want to ensure there is enough room to null-terminate the string)


    Return Value:
    • (char * ) A null-terminated string of all the data blocks glued together

    mvLinkBuffer_Data – A wrapper method used to get the value of all LinkBuffer blocks glued together. Using this method will not clear out the data from memory and you should not free this from memory.

    Parameters:
    • mvLinkBuffer linkbuffer – A previously allocated mvLinkBuffer
    • int *data_length – An output parameter stating the length of the returned data string


    Return Value:
    • (const char * ) A null-terminated string of all the data blocks glued together

    Store Morph Changes

    • &mvts:...; (outputs a token using the slugify function)

    Other Changes

    • Both the MivaScript compiler and virtual machine are now supported on MacOS X
    • Hexadecimal values are now allowed for numeric configuration settings, such as MvCONFIG_FLAGS_SECURITY and MvCONFIG_LOG_LEVEL

    Bugs Fixed


    15219: Virtual Machine: HTTP headers are not correctly parsed in some cases
    17647: Code Coverage Tool: mvcov --version flag should output a newline
    17648: Profiling Tool: mvprof --version flag should output a newline
    17782: Compiler: Compiling with -O flag on a string with escape characters causes unexpected behavior
    18236: Compiler: Function parameters should not allow blank values
    18241: Compiler: Compiler fails to correctly compile when a <=!=[=C=D=A=T=A=[ tag is present as XML/HTML
    19027: Builtins: system: bi_miva_getvarlist should use memcmpi
    19031: Compiler: Function parameters should only allow alphanumeric and underscore characters
    19032: Configuration: Environment Based: Allow MvCONFIG_* integer data types to be specified in hexadecimal
    19033: Configuration: 3.x: Allow MvCONFIG_* integer data types to be specified in hexadecimal
    19168: Virtual Machine: Function parameter logging should recursively output structures and arrays
    19415: Virtual Machine: Expression compiler fails to recognize invalid function when wrapped in RHS parentheses and combined with a BINARY operator
    19489: Virtual Machine: htscallerid cookie is not properly handled on IIS7
    19490: Virtual Machine: All application versions should free OpenSSL error strings
    19492: Virtual Machine: ::MakeSessionID should initialize all data to 0
    19493: Compiler: UNIXCompilerApplication never deletes its _library_manager pointer
    19494: Compiler: Parser::~Parser never deletes its expression_parser pointer
    19495: Compiler: FileCompilerParser::* - Allocated memory is not being deleted properly
    19496: Assembler: AssemblerParser leaks memory when dealing with FunctionContexts
    19497: Compiler: CompilerApplication::Go never deletes its parser pointer when a compile error occurs
    19499: Assembler: AssemblerParser::ProcessImmediate never deletes allocated pointer
    19516: Virtual Machine: String method "assign_nocopy" is incorrectly used in a number of places
    19538: Virtual Machine: UNIXNetwork/WinSockNetwork::ReadLine does not build the buffer correctly when sequential reads occur without a newline
    19547: Virtual Machine: s.callnumberofheaders is set incorrectly
    19595: Virtual Machine: Variable's reference counts should be incremented when pushed onto the stack
    19597: Virtual Machine: MivaVM_Stack::PopS: We should NULL terminate the copied variable string
    19614: MivaSQL: Index lookups with keys longer than the 100 character limit result in incorrect resultsets
    19685: Virtual Machine: MivaVM::Lookup_VariableList sometimes returns the incorrect number of list entries
    19824: Compiler: CompilerParser fails to delete its pointers to global_variables and system_variables
    19825: Compiler: CompilerParser does not delete the pointers stored in the called_functions hash table
    19882: Builtins: file: bi_dir does not released its allocated VariableList
    19883: Virtual Machine: mvDirectory_Listing should not increase the new variables refcount
    19886: MivaSQL: SQLCreateIndexStatement fails to delete elements stored in the index_columnlist
    19887: Builtins: system: miva_array_copy should not increase the new variables refcount
    19888: Builtins: system: miva_array_merge should not increase the new variables refcount
    19889: Configuration: 3.x: config3x_setconfigvalue fails to free memory when handling the CONFIG3X_SETTING_BUILTINDIR case
    19890: Configuration: 3.x: Memory leak in config.l when parsing configuration files
    19891: Builtins: archive: wdownload fails to free all of its allocate data
    19892: Builtins: archive: xml_parse fails to delete the root context
    19894: Builtins: archive: bi_tar_directory does not free the member variable
    19895: MySQL Connector: The MySQL Connector needs to call mysql_library_end() in order to avoid memory leaks
    19897: MivaSQL: xbasesql_db_openview doesn't delete the allocated view_context when an error occurs
    19898: Virtual Machine: MivaVM_Stack::PopV( Variable **, int * ) does not delete string or link buffer data when the delete flag is set
    19899: Builtins: system: miva_json_decode leaks memory in multiple locations
    19900: Virtual Machine: SMTP::Start fails to delete its created SMTPOutput variable
    19901: Builtins: mvlibgd: libgd_load_context does not delete its allocated context when an error occurs
    19903: Builtins: template: mvt:assign/eval/do/call/foreach*/while* leak memory when outputting their error messages
    19904: Builtins: mvlibgd: libgd_context_cleanup does not clean up all allocated memory
    19906: Configuration: 3.x: VirtualHost tags do not behave properly when dnslookup is enabled
    19907: Assembler: LocalizedIndex::Write does not fill the entire buffer; causes a Valgrind warning
    19908: Compiler: ExpressionParser::Parse_Funcdo does not delete its Tokenizer pointer
    19909: Builtins: crypto: bi_crypto_pbkdf2 fails to call all required OpenSSL cleanup functions
    19912: Miva Mia: Miva Mia does not set s.content_length or s.content_type
    19913: Miva Mia: Frequent crashes at address 0x0001fbf3 in MVDMYSQL.DLL when connecting to a MySQL server (Mia)
    19915: Virtual Machine: MvCALL leaks memory when an invalid URL is specified or connection to the remote server fails
    Last edited by Rick Wilson; 09-24-15, 02:12 PM.
    Thanks,

    Rick Wilson
    CEO
    Miva, Inc.
    [email protected]
    https://www.miva.com

    #2
    Re: Miva Empresa 5.23 Has Been Released

    Originally posted by Rick Wilson View Post
    Miva Empresa 5.23 Release Notes
    New Built-in Functions
    slugify( data )
    Use this function to create friendly URLs. It takes characters that are forbidden in URIs and either converts them to a valid ASCII character or remove thems completely. It adds a hyphen (-) in place of all space characters. For example, the product "Padre Baseball Hat!" becomes "Padre-Baseball-Hat" which is now URI friendly.
    Can we get some specifics on this please? Which characters are removed, which characters are converted, and what are they converted to?

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment


      #3
      Re: Miva Empresa 5.23 Has Been Released

      Hey Kent -

      In the 9.0004 LSK see this file:
      /features/uri/uri_ut.mv

      It has a function: URI_Slugify. The Engine version of this does the same replacement, just faster since it is at the engine level.
      Brennan Heyde
      VP Product
      Miva, Inc.
      [email protected]
      https://www.miva.com

      Comment


        #4
        Re: Miva Empresa 5.23 Has Been Released

        From a look at the LSK source code, it appears that the slugify operation consists of the following steps:

        - Replace a number of international characters with alphanumeric substitutes; e.g. use upper-case A instead of the "A with a tilde on top" character (ASCII 195).

        - Replace all white-space characters with dashes.

        - Remove anything that's not an alphanumeric, dash, or underscore.
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment

        Working...
        X