I'm having this error "Disallowed Key Characters." I have try to resolve this, by debugging input.php file. I have this output as
Disallowed Key Characters.2548_don't
can anyone tell me, how to escape single quote
Thanks
Try This
Go to application -> config -> config.php
And try to find
$config['permitted_uri_chars']
change it to
$config['permitted_uri_chars'] = '\#';
this # will allow all the characters.
if ( ! preg_match("/^[a-z0-9':_\/-]+$/i", $str))
{
exit('Disallowed Key Characters.'.$str);
}
added single quote in preg match and it is working now
Thanks
Related
Does someone know how I have to configure CKEditor to use german quotes like:„ ... “
Cause by default it is using quotes like: " ... "
Someone got an idea what I have to change to achieve that?
Use autocorrect plugin (http://ckeditor.com/addon/autocorrect)
config.autocorrect_doubleQuotes = "„“";
I have problems with command 'load'.
For example my script is something like this:
set xlabel ‘blabla’
But when i try to load this, I get:
load '/Users/.../gnuplot.txt'
^
"/Users/.../gnuplot.txt", line 1: invalid character ?
I figured out that adding "reset" before the whole script change the error message:
set xlabel ‘blabla’
^
"/Users/.../gnuplot.txt", line 2: invalid character ?
But when I write everithing into the terminal by myself, I get no errors...
Any idea how to fix it??
Thanks
You are using the wrong quotation marks (Left and Right single quotation marks, codepoints U+2018 and U+2019).
You must use ASCII single or double quotation marks, either ' (0x27) or " (0x22).
Try putting this line before your load command
set encoding utf8
The invalid character smacks of using the wrong character set.
Take a look at this url:
http://localhost/foo/reset_password/bar#foobar.com/74ffb86822ca0a75e378e1eaa3a4a000fbf5eb1f6bc98d2ec789c59b2cc9cfc7e27e7489bfe59cfff04220c3e29f3869b8abc6f0a65ef170b9b9148d3619b2f9
This is the config:
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
The url gives me this error -> The URI you submitted has disallowed characters.
The longest ugly string in the url is timestamp + salt sha512 encoded, but I don't see any disallowed chars in there, any idea what's wrong? Thanks!
There's nothing wrong with your sha hash... the problem is with the at "#" symbol. You cannot have an "#" symbol within the path portion of your URL.
You can escape it to %40
http://localhost/foo/reset_password/bar%40foobar.com/74ffb86822ca0a75e378e1eaa3a4a000fbf5eb1f6bc98d2ec789c59b2cc9cfc7e27e7489bfe59cfff04220c3e29f3869b8abc6f0a65ef170b9b9148d3619b2f9
should work... just unescape the email address on your end
bar#foobar.com, specifically the #, in the URL is the reason for the error.
I have deprecated "eregi" problem.
if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp))
So I changed into this,
if (preg_match("/data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)/i", $edit_img,$tmp))
But I got new warmingmessage,
Warning: preg_match() [function.preg-match]: Unknown modifier 'c'
Please let me know what is wrong.
Thanks in advance.
You have a '/' inside your regex ('data/cheditor') but you are also using '/' as the regex delimiter ('/myregex/flags'): you can either escape the internal '/', or use a different regex delimiter.
E.g. first option:
preg_match('/data\/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)/i',...
or (second option, I chose '#' as the delimiter):
preg_match('#data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)#i',...
Also note I changed the " around your regex to ' because otherwise you need to double the backslashes within double-quotes in PHP.
I am trying to parse a text file that has the weird quotes like
“ and ” into "normal quotes like "
I tried this:
text.gsub!("“",'"')
text.gsub!("”",'"')
but when it's done, they are still there and show up as
\x93 and \x94
so I tried adding that too with no luck:
text.gsub!('\\x93', '"')
text.gsub!('\\x94', '"')
The problem is, when I try to show those weird quotes on a webpage, it makes that weird diamond with a question mark symbol: �
It seems to work:
text = "“foo”"
=> "\342\200\234foo\342\200\235"
irb(main):002:0> text.gsub!("“",'"')
=> "\"foo\342\200\235"
irb(main):003:0> text.gsub!("”",'"')
=> "\"foo\""
You need to use a hex editor to figure out all the character codes involved.
Re: the second question of why the weird quotes show on a web page as the � symbol:
Your problem is that your web page is not in UTF-8 mode. To get it there, see
http://www.w3.org/International/O-HTTP-charset
If you can't change your web server, add a meta line in the head section of your web pages: http://www.utf-8.com/
Larry
Your first gsubs should work. The reason the second set of gsubs don't work is that you're using single quotes and double backslash. Try the other way around:
text.gsub!("\x93", '"')
text.gsub!("\x94", '"')
You can also do this in one line:
text.gsub!("\x93", '"').gsub!("\x94", '"')
# or
text.gsub!(/(\x93|\x94)/, '"')
Are you sure the encoding of the string is correct?