From 2702b84b81a75e8a85cd341f4e1ce93b771c9e3e Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 17 Mar 2015 06:48:16 +0000 Subject: [PATCH] changed to use | instead of : in hex-ascii conversion --- codepot/src/codepot/config/config.php | 2 +- codepot/src/codepot/libraries/converter.php | 12 +++++++----- codepot/src/js/creole.js | 14 +++++++------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/codepot/src/codepot/config/config.php b/codepot/src/codepot/config/config.php index 422c3415..d7bbb985 100644 --- a/codepot/src/codepot/config/config.php +++ b/codepot/src/codepot/config/config.php @@ -151,7 +151,7 @@ $config['subclass_prefix'] = 'MY_'; | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!! | */ -$config['permitted_uri_chars'] = 'a-z 0-9~%.:_@\-!*'; +$config['permitted_uri_chars'] = 'a-z 0-9~%.:_@\-!*|'; /* diff --git a/codepot/src/codepot/libraries/converter.php b/codepot/src/codepot/libraries/converter.php index a81c998d..a04eba31 100644 --- a/codepot/src/codepot/libraries/converter.php +++ b/codepot/src/codepot/libraries/converter.php @@ -26,17 +26,19 @@ class Converter // backslash to double backslashes. $seg = '!!'; } - else if ($ascii[$i] == ':') + else if ($ascii[$i] == '|') { // colon to backslash-colon - $seg = '!:'; + $seg = '!|'; } else if ($ascii[$i] == '/') { // slash to colon - $seg = ':'; + $seg = '|'; } - else if ($ascii[$i] == '.' || $ascii[$i] == '_' || $ascii[$i] == '-' || $ascii[$i] == ' ') + else if ($ascii[$i] == '.' || $ascii[$i] == '_' || + $ascii[$i] == '-' || $ascii[$i] == ':' || + $ascii[$i] == '@' || $ascii[$i] == ' ') { // no conversion for a period, an underscore, a dash, and a space $seg = $ascii[$i]; @@ -94,7 +96,7 @@ class Converter $seg = $hex[$i]; } } - else if ($hex[$i] == ':') + else if ($hex[$i] == '|') { // colon to slash $seg = '/'; diff --git a/codepot/src/js/creole.js b/codepot/src/js/creole.js index 03a22b13..d3e0e1f7 100644 --- a/codepot/src/js/creole.js +++ b/codepot/src/js/creole.js @@ -197,7 +197,7 @@ var asciiToHex = function (x,dir) { { var i; /* - for(i = 0; i < x.length; i++) + for(i=0; i