Changelog

  • 2018-04-28 - DEVELOPMENT
  • 2018-04-26 - DEVELOPMENT
  • 2018-04-21 - DEVELOPMENT
  • 2018-04-13 - DEVELOPMENT
  • 2018-04-01 - DEVELOPMENT
  • 2018-03-31 - DEVELOPMENT
  • 2018-03-30 - DEVELOPMENT
  • 2018-03-16 - DEVELOPMENT
  • 2018-03-09 - DEVELOPMENT
  • 2018-03-02 - STABLE
  • 2018-02-26 - DEVELOPMENT
  • 2018-02-25 - DEVELOPMENT
  • 2018-02-18 - DEVELOPMENT
  • 2018-02-15 - DEVELOPMENT
  • 2018-01-26 - STABLE
  • 2018-01-26 - DEVELOPMENT
  • 2018-01-20 - DEVELOPMENT
  • 2018-01-13 - DEVELOPMENT
  • 2018-01-07 - STABLE
  • 2017-08-18 - STABLE

  • 2018-04-28 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.http_request_post_auth(url,array,auth) - Does a normal POST request with data, but allows you to set a custom auth header like OAuth sdfm9382fo28p9n2uf89jm982.

    Other new features

    • None...

    2018-04-26 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.check_valid_domain(string) - Returns true if a domain given is a valid root domain like www.google.ca and false if not.

    Other new features

    • None...

    2018-04-21 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.file_image_resize_square(imagepath,size,[optional]savepath) - Turns a GIF,PNG,JPEG file into a square down to a size given. It will overwrite the original file if a optional save path is not given.
    • s.file_read_base64(filepath,[optional]haveheader) - Reads a image or other file into a base64 encoded string with file type set. If as a second option you pass false the file type info wont be added before the encoded file.

    Other new features

    • None...

    2018-04-13 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.run_sandbox_file(file) - Runs a file in sandbox mode.
    • s.run_sandbox_code(code) - Runs code given in sandbox mode. To keep the code from parsing it will only accept base64 encoded input text.

    Other new features

    • New sandbox system in all functions to keep access to base v.var only and so on.
    • Any code run in sandbox mode will get its response in JSON encoded string that contains the response in the var response and the cpu time in cputime.

    2018-04-01 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • None...

    Other new features

    • Mysql functions now have support for multiple databases built in. Just add the connection name to the last argument to each mysql system function. For example s.mysql_connect("cats.com","foo","bar","theplace","connection_name") if you dont supply a connection name it gets the name default. You can now make statements agains this specific connection for example s.mysql_insert("INSERT INTO albums (TITLE, AUTHOR, TRACKS) VALUES ('Illusions', 'Thomas Bergersen', 19);","connection_name").

    2018-03-31 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.string_splitlines_array(string) - Splits the string given into an array for each line in the string given.

    Other new features

    • None...

    2018-03-30 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.convert_timestamp_string_unix(format,timestamp) - Converts a unix timestamp to a date format. For example the format D, d M Y will result in the return of Sun, 18 Feb 2018.
    • s.convert_timestamp_string(format,timestamp) - Converts a timestamp to a date format. For example the format D, d M Y will result in the return of Sun, 18 Feb 2018.
    • s.covert_unix_timestamp(timestamp) - Converts a unix timestamp to a SS formatted timestamp.

    Other new features

    • None...

    2018-03-16 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.array_keys(array) - Will return a number array with the values of the keys in the array supplied.
    • s.string_split_array(item,string) - Will split a string into an array based on a character or string given in the first value.
    • s.array_count(array) - Returns how many items are in an array.

    Other new features

    • None...

    2018-03-09 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.string_contains(find,string) - Will return true or false if the FIND content can be found in the STRING.

    Other new features

    • None...

    2018-03-02 - STABLE

    Bugs fixed

    • If you use a function like s.string_replace() with a space replace like in the example v.name=s.string_replace("-"," ",v.newname) it was removing the space, but now will keep it if the value is ONLY a space.

    New system functions

    • s.random_string_phrase(number) - Will generate a random dash separated phrase like crape-myrtle-pigeon. The number supplied will be the number of words used. It will default to 50/50 chance of 2 or 3 words.
    • s.string_first_word_uppercase(string) - Will only make the first word have a upper case starting character, making a string like crape myrtle pigeon become Crape myrtle pigeon.
    • s.system_maxtime(seconds) - Sets the max amount of time the page/scripts will run before closing. Default is 20 seconds.
    • s.system_sleep_second(seconds) - Pauses the script from running for so many seconds.
    • s.system_sleep_ms(millisecond) - Pauses the script from running for so many milliseconds, so a value of 2000 would be 2 seconds.
    • s.sha1(string) - returns a sha1 hash of the string given.
    • s.md5(string) - returns a md5 hash of the string given.
    • s.get_useragent() - Returns the users current useragent string.

    Other new features

    • You can give seconds to advanced the timestamp when calling s.timestamp(). So running s.timestamp(5) will give you what the timestamp will be in 5 seconds.

    2018-02-26 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.get_useragent() - Returns the users current useragent string.

    Other new features

    • None...

    2018-02-25 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.sha1(string) - returns a sha1 hash of the string given.
    • s.md5(string) - returns a md5 hash of the string given.

    Other new features

    • None...

    2018-02-18 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.system_maxtime(seconds) - Sets the max amount of time the page/scripts will run before closing. Default is 20 seconds.
    • s.system_sleep_second(seconds) - Pauses the script from running for so many seconds.
    • s.system_sleep_ms(millisecond) - Pauses the script from running for so many milliseconds, so a value of 2000 would be 2 seconds.

    Other new features

    • You can give seconds to advanced the timestamp when calling s.timestamp(). So running s.timestamp(5) will give you what the timestamp will be in 5 seconds.

    2018-02-15 - DEVELOPMENT

    Bugs fixed

    • If you use a function like s.string_replace() with a space replace like in the example v.name=s.string_replace("-"," ",v.newname) it was removing the space, but now will keep it if the value is ONLY a space.

    New system functions

    • s.random_string_phrase(number) - Will generate a random dash separated phrase like crape-myrtle-pigeon. The number supplied will be the number of words used. It will default to 50/50 chance of 2 or 3 words.
    • s.string_first_word_uppercase(string) - Will only make the first word have a upper case starting character, making a string like crape myrtle pigeon become Crape myrtle pigeon.

    Other new features

    • None...

    2018-01-26 - STABLE

    Bugs fixed

    • When passing an array that also has sub array items into s.array_loop it will now work. You can now use this with s.mysql_select to work with multiple return values in an array.

    New system functions

    • s.quit() - Stops any more code execution and shuts SimpleScript down. This is useful for user systems when a user is redirect for not having permission on the page. This will stop the code after it's called from running.
    • s.2fa("sitename") - Create a new 2FA session for the page, do this before you can call the other 2FA calls or you will just get FALSE returned.
    • s.2fa_createsecret() - Generate a secret code. Store this in your database for the user as you will need it to validate later on.
    • s.2fa_qrcode("sitename","secret") - Returns a DataURI of a generated QR code using the site name and the secret code you already made. The user scans this OR supply them the secret so they can enter it into the 2FA app they want to use. To use the QR code just place it in a image SRC tag.
    • s.2fa_verifycode("original_secret","2fa_app_code") - Using the original users secret that you fetch from the user database or other you can compare it to the code a user submits to verify if it's a code generated using the secret.
    • s.file_uploaded() - Returns true or false if the system had a file uploaded to it.
    • s.file_uploaded_name() - Returns the name of the file uploaded. Remember to clean file names before saving to a database.
    • s.file_uploaded_size() - Returns the size of the file uploaded in bytes.
    • s.file_uploaded_type() - Returns the type of the file uploaded for example image/jpeg.
    • s.file_uploaded_save("/uploadedimage.jpg") - Will save the file to disk in your main web folder default /www.
    • s.http_request_post(url,array) - Will make a HTTP POST request to the url given and post the array, if it cant it will post to the page the item ss_post with the value of true.
    • s.http_request_post_file(url,filepath) - Will make a HTTP POST request to the url given and post the the file to it. It will be sent as the item name file.

    Other new features

    • Fixed and new clean error pages.

    2018-01-26 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.file_uploaded() - Returns true or false if the system had a file uploaded to it.
    • s.file_uploaded_name() - Returns the name of the file uploaded. Remember to clean file names before saving to a database.
    • s.file_uploaded_size() - Returns the size of the file uploaded in bytes.
    • s.file_uploaded_type() - Returns the type of the file uploaded for example image/jpeg.
    • s.file_uploaded_save("/uploadedimage.jpg") - Will save the file to disk in your main web folder default /www.
    • s.http_request_post(url,array) - Will make a HTTP POST request to the url given and post the array, if it cant it will post to the page the item ss_post with the value of true.
    • s.http_request_post_file(url,filepath) - Will make a HTTP POST request to the url given and post the the file to it. It will be sent as the item name file.

    Other new features

    • Fixed and new clean error pages.

    2018-01-20 - DEVELOPMENT

    Bugs fixed

    • When passing an array that also has sub array items into s.array_loop it will now work. You can now use this with s.mysql_select to work with multiple return values in an array.

    New system functions

    • None...

    Other new features

    • None...

    2018-01-13 - DEVELOPMENT

    Bugs fixed

    • None...

    New system functions

    • s.quit() - Stops any more code execution and shuts SimpleScript down. This is useful for user systems when a user is redirect for not having permission on the page. This will stop the code after it's called from running.
    • s.2fa("sitename") - Create a new 2FA session for the page, do this before you can call the other 2FA calls or you will just get FALSE returned.
    • s.2fa_createsecret() - Generate a secret code. Store this in your database for the user as you will need it to validate later on.
    • s.2fa_qrcode("sitename","secret") - Returns a DataURI of a generated QR code using the site name and the secret code you already made. The user scans this OR supply them the secret so they can enter it into the 2FA app they want to use. To use the QR code just place it in a image SRC tag.
    • s.2fa_verifycode("original_secret","2fa_app_code") - Using the original users secret that you fetch from the user database or other you can compare it to the code a user submits to verify if it's a code generated using the secret.

    Other new features

    • None...

    2018-01-07 - STABLE

    Bugs fixed

    • Functions with spaces between the name and { will be registered.
    • Fix for when in a false if statement and you run a while case it wont add to the child id making the while END end the IF statement.

    New system functions

    • s.file_uri(filepath) – Will return a base64 encoded version of the file also known as a data URI.
    • s.math(string) - Will run the supplied math formula. It can contain variables within. v.calculated=s.math("(10.2+0.5*(2-0.4))*2+(2.1*4)")
    • s.system_debug("true") - Turns on or off the system debug echo in the page source overriding the default set.

    Other new features

    Switched to internal deployment and packaging of our ZIP files for the update system. This update is NOT a automatic update from the older versions and will require a new install or running the new installer.

    2017-08-18 - STABLE

    Bugs fixed

    • When a line was not running based on a IF check, it would trigger a ELSE or END call if the string contained it anywhere within, for example using v.varend would trigger a END of IF statement call.
    • Passed url variables did not URL decoded.
    • Over 150 other small bug fixes
    • Fixed problem with quotes clearing and end of variable even if none are at the other end, for example on MYSQL statements removing the second ' from apikey='v.key' if called at the end like in v.number=s.mysql_insert("INSERT INTO api_keys SET email='v.email',date='v.date',apikey='v.key'"). It now only removes if present on the start and end of the statement.
    • To pass a value and regenerate / compute contents just copy to a new var using double ==. This is a re check value, so if you call a database query you can use v.var==v.var to rebuild and move over references.
    • NOT check calls on TRUE and FALSE statements work now, like if not v.var false for cases when comparing to a full or FALSE statement call.
    • Fixes for spaces before and after = character in variable set using functions to return the content to the variable.

    New system functions

    • s.mysql_connect('server','username','password','database') – Connects to a MYSQL based sever with the details provided.
    • s.mysql_close() – Closes active open MYSQL connection.
    • s.mysql_lastid() – Returns the last ID created my MYSQL in the current session. Will return id from the affected table in the last INSERT and UPDATE command.
    • s.mysql_insert('query') – Runs a command against the current open MYSQL database, it can be used for any query but only returns the ID of the last affected INSERT/UPDATE row. Will return FALSE if failed.
    • s.mysql_update('query') – Runs a command against the current open MYSQL database, it can be used for any query but only returns the ID of the last affected INSERT/UPDATE row. Will return FALSE if failed.
    • s.mysql_delete('query') – Runs a command against the current open MYSQL database, will return TRUE or FALSE based on status.
    • s.mysql_select('query') – Runs a command against the current open MYSQL database, it will return the results in array format even when only one object is present. Will return FALSE if failed.
    • s.string_clean(input) – Cleans a string of all style tags, HTML tags, javascript, and multi-line comments.
    • s.array_loop(function,array) - That runs a function for each item in the array supplied. Acts like a regular function call but allows you to also run a function based on a variable name. If no second value is given or is given as a NON array item it still run.
      v.function="foldertree"
      s.array_loop("v.function")
    • s.folder_content(folder) - Gives you a file/folder list of all contents in that said folder returned as an array. You can pass a optional "invert" to sort in reverse alphabetical order. v.items=s.folder_content("/folder","invert")
    • s.string_url_encode(string) - When given a string will return a URL safe version.
    • s.string_url_decode(string) - When given a URL safe string will return a regular version.
    • s.storage_set(name,data) - Allows you to store data that can be called any time in any session, this is used for things like programs or installers saving settings like database connection info.
    • s.storage_get(name) - Allows you to fetch storage data from the system.
    • s.header() Sets the servers return header, you can set this with different values many times before the first content is returned, good for setting content type.
      s.header("Content-Type: application/json")
    • s.cookie_set(name,value,time,domain) - Sets a cookie, where time is the time in seconds it is good for. Domain is optional and will default to / for the current domain.
    • s.cookie_delete(name) - Deletes a cookie that has been set.
    • s.string_username(string) - converts a string to a username safe string like anthony_rossbach_33 from AnthOny Rossbach 33%
    • s.http_request_get(url) - Sends a web request for the content of the url passed, will send with the useragent CodeSimpleScript SSC Script HTTP_REQUEST. Future versions will allow custom useragents (will always append SSC to any custom request for security reasons).

    Other new features

    • New cv.var variables holding current cookie data. This is only updated on the next page load not when a cookie is set.
    • Now can run while loops. They act as a normal IF statement but re run every time the if statement is true. while v.var<=50.