What's new

[BUG] [Working] Unable to handle apostrophe in device name

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

peepsnet

Regular Contributor
I was just made aware that the routers firmware cannot handle an apostrophe in a device name.
See Here and here

I have traced it to a function call "get_folder_tree()" in /www/aidisk/getfolderarray.asp:
where this is returned:
Code:
var result = [<% get_folder_tree(); %>];

var result = ['WD easystore 25FB#0#1', 'SanDisk' Cruzer Fit#1#2'];

Is there a way to update the code in the function: get_folder_tree()

I searched all the files under /www but could not find the file containing the function.
Code:
admn@router:/tmp/home/root# grep -rn '/www/' -e 'get_folder_tree'
/www/aidisk/getfolderarray.asp:10:var result = [<% get_folder_tree(); %>];
/www/aidisk/getfolderarray.asp:13:function get_folder_tree_success(){
/www/aidisk/getfolderarray.asp:18:<body onload="get_folder_tree_success();">
/www/getfoldertree.asp:1:<% get_folder_tree(); %>
/www/gettree.asp:1:treeitems = [<% get_folder_tree(); %>];


Is it part of the web server??
What can we do??
 
If it can't handle it then simply just don't use it. Why bother. :rolleyes:
 
If it can't handle it then simply just don't use it. Why bother. :rolleyes:
Because I don't have another USB that doesn't have a '

I can buy one or just fix it for everybody
 
That's ActiveScript, meaning that's not a Javascript function, it's processed at run time by the web server.
 
That's ActiveScript, meaning that's not a Javascript function, it's processed at run time by the web server.
So would that be up to Asus to work on or is the Webserver something we can touch??

and that variable is stored in a client-side script that appears to be javascript but the www files are R/O
 
So would that be up to Asus to work on or is the Webserver something we can touch??

Should be fixable, these portions of the code are usually open.

and that variable is stored in a client-side script that appears to be javascript but the www files are R/O

It's not a variable, it's a tag that gets processed by the web server before being pushed to the clients. Very similar to how PHP works, for example.
 
What router and firmware version are you using? I just checked the code, and it's using double quotes for elements, not single quotes.
 
What router and firmware version are you using? I just checked the code, and it's using double quotes for elements, not single quotes.
I was just given a FW to test and it is working. I am waiting for final thoughts and testing

RT-AC3100 384.16_beta2 at the time of OP
 
What router and firmware version are you using? I just checked the code, and it's using double quotes for elements, not single quotes.
Two places in httpd/web.c need to be changed from single quotes to escaped double quotes.....search for the string
"'%s#%u#%u'"

Let me know if you want me to send you the patch....
 
Two places in httpd/web.c need to be changed from single quotes to escaped double quotes.....search for the string
"'%s#%u#%u'"

Let me know if you want me to send you the patch....

I only checked the function mentioned in the first post, I didn't check for other functions being possibly broken.

I'll fix the two other cases, thanks.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top