Search Results

Search found 322 results on 13 pages for 'escaped'.

Page 8/13 | < Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • jQuery encoding values differently than expected for jQuery.ajax data elements

    - by Adam Tuttle
    I'm using jQuery.ajax() to make a PUT request to a REST web service, but seeing some really strange serialization behavior. (Before you say it: Yes, I know that not all browsers support PUT -- this is just an example implementation for an api/framework, and ultimately will not be called by a browser, but rather by a server-side library that does support the extra http verbs.) Here's the form: <form action="/example/api/artist" method="put" id="update"> First Name: <input type="text" name="firstname" /><br/> Last Name: <input type="text" name="lastname" /><br/> Address: <input type="text" name="address" /><br/> City: <input type="text" name="city" /><br/> State: <input type="text" name="state" /><br/> Postal Code: <input type="text" name="postalcode" /><br/> Email: <input type="text" name="email" /><br/> Phone: <input type="text" name="phone" /><br/> Fax: <input type="text" name="fax" /><br/> Password: <input type="text" name="thepassword" /><br/> <input type="hidden" name="debug" value="true" /> <input type="submit" value="Update Artist" /> <input type="reset" value="Cancel" id="updateCancel" /> </form> And the JS: $("#update").submit(function(e){ e.preventDefault(); var frm = $(this); $.ajax({ url: frm.attr('action'), data:{ firstname: $("#update input[name=firstname]").val(), lastname: $("#update input[name=lastname]").val(), address: $("#update input[name=address]").val(), city: $("#update input[name=city]").val(), state: $("#update input[name=state]").val(), postalcode: $("#update input[name=postalcode]").val(), email: $("#update input[name=email]").val(), phone: $("#update input[name=phone]").val(), fax: $("#update input[name=fax]").val(), thepassword: $("#update input[name=thepassword]").val() }, type: frm.attr('method'), dataType: "json", contentType: "application/json", success: function (data, textStatus, xhr){ console.log(data); reloadData(); }, error: function (xhr, textStatus, err){ console.log(textStatus); console.log(err); } }); }); When using FireBug, I see the request go through as this: firstname=Austin&lastname=Weber&address=25463+Main+Street%2C+Suite+C&city=Berkeley&state=CA&postalcode=94707-4513&email=austin%40life.com&phone=555-513-4318&fax=510-513-4888&thepassword=nopolyes That's not horrible, but ideally I'd rather get %20 instead of + for spaces. I tried wrapping each field value lookup in an escape: firstname: escape($("#update input[name=firstname]").val()) But that makes things worse: firstname=Austin&lastname=Weber&address=25463%2520Main%2520Street%252C%2520Suite%2520C&city=Berkeley&state=CA&postalcode=94707-4513&email=austin%40life.com&phone=555-513-4318&fax=510-513-4888&thepassword=nopolyes In this case, the value is being escaped twice; so first the space is encoded to %20, and then the % sign is escaped to %25 resulting in the %2520 for spaces, and %252C for the comma in the address field. What am I doing wrong here?

    Read the article

  • Do there exist programming languages where a variable can truly know its own name?

    - by Job
    In PHP and Python one can iterate over the local variables and, if there is only once choice where the value matches, you could say that you know what the variable's name is, but this does not always work. Machine code does not have variable names. C compiles to assembly and does not have any native reflection capabilities, so it would not know it's name. (Edit: per Anton's answer the pre-processor can know the variable's name). Do there exist programming languages where a variable would know it's name? It gets tricky if you do something like b = a and b does not become a copy of a but a reference to the same place. EDIT: Why in the world would you want this? I can think of one example: error checking that can survive automatic refactoring. Consider this C# snippet: private void CheckEnumStr(string paramName, string paramValue) { if (paramName != "pony" && paramName != "horse") { string exceptionMessage = String.Format( "Unexpected value '{0}' of the parameter named '{1}'.", paramValue, paramName); throw new ArgumentException(exceptionMessage); } } ... CheckEnumStr("a", a); // Var 'a' does not know its name - this will not survive naive auto-refactoring There are other libraries provided by Microsoft and others that allow to check for errors (sorry the names have escaped me). I have seen one library which with the help of closures/lambdas can accomplish error checking that can survive refactoring, but it does not feel idiomatic. This would be one reason why I might want a language where a variable knows its name.

    Read the article

  • CodePlex Daily Summary for Friday, August 24, 2012

    CodePlex Daily Summary for Friday, August 24, 2012Popular ReleasesVisual Studio Team Foundation Server Branching and Merging Guide: v2 - Visual Studio 2012: Welcome to the Branching and Merging Guide Quality-Bar Details Documentation has been reviewed by Visual Studio ALM Rangers Documentation has been through an independent technical review Documentation has been reviewed by the quality and recording team All critical bugs have been resolved Known Issues / Bugs Spelling, grammar and content revisions are in progress. Hotfix will be published.Community TFS Build Extensions: August 2012: The August 2012 release contains VS2010 Activities(target .NET 4.0) VS2012 Activities (target .NET 4.5) Community TFS Build Manager VS2010 Community TFS Build Manager VS2012 Both the Community TFS Build Managers can also be found in the Visual Studio Gallery here where updates will first become available. Please note that we only intend to fix major bugs in the 2010 version and will concentrate our efforts on the 2012 version of the TFS Build Manager. At a high level, the following I...Microsoft Ajax Minifier: Microsoft Ajax Minifier 4.62: Fix for issue #18525 - escaped characters in CSS identifiers get double-escaped if the character immediately after the backslash is not normally allowed in an identifier. fixed symbol problem with nuget package. 4.62 should have nuget symbols available again.Game of Life 3D: GameOfLife3D Version 0.5.2: Support Windows 8nopCommerce. Open source shopping cart (ASP.NET MVC): nopcommerce 2.65: As some of you may know we were planning to release version 2.70 much later (the end of September). But today we have to release this intermediate version (2.65). It fixes a critical issue caused by a third-party assembly when running nopCommerce on a server with .NET 4.5 installed. No major features have been introduced with this release as our development efforts were focused on further enhancements and fixing bugs. To see the full list of fixes and changes please visit the release notes p...MyRouter (Virtual WiFi Router): MyRouter 1.2.9: . Fix: Some missing changes for fixing the window subclassing crash. · Fix: fixed bug when Run MyRouter at the first Time. · Fix: Log File · Fix: improve performance speed application · fix: solve some Exception.Smart Thread Pool: SmartThreadPool 2.2.2: Release Changes Added set name to threads Fixed the WorkItemsQueue.Dequeue. Replaced while(!Monitor.TryEnter(this)); with lock(this) { ... } Fixed SmartThreadPool.Pipe Added IsBackground option to threads Added ApartmentState to threads Fixed thread creation when queuing many work items at the same time.ZXing.Net: ZXing.Net 0.8.0.0: sync with rev. 2393 of the java version improved API, direct support for multiple barcode decoding, wrapper for barcode generating many other improvements and fixes encoder and decoder command line clients demo client for emguCV dev documentation startedScintillaNET: ScintillaNET 2.5.1: This release has been built from the 2.5 branch. Issues closed: Issue # Title 32524 32524 32550 32550 32552 32552 25148 25148 32449 32449 32551 32551 32711 32711 MFCMAPI: August 2012 Release: Build: 15.0.0.1035 Full release notes at SGriffin's blog. If you just want to run the MFCMAPI or MrMAPI, get the executables. If you want to debug them, get the symbol files and the source. The 64 bit builds will only work on a machine with Outlook 2010 64 bit installed. All other machines should use the 32 bit builds, regardless of the operating system. Facebook BadgeDocument.Editor: 2013.2: Whats new for Document.Editor 2013.2: New save as Html document Improved Traslate support Minor Bug Fix's, improvements and speed upsPulse: Pulse Beta 5: Whats new in this release? Well to start with we now have Wallbase.cc Authentication! so you can access favorites or NSFW. This version requires .NET 4.0, you probably already have it, but if you don't it's a free and easy download from Microsoft. Pulse can bet set to start on Windows startup now too. The Wallpaper setter has settings now, so you can change the background color of the desktop and the Picture Position (Tile/Center/Fill/etc...) I've switched to Windows Forms instead of WPF...Metro Paint: Metro Paint: Download it now , don't forget to give feedback to me at maitreyavyas@live.com or at my facebook page fb.com/maitreyavyas , Hope you enjoy it.Obelisk - WP7 & Windows 8 MVVM Persistence Library: Obelisk 2.2 Release: This release is built against code shared between WP7 and Windows 8. The setup project only contains the source for WP7, because I can't create an MSI in Windows 8 yet, so for Windows 8, use the source.MiniTwitter: 1.80: MiniTwitter 1.80 ???? ?? .NET Framework 4.5 ?????? ?? .NET Framework 4.5 ????????????? "&" ??????????????????? ???????????????????????? 2 ??????????? ReTweet ?????????????????、In reply to ?????????????? URL ???????????? ??????????????????????????????Droid Explorer: Droid Explorer 0.8.8.6 Beta: Device images are now pulled from DroidExplorer Cloud Service refined some issues with the usage statistics Added a method to get the first available value from a list of property names DroidExplorer.Configuration no longer depends on DroidExplorer.Core.UI (it is actually the other way now) fix to the bootstraper to only try to delete the SDK if it is a "local" sdk, not an existing. no longer support the "local" sdk, you must now select an existing SDK checks for sdk if it was ins...Path Copy Copy: 11.0.1: Bugfix release that corrects the following issue: 11365 If you are using Path Copy Copy in a network environment and use the UNC path commands, it is recommended that you upgrade to this version.ExtAspNet: ExtAspNet v3.1.9.1: +2012-08-18 v3.1.9 -??other/addtab.aspx???JS???BoundField??Tooltip???(Dennis_Liu)。 +??Window?GetShowReference???????????????(︶????、????、???、??~)。 -?????JavaScript?????,??????HTML????????。 -??HtmlNodeBuilder????????????????JavaScript??。 -??????WindowField、LinkButton、HyperLink????????????????????????????。 -???????????grid/griddynamiccolumns2.aspx(?????)。 -?????Type??Reset?????,??????????????????(e??)。 -?????????????????????。 -?????????int,short,double??????????(???)。 +?Window????Ge...Task Card Creator 2010: TaskCardCreator2010 4.0.2.0: What's New: UI/UX improved using a contextual ribbon tab for reports Finishing the "new 4.0 UI" Report template help improved New project branch to support TFS 2012: http://taskcardcreator2012.codeplex.com User interface made more modern (4.0.1.0) Smarter algorithm used for report generation (4.0.1.0) Quality setting added (4.0.1.0) Terms harmonized (4.0.1.0) Miscellaneous optimizations (4.0.1.0) Fixed critical issue introduced in 4.0.0.0 (4.0.1.0)SABnzbd for LCDSmartie: v 0.9.1: - Included right version of Newtonsoft.Json.dll in download No other changesNew ProjectsAnagramme: Jeu en réseau basé sur les anagrammes. Démonstraction technique utilisant WPF, WCF, WF, MEF et le pattern MVVM.ApplicationModel Framework: Ultra light WPF, MEF and MVVM enabled Framework.atfcard: atfcardCaribbean Cinemas: Crear una aplicación para Windows Phone 7.5 o superior, en la cual los usuarios puedan conocer cuales películas se encuentran actualmente en la cartelera.CiberSeguros: Este es un basico ABM usando una empresa de seguros como logica de negociosCLF 3.0: The SharePoint CLF 3.0 toolkit will allow departments and agencies to publish web sites that conform to the new Treasury Board of Canada Secretariat.CodeContrib: C# blog engine using ASP.NET MVC 4.DataGridView UserControl with Paging: this is user control of Windows form in C#. this user control is DatagridView with extended functionality of paging. diploma: ????JVM via COBOL: Sample programs in the isCOBOL dialect of object-aware and object-oriented COBOL, which focus on integrating functionality from the Java APIs into COBOL.MyEFamily: Client/Server software to remove the family from the Social Network and into the Family NetworkMyMVC3: My MVCOMR.Lib.Database - Lightweight WinRT InMemory Database: Lightweight in memory database with depended persistent source.OpenNETXC an unofficial port of the OpenXCPlatform Project to WinRT: An Unofficial WInRT port of the OpenXC Platform to WinRT see http://openxcplatform.com/PowerExtension: PowerExtension is an Open Source extension for Small Basic, a programming language. It adds file, networking, speech, and more!Project Webernet: Published: 8/23/2012ProjectManagementGenius: ????,???Proligence PowerShell VFS: The PowerShell VFS project is an implementation of a virtual file system for PowerShell providers. Using this library you can easily implement advanced PowerSheProxer.Me-Wrapper: Ein Wrapper für die Website Proxer.Me zum anschauen der Streams.Sharepoint Custom Recurrence Field: A recurrence field for SharePoint 2010 similar to the timer recurrence field in Central Admin.SharePoint Document Converter: SharePoint Document Converter solution gives a start on how we can leverage the Word automation Service to convert documents to formats that word can support. This project convert documents of type "docx" or "doc" to any possible file type that word support like to PDF, XPS, DOCX, DOCM, DOC, DOTX, DOTM, DOT, XML, RTF, MHT. This solution helps you to learn following things about SharePoint: - How document conversion happen using Word Automation Service - SharePoint Ribbon customization (H...Small Ticket System: Light CRM / Ticket System LightSwitch / Basic Features: Account/Contact/Contract Management Ticket System with Work History / Notes / TasksSQL Server Keep Alive Service: What is this? A Windows Service that will test if your SQL Server is up and running and writes the status to the Windows EventlogTeamBoard: A team build server displayTest Foreign Vocabulary: Tool helping to learn foreign vocabulary. You import Excel file which contains the vocabulary list and after, you yourself test with tool.testdd08232012git01: sdtesttfs08232012tfs01: sdTFS Kurs 2012: Dette er et undervisningsprosjekt til bruk i Mesaninen 2012. thenewcat: ffffffffffffffvvvvTriviaGame: a trivia game using wcf wpf technologiesUltra Urban: Ultra Urban is a 3d simcity-like game framework written in C# and XNA. It's going to provide some open interfaces for further city simulationUniversity Scheduler: University SchedulerVisual Studio Solution Export Import Addin: Usually we need to share visual studio projects. We take the source code and create zip file and share location with others. If project is not clean then share size will be more. Above manual process can be automated inside visual studio. if we have an add-in to do the same. I have created an addin for Visual Studio 2010 with that all the above manual tasks can be automated. Source code is provided as it is. So you can extend to develop same for other versions of visual studios. Cheers!...Whisper.Web.Providers: Custom web providers by whisper.Including CustomMembershipProvider ,CustomRoleProvider and Sqlserver version(SqlMembershipProvider,SqlRoleProvider).Windows Azure Storage Metrics Client Library: A library of .NET classes useful for the client (consumer) side of Windows Azure Storage Metrics and Windows Azure Diagnostics.WPF Prism Starter Kit: The goal of this project is to deliver a partitioned project skeleton to use prism with WPF.

    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

  • TSQL Query: Escaping Special Characters

    - by Abs
    Hello all, I am trying to escape special characters in a TSQL query. I have done this before: SELECT columns FROM table WHERE column LIKE '%\%%' ESCAPE '\' And it has worked. Now I have tried to do this now: UPDATE match SET rule_name='31' ESCAPE '\' But it has failed. I know none of the vlaues have a \ but it should still work. I am guessing its because it needs a LIKE statement but how else can I escape characters that I am adding to a database? In addition, does anyone have a link to all the special characters that should be escaped, I couldn't find any documentation on this! Thanks all for any help

    Read the article

  • Include OpenX ad in a jquery-ui dialog?

    - by planetclaire
    I'm loading some content into a jquery-ui dialog via .ajax. That's all working fine but now I've been given an OpenX ad to embed into the dialog & can't figure out how to do it. I know all the script is stripped when coming in via ajax, & I know how to use $.getScript to load .js files for use in the dialog, but the OpenX ad script I've got uses document.write so I think it's expecting to be embedded inline into the desired position on the page. I've tried appending the escaped script string into the div on ajax success of the main content as below, but this results in the page being redirected to a page with just the ad on it. Attempt shown below: $("#" + idHelpPage).find(".adScript").append("<script type='text/javascript'>var m3_u = (location.protocol=='https:'?'https://d1.openx.org/ajs.php':'http://d1.openx.org/ajs.php');var m3_r = ... etc etc I'm ok with jquery but not great with javascript, would really appreciate any help! Also if you want to see any other code.

    Read the article

  • How to escape HAML for Javascript in Sinatra

    - by viatropos
    I would like to return a list/combobox from an ajax request ("Which on of these do you like?" type thing). I would like to write that little snippet in HAML, which converts it to HTML, but when I do, the page goes blank. I'm assuming this is because the HTML isn't escaped. Is there a way to escape HAML so I can do $("#mydiv").html(response);? Here's the method: post "/something" do # process... haml :"partials/_select", :layout => false, :locals => {:collection => choices} end ... the haml template: %select - collection.each do |item| %option{:value => item.to_s}= item.to_s ... and the javascript: success: function(responseText, statusText, xhr, $form) { $(".dialog_content").append(responseText); } I have tried the sinatra_more plugin and the escape_javascript method, but there's problems with the haml buffer in sinatra. Any ideas?

    Read the article

  • Delphi 10, .NET, how do I convert a hex UTF-8 string to its unicode character?

    - by Evan V.
    Hi all, I am trying to make my web app compatible with international languages and I am stuck with trying to convert escaped characters in my Delphi .NET DLL. The front end code is passing the UTF-8 hex notation with an escape character e.g for ? I pass \uE3818A. In my DLL I capture this and constract the following string '$E3828A'. I need to convert this back to ? and send it to my database, I've been trying to use Encoding.UTF8.GetBytes and Encoding.UTF8.GetString but with no luck. Anyone could help me figure this out? Thank you.

    Read the article

  • How Do I Prevent a XSS Cross-Site Scripting Attack When Using jQueryUI Autocomplete

    - by theschmitzer
    I am checking for XSS vulnerabilities in a web application I am developing. This Rails app uses the h method to sanitize HTML it generates. It does, however, make use of the jQueryUI autocomplete widget (new in latest release), where I don't have control over the generated HTML, and I see tags are not getting escaped there. The data fed to autocomplete is retrieved through a JSON request immediately before display. I Possibilities: 1) Autocomplete has an option to sanitize I don't know about 2) There is an easy way to do this in jQuery I don't know about 3) There is an easy way to do this in a Rails controller I don't know about (where I can't use the h method) 4) Disallow < symbol in the model Sugestions?

    Read the article

  • excel import query error

    - by pmms
    mysql_connect("localhost","root",""); mysql_select_db("hitnrunf_db"); $result=mysql_query("select * from jos_users INTO OUTFILE 'users.csv' FIELDS ESCAPED BY '""' TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' "); header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=your_desired_name.xls"); header("Content-Transfer-Encoding: binary"); header("Pragma: no-cache"); header("Expires: 0"); print "$header\n$data"; in the above code in query string i.e string in side mysql_quey we are getting following error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\samples\mysql_excel\exel_outfile.php on line 8 in query string '\n' charter is not identifying as string thats why above error getting

    Read the article

  • Splitting a string according to a delimiter when elements in the string can contain the delimiter

    - by Vivin Paliath
    I have a string that looks like this: "#Text() #SomeMoreText() #TextThatContainsDelimiter(#blah) #SomethingElse()" I'd like to get back [#Text(), #SomeMoreText(), #TextThatContainsDelimiter(#blah), #SomethingElse()] One way I thought about doing this was to require that the # to be escaped into \#, which makes the input string: "#Text() #SomeMoreText() #TextThatContainsDelimiter(\#blah) #SomethingElse()" I can then split it using /[^\\]#/ which gives me: [#Text(), SomeMoreText, TextThatContainsDelimiter(\#blah), SomethingElse()] The first element will contain # but I can strip it out. However, is there a cleaner way to do this without having to escape the #, and which ensures that the first element will not contain a #? Basically I'd like it to split by # only if the # is not enclosed by parentheses. My hunch is that since the # is context-sensitive and and regular expressions are only suited for context-free strings, this may not be the right tool. If so, would I have to write a grammar for this and roll my own parser/lexer?

    Read the article

  • checking last char of string in c

    - by radar75
    If I have two types of strings as: const char *str1 = "This is a string with \"quotes escaped at the end\""; const char *str2 = "This is a \"string\" without quotes at the end"; testFn(str1); testFn(str2); int testFn(char *str) { // test & return 1 if ends on no quote // test & return 0 if ends on quote return; } I would like to test if the string ends with a quote " or not What would be a good way of testing this? Thanks

    Read the article

  • .NET PostSubmitter sends backslashes

    - by Stefan N.
    Hi, I'm using C# to send JSON to a PHP-Script, like this: string json = "{"; json += "\"prop\":\"some text\""; json += "}"; PostSubmitter post = new PostSubmitter(); post.Url = "http://localhost/synch/notein.php"; post.Type = PostSubmitter.PostTypeEnum.Post; post.PostItems.Add("note", json); post.Post(); Of course I'll have to escape the inner quotes, but they get sended to the script! To make things worse: There is text, which already has quotation marks, so those must be escaped to be valid JSON. In this case I want the backslashes to be transmitted. Any idea to accomplish this?

    Read the article

  • Mysql Real Escape String PHP Function Adding "\" to My Field Entry

    - by Jascha
    Hello, I am submitting a form to my mySql database using PHP. I am sending the form data through the mysql_real_escape_string($content); function. When the entry shows up in my database (checking in myPhpAdmin) all of my double quotes and single quotes are escaped. I'm fairly certain this is a PHP configuration issue? so: $content = 'Hi, my name is Jascha and my "favorite" thing to do is sleep'; mysql_real_escape_string($content); $query = 'INSERT INTO DB...' comes up in my database as: Hi, my name is Jascha and my \"favorite" thing to do is sleep Who do I tell what to do? (I cannot access the php.ini). -J

    Read the article

  • Log to rolling CSV file with Enterprise Library

    - by Tinminator
    Need logging to: Rolling file, to avoid 1 big log file. CSV format for easier look up. I can see EntLib (5.0) have Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener to log to rolling log file. To make the log entries look like a CSV row, I can change the Logging.Formatters.TextFormatter.Template to put double quote around the values. Also change the Listener's Footer and Header to nothing, so they won't be output. Under normal circumstance, this would give me a well formed CSV file. However if a token value in the Template contain double quote, this would not be escaped, hence the log file become an invalid CSV file. Is there any way to resolve this? Is there any alternative solutions to this problem?

    Read the article

  • How do I set ORDER BY params using prepated PDO statement?

    - by Marlorn
    I'm having problems using params in the ORDER BY section of my SQL. It doesn't issue any warnings, but prints out nothing. $order = 'columnName'; $direction = 'ASC'; $stmt = $db->prepare("SELECT field from table WHERE column = :my_param ORDER BY :order :direction"); $stmt->bindParam(':my_param', $is_live, PDO::PARAM_STR); $stmt->bindParam(':order', $order, PDO::PARAM_STR); $stmt->bindParam(':direction', $direction, PDO::PARAM_STR); $stmt->execute(); The :my_param works, but not :order or :direction. Is it not being internally escaped correctly? Am I stuck inserting it directly in the SQL? Like so: $order = 'columnName'; $direction = 'ASC'; $stmt = $db->prepare("SELECT * from table WHERE is_live = :is_live ORDER BY $order $direction"); Is there a PDO::PARAM_COLUMN_NAME constant or some equivalent? Thanks!

    Read the article

  • Markup filter wanted for a public website

    - by sibidiba
    Developing a community site where everyone can post text, I'm looking for a markup filter: What is not part of the markup must be escaped (htmlspecialchars()) as it is. Should turn URL-s automatically into links Should support some form of basic markups (bold, image, url, pre, list) Should have a simple parser, that turns user input text into HTML Content on the site is public to everyone, XSS must not allowed to happen. What do you suggest? What markup language in the first place? BBCode? Wiki? Markdown? Are there any complete API-s with good examples? PHP is available on the server side. If there is a WYSIWYG-like texarea in addition (like here on SO) that would be a fantastic bonus!

    Read the article

  • SSIS web service task parsing result.

    - by dbengals
    I have an ssis (2005) package that uses the web service task to download to a file destination. The file contains a string of xml data. After downloaded the file looks like this. <?xml version="1.0" encoding="utf-16"?> <string>--here is XML data with escaped characters--</string> My thought was I could then use the XML source data flow source to pull the <string> data, but when I set this up the XML source will not read the <string> as a column. It will generate an xsd and it seems normal, but no luck seeing the column. Any ideas on getting this to work? Or would there be a better way to pull the data within the file generated from the web service? Thanks.

    Read the article

  • Is 'second' a keyword in mysql full-text searches?

    - by Larry
    I have a simple MySQL table that is setup for full text search. | id | title | ---------------------- | 1 | test event | | 2 | Second test | | 3 | Larry's event | | 4 | this second | When I use the query: SELECT * FROM EVENTS WHERE MATCH (title) AGAINST ('test event' IN BOOLEAN MODE); I get back 3 rows; the ones containing 'test event', 'Second test', and 'Larry's Event'. Now If I run the following query: SELECT * FROM EVENTS WHERE MATCH (title) AGAINST ('second' IN BOOLEAN MODE); Nothing is returned... strange? Lastly, if I run the query: SELECT * FROM EVENTS WHERE MATCH (title) AGAINST ('second test' IN BOOLEAN MODE); I get back 2 rows; the ones containing 'test event' and 'Second test'. I appears that the word 'second' cannot be searched or needs to be escaped somehow. Am I missing something?

    Read the article

  • Django date filter: how come the format used is different from the one in datetime library ???

    - by Sébastien Piquemal
    Hello ! For formatting a date using date filter you must use the following format : {{ my_date|date:"Y-m-d" }} If you use strftime from the standard datetime, you have to use the following : my_date.strftime("%Y-%m-%d") So my question is ... isn't it ugly (I guess it is because of the % that is used also for tags, and therefore is escaped or something) ? But that's not the main question ... I would like to use the same DATE_FORMAT parametrized in settings.py all over the project, but it therefore seems that I cannot ! Is there a work around (for example a filter that removes the % after the date has been formatted like {{ my_date|date|dream_filter }}, because if I just use DATE_FORMAT = "%Y-%m-%d" I got something like %2001-%6-%12)?

    Read the article

  • Import and Export for CSV are both broken in Mathematica

    - by dreeves
    Consider the following 2 by 2 array: x = {{"a b c", "1,2,3"}, {"i \"comma-heart\" you", "i \",heart\" u, too"}} If we Export that to CSV and then Import it again we don't get the same thing back: Import[Export["tmp.csv", d]] Looking at tmp.csv it's clear that the Export didn't work, since the quotes are not escaped properly. According to the RFC which I presume is summarized correctly on Wikipedia's entry on CSV, the right way to export the above array is as follows: a b c, "1,2,3" "i ""heart"" you", "i "",heart"" u, too" Importing the above does not yield the original array either. So Import is broken as well. I've reported these bugs to [email protected] but I'm wondering if others have workarounds in the meantime. One workaround is to just use TSV instead of CSV. I tested the above with TSV and it seems to work (even with tabs embedded in the entries of the array).

    Read the article

  • How can I render a Batik SVG Java object in the view portion of a Spring MVC application?

    - by mattblang
    I am creating and manipulating a SVGOMDocument object in a controller method. How can I render this object in a JSP view? I get very close with the following controller method and <object> tag. @RequestMapping(value = "/seal") public ResponseEntity<SVGDocument> createSeal() throws IOException { InputStream file = new ClassPathResource("seal.svg").getInputStream(); String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory factory = new SAXSVGDocumentFactory(parser); SVGDocument svg = (SVGDocument) factory.createDocument("http://www.w3.org/2000/svg", file); svg.getElementById("name").getFirstChild().setNodeValue("a test name"); return new ResponseEntity<SVGDocument>(svg, HttpStatus.OK); } <object data="/seal" type="image/svg+xml"></object> This displays a string of XML that is a SVG. The string is in quotes with every XML quote escaped.

    Read the article

  • Encode JSON data into another JSON object

    - by jburns20
    I have a JSON string that I would like to include as a value in a larger JSON object that I am creating from an array. How can I create the larger JSON object without php escaping the string, and without having to decode the previously encoded string? For example, if my JSON string is: $encoded_already = '{"encoded_key": "encoded_value"}'; And I would like to include it in my array and json_encode() it: $new_array = array( "some_other_key" => $some_value, "premade_data" => $encoded_already ); $output = json_encode($new_array); but I want to have the $encoded_already string be included as actual JSON, not just an escaped string.

    Read the article

  • How to preserve hyperlink when submitting via php form into MySQL

    - by TheTub
    Hi All, I've created a form that stores free text fields into a MySQL database. All works fine and the data is displayed back as intended when viewed. Except for one niggle. In an attempt to prevent malicious attacks I have used mysql_real_escape_string to remove any unwanted code from the input. However, I need to be able to preserve hyperlinks and basic html. For example, I want to store the following: <p align="left">Please follow this <a href="link.html">link</a></p> But the link is being stored as \"link.html\" as the quotes are being escaped. How can I preserve this link and other html? Many thank TT

    Read the article

  • Syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in PHP

    - by pmms
    mysql_connect("localhost","root",""); mysql_select_db("hitnrunf_db"); $result=mysql_query("select * from jos_users INTO OUTFILE 'users.csv' FIELDS ESCAPED BY '""' TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n' "); header("Content-type: text/plain"); header("Content-Disposition: attachment; filename=your_desired_name.xls"); header("Content-Transfer-Encoding: binary"); header("Pragma: no-cache"); header("Expires: 0"); print "$header\n$data"; in the above code in query string i.e string in side mysql_quey we are getting following error Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\samples\mysql_excel\exel_outfile.php on line 8 in query string '\n' charter is not identifying as string thats why above error getting

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13  | Next Page >