Search Results

Search found 1174 results on 47 pages for 'escape'.

Page 11/47 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Any way to get TStringList.CommaText to not escape commas with quotes?

    - by Mason Wheeler
    I'm doing some work with code generation, and one of the things I need to do is create a function call where one of the parameters is a function call, like so: result := Func1(x, y, Func2(a, b, c)); TStringList.CommaText is very useful for generating the parameter lists, but when I traverse the tree to build the outer function call, what I end up with looks like this: result := Func1(x, y, "Func2(a, b, c)"); It's quoting the third argument because it contains commas, and that produced invalid code. But I can't do something simplistic like StringReplace all double quotes with empty strings, because it's quite possible that a function argument could be a string with double quotes inside. Is there any way to make it just not escape the lines that contain commas?

    Read the article

  • When can a freely moving sphere escape from a ‘cage’ defined by a set of impassible coordinates?

    - by RGrey
    Hopefully there are some computational geometry folks here who can help me out with the following problem - Please imagine that I take a freely moving ball in 3-space and create a 'cage' around it by defining a set of impassible coordinates, Sc (i.e. points in 3-space that no part of the diffusing ball is allowed to overlap). These points reside within the volume, V(cage), of some larger sphere, where V(cage) V(ball). Provided the set of impassible coordinates, Sc, is there a computationally efficient and/or nice way to determine if the ball can ever escape the cage?

    Read the article

  • Why do escape characters break my Telerik call to ResponseScripts.Add(string)?

    - by David
    this displays the expected javascript alert message box: RadAjaxManager1.ResponseScripts.Add("alert('blahblahblah');"); while these does not: RadAjaxManager1.ResponseScripts.Add("alert('blahblah \n blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert('blahblah \r blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert('blahblah \r\n blahblahblah');"); RadAjaxManager1.ResponseScripts.Add("alert('blahblah \n\t blahblahblah');"); RadAjaxManager1.ResponseScripts.Add(@"alert('blahblah \n blahblahblah');"); string message = "blahblahblah \n blahblahblah"; RadAjaxManager1.ResponseScripts.Add(message); I can't find any documentation on escape characters breaking this. I understand the single string argument to the Add method can be any script. No error is thrown, so my best guess is malformed javascript.

    Read the article

  • Ruby on Rails: How best to escape a string in a model?

    - by williamjones
    I want my application to sanitize html on input rather than on display, so that the fields saved into the database are sanitized. I've been doing this with strip_tags, and it was working great. However, this has the downside that it means the user can't input anything that's bracketed with < and . How can I tell Rails in the model to securely escape tags before saving them to the database? I'd like to not have to call h on the sanitized fields again before using them in the views.

    Read the article

  • Mysql replace() function, help with query (what chars do I escape?)

    - by jyoseph
    I am trying to update an old cms where images were stored in /images/editor/, they are now stored in a bucket on amazon s3. I'm trying to update the database using mysql replace. I've done this in the past with replacing simple words, but now Mysql is reporting an error, I suspect because this is more than a simple word: UPDATE contents SET desc = replace(desc, '/images/editor/', 'http://s3.amazonaws.com/my_bucket/editor/') Do I need to escape the : or slashes? I've tried escaping it with a '\' to no avail. Can someone get me pointed in the right direction? Thanks! Edit Here's the error I am getting, nothing too telling error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc = replace(desc, '/images/editor', 'http://s3.amazonaws.com/app_navigator/ed' at line 1

    Read the article

  • How do you escape double quotes inside a SQL fulltext 'contains' function?

    - by Richard Davies
    How do you escape a double quote character inside a MS SQL 'contains' function? SELECT decision FROM table WHERE CONTAINS(decision, '34" AND wide') Normally contains() expects double quotes to surround an exact phrase to match, but I want to search for an actual double quote character. I've tried escaping it with \, `, and even another double quote, but none of that has worked. P.S. I realize a simple example like this could also be done using the LIKE statement, but I need to use the fulltext search function. The query I provided here has been simplified from my actual query for example purposes.

    Read the article

  • How to "escape" the JavaScript class keyword to specify a CSS class value.

    - by Robert Claypool
    C# allows a reserved word to be used as a property name via the ampersand. e.g. // In ASP.NET MVC, we use @class to define // the css class attribute for some HtmlHelper methods. var htmlObject = new { readonly = "readonly", @class = "ui-state-highlight" } I want to do the same in JavaScript. e.g. function makeGrid(grid, pager) { grid.jqGrid({ caption: 'Configurations', colNames: ['Id', 'Name'], colModel: [ { name: 'Id', index: 'Id' }, { name: 'Name', index: 'Name', editable: true, editoptions: { readonly: 'readonly', class: 'FormElement readonly' } }, ], pager: pager, url: 'www.example.com/app/configurations") %>', editurl: 'www.example.com/app/configurations/edit") %>' }).navGrid(pager, { edit: true, add: false, del: false, search: false }, {}, {}, {}); } Note class: 'FormElement readonly' is supposed to set the css class value on jqGrid's edit dialog, but IE errors out on the reserved word. Is there an escape character in JavaScript too? #class? @class? &class? Otherwise, how might I tell jqGrid to set the css class on the popup editor? Thank you.

    Read the article

  • Is it necessary to "escape" character "<" and ">" for javascript string?

    - by Morgan Cheng
    Sometimes, server side will generate strings to be embedded in inline JavaScript code. For example, if "UserName" should be generated by ASP.NET. Then it looks like. <script> var username = "<%UserName%>"; </script> This is not safe, because a user can have his/her name to be </script><script>alert('bug')</script></script> It is XSS vulnerability. So, basically, the code should be: <script> var username = "<% JavascriptEncode(UserName)%>"; </script> What JavascriptEncode does is to add charater "\" before "/" and "'" and """. So, the output html is like. var username = "<\/scriptalert(\'bug\')<\/script<\/script"; Browser will not interpret "<\/script" as end of script block. So, XSS in avoided. However, there are still "<" and "" there. It is suggested to escape these two characters as well. First of all, I don't believe it is a good idea to change "<" to "&lt;" and "" to "&gt;" here. And, I'm not sure changing "<" to "\<" and "" to "\" is recognizable to all browsers. It seems it is not necessary to do further encoding for "<" and "". Is there any suggestion on this? Thanks.

    Read the article

  • How Do I Escape Apostrophes in Field Valued in SQL Server?

    - by Mikecancook
    I asked a question a couple days ago about creating INSERTs by running a SELECT to move data to another server. That worked great until I ran into a table that has full on HTML and apostrophes in it. What's the best way to deal with this? Lucking there aren't too many rows so it is feasible as a last resort to 'copy and paste'. But, eventually I will need to do this and the table by that time will probably be way too big to copy and paste these HTML fields. This is what I have now: select 'Insert into userwidget ([Type],[UserName],[Title],[Description],[Data],[HtmlOutput],[DisplayOrder],[RealTime],[SubDisplayOrder]) VALUES (' + ISNULL('N'''+Convert(varchar(8000),Type)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),Username)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),Title)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),Description)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),Data)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),HTMLOutput)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),DisplayOrder)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),RealTime)+'''','NULL') + ',' + ISNULL('N'''+Convert(varchar(8000),SubDisplayOrder)+'''','NULL') + ')' from userwidget Which is works fine except those pesky apostrophes in the HTMLOutput field. Can I escape them by having the query double up on the apostrophes or is there a way of encoding the field result so it won't matter?

    Read the article

  • How do I write escape characters verbatim (without escaping) using StreamWriter?

    - by Joel
    I'm writing a utility that takes in a .resx file and creates a javascript object containing properties for all the name/value pairs in the .resx file. This is all well and good, until one of the values in the .resx is This dealer accepts electronic orders. /r/nClick to order {0} from this dealer. I'm adding the name/value pairs to the js object like this: streamWriter.Write(string.Format("\n{0} : \"{1}\"", kvp.Key, kvp.Value)); When kvp.Value = "This dealer accepts electronic orders./r/nClick to order {0} from this dealer." This causes StreamWriter.Write() to actually place a newline in between 'orders.' and 'Click', which naturally screws up my javascript output. I've tried different things with @ and without using string.Format, but I've had no luck. Any suggestions? Edit: This application is run during build to get some javascript files deployed later, so at no point is it accessible to / run by anyone but the app developers. So while I obviously need a way to escape characters here, XSS as such is not really a concern.

    Read the article

  • Is it necessary to mysql real escape when using alter table?

    - by cgwebprojects
    I noticed the other day that I cannot bind variables when using PDO with ALTER TABLE for example the following example will not work, $q = $dbc -> prepare("ALTER TABLE emblems ADD ? TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', ADD ? DATETIME NOT NULL"); $q -> execute(array($emblemDB, $emblemDB . 'Date')); So is it necessary to use mysql_real_escape string and do it like below, // ESCAPE NAME FOR MYSQL INSERTION $emblemDB = mysql_real_escape_string($emblemDB); // INSERT EMBLEM DETAILS INTO DATABASE $q = $dbc -> prepare("ALTER TABLE emblems ADD " . $emblemDB . " TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', ADD " . $emblemDB . "Date DATETIME NOT NULL"); $q -> execute(); Or do I not need to add in mysql_real_escape_string? As the only thing the query can do is ADD columns? Thanks

    Read the article

  • Ouch, how to escape this in sed? Cleaning up iframe malware

    - by user1769783
    I'm helping someone clean up a malware infection on a site and I'm having a difficult time correctly matching some strings in sed so I can create a script to mass search and replace / remove it. The strings are: <script>document.write('<style>.vb_style_forum {filter: alpha(opacity=0);opacity: 0.0;width: 200px;height: 150px;}</style><div class="vb_style_forum"><iframe height="150" width="200" src="http://www.iws-leipzig.de/contacts.php"></iframe></div>');</script> <script>document.write('<style>.vb_style_forum {filter: alpha(opacity=0);opacity: 0.0;width: 200px;height: 150px;}</style><div class="vb_style_forum"><iframe height="150" width="200" src="http://vidintex.com/includes/class.pop.php"></iframe></div>');</script> <script>document.write('<style>.vb_style_forum {filter: alpha(opacity=0);opacity: 0.0;width: 200px;height: 150px;}</style><div class="vb_style_forum"><iframe height="150" width="200" src="http://www.iws-leipzig.de/contacts.php"></iframe></div>');</script> I cant seem to figure out how to escape the various characters in those lines... If I try to just say delete the entire line if it matches http://vidintex.com/includes/class.pop.php it also deletes the closing "" in the .html files as well. Any help would be greatly appreciated!

    Read the article

  • how to escape “@” in the username when logging in through FTPES with curl?

    - by user62367
    $ curl -T "index.html" -k --ftp-ssl -u "[email protected]" MYDOMAIN.COM Enter host password for user '[email protected]': % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 57173 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>405 Method Not Allowed</title> </head><body> <h1>Method Not Allowed</h1> <p>The requested method PUT is not allowed for the URL /index.html.</p> <hr> <address>Apache/2.2.16 Server at MYDOMAIN.COM Port 80</address> </body></html> 100 57480 100 307 100 57173 284 52902 0:00:01 0:00:01 --:--:-- 53633 can someone help me? Also posted on Stack Overflow

    Read the article

  • How does one close a Popup in Silverlight 3 by pressing the Escape key?

    - by Jacob
    I've just implemented a context menu control in Silverlight 3. One feature lacking in this control is for the Esc key to dismiss the menu. I've tried adding a KeyUp event handler in a few places, but the handler is never called. It looks like KeyUp is only available for items that can have focus. The popup menu cannot have focus, however, as it is only an ItemsControl. Have any of you successfully implemented having the Esc key close a Popup, or do you have any other suggestions on how I can implement this behavior?

    Read the article

  • HTML: <textarea>-Tag: How to correctly escape HTML and JavaScript content displayed in there?

    - by jens
    Hello, I have a HTML Tag <textarea>$FOO</textarea> and the $FOO Variable will be filled with arbitrary HTML and JavaScript Content, to be displayed and edited within the textarea. What kind of "escaping" do I neet to apply to $FOO? I first tought of escaping it HTML but this didnt work (as I will then get shown not the original HTML Code of $FOO but rather the escaped content. This is of course not what I want: I want to be displayed the unescaped HTML/JS Content of the variable... Is it impossible to display HTML Content within a <textarea> tag and also allow it to be editable as full HTML? thanks jens

    Read the article

  • How to execute PHP code from within javascript escape/unescape ?

    - by Karthik
    <Script Language='Javascript'> <!-- document.write(unescape('<?php if ( ! defined('PROJECTNAME')) exit(''); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </body> </html> ')); //--> </Script> I did not copy paste the whole code. There is more PHP code within the javascript. How to make the browser understand that the php code is php and not treat it as a part of a html code?

    Read the article

  • Using YQL multi-query & XPath to parse HTML, how to escape nested quotes?

    - by Tivac
    The title is more complicated than it has to be, here's the problem query. SELECT * FROM query.multi WHERE queries=" SELECT * FROM html WHERE url='http://www.stumbleupon.com/url/http://www.guildwars2.com' AND xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span'; SELECT * FROM xml WHERE url='http://services.digg.com/1.0/endpoint?method=story.getAll&link=http://www.guildwars2.com'; SELECT * FROM json WHERE url='http://api.tweetmeme.com/url_info.json?url=http://www.guildwars2.com'; SELECT * FROM xml WHERE url='http://api.facebook.com/restserver.php?method=links.getStats&urls=http://www.guildwars2.com'; SELECT * FROM json WHERE url='http://www.reddit.com/button_info.json?url=http://www.guildwars2.com'" Specifically this line, xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span' It's problematic because of the quoting, I have to nest them three levels deep and I've run out of quote characters to use. I've tried the following variations without success: //no attribute quoting xpath='//li[@class=listLi]/div[@class=views]/a/span' //try to quote attribute w/ backslash & single quote xpath='//li[@class=\'listLi\']/div[@class=\'views\']/a/span' //try to quote attribute w/ backslash & double quote xpath='//li[@class=\"listLi\"]/div[@class=\"views\"]/a/span' //try to quote attribute with double single quotes, like SQL xpath='//li[@class=''listLi'']/div[@class=''views'']/a/span' //try to quote attribute with double double quotes, like SQL xpath='//li[@class=""listLi""]/div[@class=""views""]/a/span' //try to quote attribute with quote entities xpath='//li[@class=&quot;listLi&quot;]/div[@class=&quot;views&quot;]/a/span' //try to surround XPath with backslash & double quote xpath=\"//li[@class='listLi']/div[@class='views']/a/span\" //try to surround XPath with double double quote xpath=""//li[@class='listLi']/div[@class='views']/a/span"" All without success. I don't see much out there about escaping XPath strings but everything I've found seems to be variations on using concat (which won't help because neither ' nor " are available) or html entities. Not using quotes for the attributes doesn't throw an error but fails because it's not the actual XPath string I need. I don't see anything in the YQL docs about how to handle escaping. I'm aware of how edge-casey this is but was hoping they'd have some sort of escaping guide.

    Read the article

  • Does posting data with a textarea automatically add slashes to (escape) the text?

    - by animuson
    Ok, so I'm having a problem with a simple textarea. I'm using a kind of hidden page to easily encode some data using JSON. However, all of my text input is automatically being escaped somewhere and I don't know where. All of my $_POST variables are automatically run through the htmlentities() function when the script starts up, as seen below: $ani->i->post = $this->clean($_POST, true); function clean($values, $unset = false) { if (is_array($values)) { foreach ($values as $key => $value) { $newkey = strtolower($key); $return[$newkey] = $this->clean($value); unset($values[$key]); } return $return; } return htmlentities($values); } I keep getting \' for all of my single quotes when I put the value back into the textarea. I can't find anywhere where it would be adding slashes and I don't remember it being a feature that they were automatically added when you submit from a textarea, and if that was so, why would they not be returning back to a single quote when put back into the textarea? Do I really need to run variables through stripslashes() to get them back to their original form? Edit: My 'test.php' file is as follows: <h1>To Be Encoded:</h1> <form action="/test" method="post"> <textarea name="encode" rows="20" cols="50"><?= html_entity_decode($ani->i->post['encode']) ?></textarea> <input type="submit" name="submit" value="Encode It!" /> </form> <h1>Encoded By JSON:</h1> <textarea name="encoded" rows="20" cols="50"><?= json_encode(html_entity_decode($ani->i->post['encode'])) ?></textarea> <?php die(); ?> P.S. The die() is just there for compatibility with my framework.

    Read the article

  • How do I write escape characters verbatim (without escaping) in C# using StreamWriter?

    - by Joel
    I'm writing a utility that takes in a .resx file and creates a javascript object containing properties for all the name/value pairs in the .resx file. This is all well and good, until one of the values in the .resx is This dealer accepts electronic orders. /r/nClick to order {0} from this dealer. I'm adding the name/value pairs to the js object like this: streamWriter.Write(string.Format("\n{0} : \"{1}\"", kvp.Key, kvp.Value)); When kvp.Value = "This dealer accepts electronic orders./r/nClick to order {0} from this dealer." This causes StreamWriter.Write() to actually place a newline in between 'orders.' and 'Click', which naturally screws up my javascript output. I've tried different things with @ and without using string.Format, but I've had no luck. Any suggestions?

    Read the article

  • How to escape charaters in the title of a marker in a Google Maps?

    - by Anthony
    Say I have this piece of code: var marker = new google.maps.Marker({ position: location, title: 'B&#250;fals', map: map }); This creates a marker as expected but if I hover the mouse over it I don’t see 'Búfals' as I would expect (instead I see the html code). This doesn't make any difference: var marker = new google.maps.Marker({ position: location, title: unescape('B&#250;fals'), map: map }); Any ideas? Thanks.

    Read the article

  • Google map - How to escape charaters in the title of a marker in a google map?

    - by Anthony
    Say have this piece of code: var marker = new google.maps.Marker({ position: location, title: 'B&#250;fals', map: map }); This creates a marker as expected but if I hover the mouse over it I don’t see 'Búfals' as I would expect (instead I see the html code). This doesn't make any difference: var marker = new google.maps.Marker({ position: location, title: unescape('B&#250;fals'), map: map }); Any ideas? Thanks.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >