/
com.bobby-tables.po
1658 lines (1429 loc) · 44 KB
/
com.bobby-tables.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Russian localization file for bobby-tables.com
# Copyright (C) 2008-2012 Andy Lester <andy@petdance.com>
# This site's content is available under the Creative Commons Attribution-ShareAlike 3.0 License.
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2012-05-01 07:25-0600\n"
"Last-Translator: Andy Lester <andy@petdance.com>\n"
"Language-Team: Russian\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
#: crank.pl:30
msgid "Home"
msgstr ""
#: crank.pl:31
msgid "Translations"
msgstr ""
#: crank.pl:32
msgid "About"
msgstr ""
#: s/about.md.tt2:1
msgid "# About Bobby Tables and SQL injection"
msgstr ""
#: s/about.md.tt2:3
msgid "# Why did Bobby's school lose their records?"
msgstr "# Почему в школе Роберта потеряли базу учеников?"
#: s/about.md.tt2:5
msgid ""
"The school apparently stores the names of their students in a table called "
"Students. When a new student arrives, the school inserts his/her name into "
"this table. The code doing the insertion might look as follows:"
msgstr ""
"Очевидно, записи обо всех учениках в школе хранятся в таблице с названием "
"Students. Когда приходит новый ученик, в таблицу вставляется новая запись с "
"его именем. Код вставки может выглядеть так:"
#: s/about.md.tt2:7
msgid ""
" $sql = \"INSERT INTO Students (Name) VALUES ('\" . $studentName . \"');"
"\";\n"
" execute_sql($sql);"
msgstr ""
#: s/about.md.tt2:10
msgid ""
"The first line creates a string containing an SQL INSERT statement. The "
"content of the `$studentName` variable is glued into the SQL statement. The "
"second line sends the resulting SQL statement to the database. The pitfall "
"of this code is that outside data, in this case the content of `"
"$studentName`, becomes part of the SQL statement."
msgstr ""
#: s/about.md.tt2:12
msgid ""
"First let's see what the SQL statement looks like if we insert a student "
"named John:"
msgstr ""
#: s/about.md.tt2:14
msgid " INSERT INTO Students (Name) VALUES ('John');"
msgstr ""
#: s/about.md.tt2:16
msgid ""
"This does exactly what we want: it inserts John into the Students table."
msgstr ""
#: s/about.md.tt2:18
msgid ""
"Now we insert little Bobby Tables, by setting `$studentName` to `Robert'); "
"DROP TABLE Students;--`. The SQL statement becomes:"
msgstr ""
#: s/about.md.tt2:20
msgid ""
" INSERT INTO Students (Name) VALUES ('Robert'); DROP TABLE Students;--');"
msgstr ""
#: s/about.md.tt2:22
msgid ""
"This inserts Robert into the Students table. However, the INSERT statement "
"is now followed by a DROP TABLE statement which removes the entire Students "
"table. Ouch!"
msgstr ""
#: s/about.md.tt2:24
msgid ""
"\n"
"# How to avoid Bobby Tables"
msgstr ""
#: s/about.md.tt2:27
msgid "There is only one way to avoid Bobby Tables attacks"
msgstr ""
#: s/about.md.tt2:29
msgid ""
"* Do not create SQL statements that include outside data.\n"
"* Use parameterized SQL calls."
msgstr ""
#: s/about.md.tt2:32
msgid ""
"That's it. Don't try to escape invalid characters. Don't try to do it "
"yourself. Learn how to use parameterized statements. Always, every single "
"time."
msgstr ""
#: s/about.md.tt2:34
msgid ""
"The strip gets one thing crucially wrong. The answer is not to \"sanitize "
"your database inputs\" yourself. It is prone to error.\n"
msgstr ""
#: s/asp.md.tt2:1
msgid ""
"ASP\n"
"==="
msgstr ""
#: s/asp.md.tt2:4
msgid "Older ASP uses positional placeholders."
msgstr "В ASP используются метки в качестве значений параметров."
#: s/asp.md.tt2:6
msgid ""
" objCmd.CommandType = adCmdText;\n"
" objCmd.CommandText = \"UPDATE members SET photo = ? WHERE memberID = ?"
"\";\n"
" objCmd.Parameters.Append(objCmd.CreateParameter(\"filename\", adVarChar, "
"adParamInput, 510, fileName));\n"
" objCmd.Parameters.Append(objCmd.CreateParameter(\"memberID\", adInteger, "
"adParamInput, 4, memberid ));\n"
" objCmd.Execute(adExecuteNoRecords);"
msgstr ""
#: s/asp.md.tt2:12
msgid ""
"\n"
"Newer ASP (ASP.Net?) can handle named placeholders."
msgstr ""
"\n"
"В ASP.NET поддерживаются именованные параметры."
#: s/asp.md.tt2:15
msgid ""
" objCmd.CommandType = adCmdText;\n"
" objCmd.CommandText = \"UPDATE members SET photo = @filename WHERE "
"memberID = @memberID\";\n"
" objCmd.Parameters.Append(objCmd.CreateParameter(\"@memberID\", "
"adInteger, adParamInput, 4, memberid ));\n"
" objCmd.Parameters.Append(objCmd.CreateParameter(\"@filename\", "
"adVarChar, adParamInput, 510, fileName));\n"
" objCmd.Execute(adExecuteNoRecords);\n"
" gblDelobjParams(objCmd);"
msgstr ""
#: s/asp.md.tt2:22 s/dotnet.md.tt2:13 s/perl.md.tt2:43 s/ruby.md.tt2:15
#: s/scheme.md.tt2:15
msgid ""
"To do\n"
"-----"
msgstr ""
"Список дел\n"
"-----"
#: s/asp.md.tt2:25
msgid "Add some narrative\n"
msgstr "Добавить больше материала\n"
#: s/coldfusion.md.tt2:1
msgid ""
"ColdFusion\n"
"=========="
msgstr ""
#: s/coldfusion.md.tt2:4
msgid ""
"In ColdFusion there is a tag called `cfqueryparam` that should be used "
"whenever writing inline queries."
msgstr ""
"В ColdFusion есть тег `cfqueryparam`, который всегда нужно использовать во "
"встроенных запросах."
#: s/coldfusion.md.tt2:6
msgid ""
" <cfquery name=\"queryTest\">\n"
" SELECT FirstName, LastName, Phone\n"
" FROM tblUser\n"
" WHERE Status =\n"
" <cfqueryparam cfsqltype=\"CF_SQL_VARCHAR\" value=\"#form.status#\">\n"
" </cfquery>"
msgstr ""
#: s/coldfusion.md.tt2:13
msgid ""
"\n"
"Stored procedures can be invoked with the `cfstoredproc` and `cfprocparam` "
"tags."
msgstr ""
"\n"
"Хранимые процедуры также могут вызываться с тегами `cfstoredproc` и "
"`cfprocparam`."
#: s/coldfusion.md.tt2:16
msgid ""
"Recent versions of ColdFusion provide a set of functions to run queries "
"that\n"
"have a slightly different syntax, but still provide parameterized queries."
msgstr ""
"Последние версии ColdFusion предоставляют набор функций для выполнения "
"запросов,\n"
"которые имеют немного другой синтаксис, но по-прежнему позволяют "
"параметризовать запрос."
#: s/coldfusion.md.tt2:19
msgid ""
"\n"
" <cfscript>\n"
" var myQuery = new Query(sql=\"\n"
" SELECT FirstName, LastName, Phone\n"
" FROM tblUser\n"
" WHERE Status = :status\n"
" \");\n"
" myQuery.addParam(\n"
" name = \"status\",\n"
" value = form.status,\n"
" cfsqltype = \"cf_sql_varchar\"\n"
" );\n"
" var rawQuery = myQuery.execute().getResult();\n"
" </cfscript>"
msgstr ""
#: s/csharp.md.tt2:1
msgid ""
"C\\#\n"
"==="
msgstr ""
#: s/csharp.md.tt2:4
msgid ""
"From the [C# Online](http://en.csharp-online.net/) wiki page [ASP.NET "
"Security Hacks--Avoiding SQL Injection](http://en.csharp-online.net/ASP."
"NET_Security_Hacks%E2%80%94Avoiding_SQL_Injection)"
msgstr ""
#: s/csharp.md.tt2:6
msgid ""
"\n"
" SqlCommand userInfoQuery = new SqlCommand(\n"
" \"SELECT id, name, email FROM users WHERE id = @UserName\",\n"
" someSqlConnection);"
msgstr ""
#: s/csharp.md.tt2:11
msgid ""
" SqlParameter userNameParam = userInfoQuery.Parameters.Add(\"@UserName"
"\",\n"
" SqlDbType.VarChar, 25 /* max length of field */ );"
msgstr ""
#: s/csharp.md.tt2:14
#, fuzzy
msgid ""
" // userName is some string valued user input variable\n"
" userNameParam.Value = userName;"
msgstr ""
" // username — это строка, которую ввел пользователь\n"
" usernameparam.value = username;"
#: s/csharp.md.tt2:17
msgid "Or simpler:"
msgstr "Или проще:"
#: s/csharp.md.tt2:19
msgid ""
"\n"
" String username = \"joe.bloggs\";\n"
" SqlCommand sqlQuery = new SqlCommand(\"SELECT user_id, first_name,"
"last_name FROM users WHERE username = ?username\", sqlConnection);\n"
" sqlQuery.Parameters.AddWithValue(\"?username\", username);\n"
msgstr ""
#: s/delphi.md.tt2:1
msgid ""
"Delphi\n"
"======"
msgstr ""
#: s/delphi.md.tt2:4
msgid "To use a prepared statement, do something like this:"
msgstr "Пример использования подготовленных выражений:"
#: s/delphi.md.tt2:6
msgid ""
" query.SQL.Text := 'update people set name=:Name where id=:ID';\n"
" query.Prepare;\n"
" query.ParamByName( 'Name' ).AsString := name;\n"
" query.ParamByName( 'ID' ).AsInteger := id;\n"
" query.ExecSQL;\n"
msgstr ""
#: s/dotnet.md.tt2:1
msgid ""
".NET\n"
"===="
msgstr ""
#: s/dotnet.md.tt2:4
msgid "Reference:"
msgstr "Ссылки:"
#: s/dotnet.md.tt2:6
msgid ""
"- [SqlCommand.Prepare](http://msdn.microsoft.com/en-us/library/system."
"data.sqlclient.sqlcommand.prepare.aspx) in the .NET Framework Class Library"
msgstr ""
#: s/dotnet.md.tt2:8
msgid "Articles:"
msgstr "Статьи:"
#: s/dotnet.md.tt2:10
msgid ""
"- [SQL injection](http://msdn.microsoft.com/en-us/library/ms161953.aspx) "
"on MSDN\n"
"- [SQL Injection and how to avoid it](http://blogs.msdn.com/tom/"
"archive/2008/05/29/sql-injection-and-how-to-avoid-it.aspx) on the ASP.NET "
"Debugging blog"
msgstr ""
#: s/dotnet.md.tt2:16
msgid ""
"- Add some narrative\n"
"- Show code examples\n"
msgstr ""
#: s/index.md.tt2:1
msgid ""
"Who is Bobby Tables?\n"
"===================="
msgstr ""
"Кто такой Робин-Брось-Таблицу?\")\n"
"===================="
#: s/index.md.tt2:4
msgid "[From the webcomic _xkcd_](http://xkcd.com/327/)"
msgstr "[Из комикса _xkcd_](http://xkcd.ru/327/)"
#: s/index.md.tt2:6
msgid ""
"<a href=\"http://xkcd.com/327/\"><img src=\"/img/xkcd.png\" alt=\"xkcd Bobby "
"Tables Cartoon\" height=\"205\" width=\"666\" /></a>"
msgstr ""
#: s/index.md.tt2:8
msgid "<br clear=\"right\">"
msgstr ""
#: s/index.md.tt2:10
msgid ""
"**School**: Hi, this is your son's school. We're having some computer "
"trouble."
msgstr ""
"**Школа**: Здравствуйте, это из школы, где учится ваш сын. У нас тут "
"неприятности с компьютером."
#: s/index.md.tt2:12
msgid "**Mom**: Oh, dear -- Did he break something?"
msgstr "**Мама**: О, боже. Он что-то сломал?"
#: s/index.md.tt2:14
msgid ""
"**School**: In a way. Did you really name your son `Robert'); DROP TABLE "
"Students;--`?"
msgstr ""
"**Школа**: Можно сказать... Вы действительно назвали своего сына Роберт'); "
"DROP TABLE Students;--?"
#: s/index.md.tt2:16
msgid "**Mom**: Oh. Yes. Little Bobby Tables we call him."
msgstr "**Мама**: А, да. Дома мы его зовем Робин-Брось-Таблицу."
#: s/index.md.tt2:18
msgid ""
"**School**: Well, we've lost this year's student records. I hope you're "
"happy."
msgstr ""
"**Мама**: А я надеюсь, что это научит вас экранировать символы во входных "
"данных."
#: s/index.md.tt2:20
msgid "**Mom**: And I hope you've learned to sanitize your database inputs."
msgstr ""
#: s/index.md.tt2:24
msgid ""
"Examples\n"
"========"
msgstr ""
#: s/index.md.tt2:27
msgid "See the sidebar to the left for your specific language."
msgstr ""
#: s/index.md.tt2:29
msgid ""
"Other random resources\n"
"======================"
msgstr ""
#: s/index.md.tt2:32
msgid ""
"* [SQL Injection Myths and Fallacies](http://www.slideshare.net/billkarwin/"
"sql-injection-myths-and-fallacies)\n"
"* [How to Write Injection-Proof SQL](http://www.schneier.com/blog/"
"archives/2008/10/how_to_write_in.html)\n"
"* [Defending Against SQL Injection Attacks](http://download.oracle.com/oll/"
"tutorials/SQLInjection/index.htm)"
msgstr ""
#: s/index.md.tt2:36
msgid ""
"Patches welcome\n"
"==============="
msgstr ""
#: s/index.md.tt2:39
msgid ""
"Don't see a language that you'd like to see represented? Please let me know "
"if you have updates or additions through one of these methods, in decreasing "
"order of preference."
msgstr ""
#: s/index.md.tt2:41
msgid ""
"* Fork the [bobby-tables repository at github](http://github.com/petdance/"
"bobby-tables), make your changes, and send me a pull request.\n"
"* Add an issue in the [issue tracker](http://github.com/petdance/bobby-"
"tables/issues).\n"
"* Email me, Andy Lester, at andy at petdance.com."
msgstr ""
#: s/index.md.tt2:45
msgid ""
"Translations also welcome\n"
"========================="
msgstr ""
#: s/index.md.tt2:48
msgid ""
"Help translate this site! There are less than 200 phrases. No programming "
"necessary."
msgstr ""
#: s/index.md.tt2:50
msgid ""
"See the instructions at the [bobby-tables repository at github](http://"
"github.com/petdance/bobby-tables#readme)."
msgstr ""
#: s/index.md.tt2:52
msgid ""
"To do\n"
"====="
msgstr ""
#: s/index.md.tt2:55
msgid ""
"* Explain why creating code from outside data is bad.\n"
"* Potential speed win when reusing prepared statements."
msgstr ""
#: s/index.md.tt2:58
msgid ""
"Thanks\n"
"======"
msgstr ""
#: s/index.md.tt2:61
msgid "Thanks to the following folks for their contributions:"
msgstr ""
#: s/index.md.tt2:63
msgid ""
"* [Kim Christensen](http://www.smukkekim.dk)\n"
"* Kirk Kimmel\n"
"* Nathan Mahdavi\n"
"* [Hannes Hofmann](http://www5.informatik.uni-erlangen.de/en/our-team/"
"hofmann-hannes)\n"
"* [Mike Angstadt](http://www.mangst.com)\n"
"* [Peter Ward](http://identi.ca/flowblok/)\n"
"* [David Wheeler](http://justatheory.com)\n"
"* Scott Rose\n"
"* Erik Osheim\n"
"* Russ Sivak\n"
"* [Iain Collins](http://iaincollins.com)\n"
"* Kristoffer Sall Hansen\n"
"* Jeff Emminger\n"
"* [Travis Swicegood](http://www.travisswicegood.com/)\n"
"* [Will Coleda](http://www.coleda.com/users/coke/)\n"
"* Kai Baesler\n"
"* Mike Markley\n"
"* [Michael Schwern](http://schwern.net/)\n"
"* [Jeana Clark](http://jeanaclark.org/)\n"
"* [Lars Dɪᴇᴄᴋᴏᴡ](http://search.cpan.org/~daxim/)\n"
"* [Jani Hur](http://www.jani-hur.net)\n"
"* [Sven van Haastregt](http://www.liacs.nl/home/svhaastr/)\n"
msgstr ""
#: s/java.md.tt2:1
msgid ""
"Java\n"
"===="
msgstr ""
#: s/java.md.tt2:4
msgid ""
"JDBC\n"
"----"
msgstr ""
#: s/java.md.tt2:7
msgid ""
"The [JDBC API](http://download.oracle.com/javase/tutorial/jdbc/index.html)\n"
"has a class called\n"
"[`PreparedStatement`](http://download.oracle.com/javase/6/docs/api/java/sql/"
"PreparedStatement.html)\n"
"which allows the programmer to safely insert user-supplied data\n"
"into a SQL query. The location of each input value in the query\n"
"string is marked with a question mark. The various `set*()` methods\n"
"are then used to safely perform the insertion."
msgstr ""
#: s/java.md.tt2:15
msgid ""
" String name = //user input\n"
" int age = //user input\n"
" Connection connection = DriverManager.getConnection(...);\n"
" PreparedStatement statement = connection.prepareStatement(\n"
" \"SELECT * FROM people WHERE lastName = ? AND age > ?\" );\n"
" statement.setString(1, name); //lastName is a VARCHAR\n"
" statement.setInt(2, age); //age is an INT\n"
" ResultSet rs = statement.executeQuery();\n"
" while (rs.next()){\n"
" //...\n"
" }"
msgstr ""
#: s/java.md.tt2:27
msgid ""
"\n"
"Once a `PreparedStatement` object has been created, it can be reused\n"
"multiple times for multiple queries (for example, when using the\n"
"same query to update multiple rows in a table). However, they are\n"
"**not thread-safe** because of the many method calls involved in\n"
"setting the parameters and executing the query. Therefore, you\n"
"should only define `PreparedStatement` objects as method-level\n"
"variables (as opposed to class-level variables) to avoid concurrency\n"
"issues."
msgstr ""
#: s/java.md.tt2:37
msgid ""
" List<Person>; people = //user input\n"
" Connection connection = DriverManager.getConnection(...);\n"
" connection.setAutoCommit(false);\n"
" try {\n"
" PreparedStatement statement = connection.prepareStatement(\n"
" \"UPDATE people SET lastName = ?, age = ? WHERE id = ?\");\n"
" for (Person person : people){\n"
" statement.setString(1, person.getLastName());\n"
" statement.setInt(2, person.getAge());\n"
" statement.setInt(3, person.getId());\n"
" statement.execute();\n"
" }\n"
" connection.commit();\n"
" } catch (SQLException e) {\n"
" connection.rollback();\n"
" }"
msgstr ""
#: s/java.md.tt2:54
msgid ""
"More information on `PreparedStatement` can be found in the\n"
"[Oracle JDBC tutorial](http://download.oracle.com/javase/tutorial/jdbc/"
"basics/prepared.html)."
msgstr ""
#: s/java.md.tt2:57
msgid ""
"Hibernate\n"
"---------"
msgstr ""
#: s/java.md.tt2:60
msgid ""
"[Hibernate](http://www.hibernate.org/) uses named parameters to\n"
"safely insert data into a query. A named parameter consists of a\n"
"colon, followed by a unique name for the parameter."
msgstr ""
#: s/java.md.tt2:64
msgid ""
" String name = //user input\n"
" int age = //user input\n"
" Session session = //...\n"
" Query query = session.createQuery(\"from People where lastName = :name "
"and age > :age\");\n"
" query.setString(\"name\", name);\n"
" query.setInteger(\"age\", age);\n"
" Iterator people = query.iterate();"
msgstr ""
#: s/java.md.tt2:72
msgid ""
"Hibernate also supports positional parameters like `PreparedStatement`,\n"
"but named parameters are generally preferred because they make the\n"
"query a little easier to read."
msgstr ""
#: s/java.md.tt2:76
msgid ""
"See the\n"
"[Hibernate Manual](http://docs.jboss.org/hibernate/stable/core/reference/en/"
"html/objectstate.html#objectstate-querying-executing-parameters)\n"
"for more information on named parameters."
msgstr ""
#: s/java.md.tt2:80
msgid ""
"MyBatis\n"
"-------"
msgstr ""
#: s/java.md.tt2:83
msgid ""
"[MyBatis](http://www.mybatis.org/) is a database framework that\n"
"hides a lot of the JDBC code from the developer, allowing him or\n"
"her to focus on writing SQL. The SQL statements are typically\n"
"stored in XML files."
msgstr ""
#: s/java.md.tt2:88
msgid ""
"MyBatis automatically creates `PreparedStatement`s behind the scenes.\n"
"Nothing extra needs to be done by the programmer."
msgstr ""
#: s/java.md.tt2:91
msgid ""
"To give you some context, here's an example showing how a basic\n"
"query is called with MyBatis. The input data is passed into the\n"
"`PeopleMapper` instance and then it gets inserted into the\n"
"\"selectPeopleByNameAndAge\" query."
msgstr ""
#: s/java.md.tt2:96
msgid ""
"XML mapping document\n"
"===================="
msgstr ""
#: s/java.md.tt2:99
msgid ""
" <?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
" <!DOCTYPE mapper\n"
" PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\"\n"
" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\">\n"
" <mapper namespace=\"com.bobbytables.mybatis.PeopleMapper\">\n"
" <select id=\"selectPeopleByNameAndAge\" resultType=\"list\">\n"
" <!-- lastName and age are automatically sanitized --->\n"
" SELECT * FROM people WHERE lastName = #{lastName} AND age > #{age}\n"
" </select>\n"
" </mapper>"
msgstr ""
#: s/java.md.tt2:110
msgid ""
"Mapper class\n"
"============"
msgstr ""
#: s/java.md.tt2:113
msgid ""
" public interface PeopleMapper {\n"
" List<Person> selectPeopleByNameAndAge(@Param(\"lastName\") String "
"name, @Param(\"age\") int age);\n"
" }"
msgstr ""
#: s/java.md.tt2:117
msgid ""
"Invoking the query\n"
"=================="
msgstr ""
#: s/java.md.tt2:120
msgid ""
" String name = //user input\n"
" int age = //user input\n"
" SqlSessionFactory sqlMapper = //...\n"
" SqlSession session = sqlMapper.openSession();\n"
" try {\n"
" PeopleMapper mapper = session.getMapper(PeopleMapper.class);\n"
" List<Person> people = mapper.selectPeopleByNameAndAge(name, age); //"
"data is automatically sanitized\n"
" for (Person person : people) {\n"
" //...\n"
" }\n"
" } finally {\n"
" session.close();\n"
" }\n"
msgstr ""
#: s/perl.md.tt2:1
msgid ""
"Perl\n"
"===="
msgstr ""
#: s/perl.md.tt2:4
msgid ""
"Perl's [DBI](http://search.cpan.org/dist/DBI), available on the [CPAN]"
"(http://search.cpan.org), supports parameterized SQL calls. Both the `do` "
"method and `prepare` method support parameters (\"placeholders\", as they "
"call them) for most database drivers. For example:"
msgstr ""
#: s/perl.md.tt2:6
msgid ""
"\n"
" $sth = $dbh->prepare(\"SELECT * FROM users WHERE email = ?\");\n"
" foreach my $email (@emails) {\n"
" $sth->execute($email);\n"
" $row = $sth->fetchrow_hashref;\n"
" [...]\n"
" }"
msgstr ""
#: s/perl.md.tt2:14
msgid ""
"However, you can't use parameterization for identifiers (table\n"
"names, column names) so you need to use DBI's `quote_identifier()`\n"
"method for that:"
msgstr ""
#: s/perl.md.tt2:18
msgid ""
" # Make sure a table name we want to use is safe:\n"
" my $quoted_table_name = $dbh->quote_identifier($table_name);"
msgstr ""
#: s/perl.md.tt2:21
msgid ""
" # Assume @cols contains a list of column names you need to fetch:\n"
" my $cols = join ',', map { $dbh->quote_identifier($_) } @cols;"
msgstr ""
#: s/perl.md.tt2:24
msgid ""
" my $sth = $dbh->prepare(\"SELECT $cols FROM $quoted_table_name ...\");"
msgstr ""
#: s/perl.md.tt2:26
msgid ""
"You could also avoid writing SQL by hand by using [DBIx::Class](http://p3rl."
"org/DBIx::Class), [SQL::Abstract](http://p3rl.org/SQL::Abstract) etc to "
"generate your SQL for you programmatically."
msgstr ""
#: s/perl.md.tt2:28
msgid ""
"What is Taint mode?\n"
"-------------------"
msgstr ""
#: s/perl.md.tt2:31
msgid ""
"Taint mode is a special set of security checks that Perl performs on data "
"input into your program from external sources. The input data is marked as "
"tainted (untrusted) and may not be used in commands that would allow you to "
"shoot yourself in the foot. See [the perlsec manpage](http://perldoc.perl."
"org/perlsec.html) for a detailed breakdown of what taint mode tracks."
msgstr ""
#: s/perl.md.tt2:33
msgid "To invoke taint mode:"
msgstr ""
#: s/perl.md.tt2:35
msgid ""
" # From the command line\n"
" perl -T program.pl"
msgstr ""
#: s/perl.md.tt2:38
msgid ""
" # At the top of your script\n"
" #!/usr/bin/perl -T"
msgstr ""
#: s/perl.md.tt2:41
msgid ""
"When your script trips one of the taint checks your application will issue a "
"fatal error message. For testing purposes `-t` will issue warnings instead "
"of fatal errors. `-t` is not a substitute for `-T`."
msgstr ""
#: s/perl.md.tt2:46
msgid "Explain how DBI supports taint mode, both inbound and outbound.\n"
msgstr ""
#: s/php.md.tt2:1
msgid ""
"PHP\n"
"==="
msgstr ""
#: s/php.md.tt2:4
msgid ""
"PHP is a little more disorganized than how\n"
"[Perl handles parameters](./perl.html).\n"
"The standard [MySQL extension](http://php.net/manual/en/book.mysql.php)\n"
"doesn't support parameterization, although the\n"
"[PostgreSQL extension](http://www.php.net/manual/en/book.pgsql.php) does:"
msgstr ""
#: s/php.md.tt2:10
msgid ""
" $result = pg_query_params( $dbh, 'SELECT * FROM users WHERE email = $1', "
"array($email) );"
msgstr ""
#: s/php.md.tt2:12
msgid ""
"Note that the query must be in single-quotes or have the `$` escaped\n"
"to avoid PHP trying to parse it as a variable."
msgstr ""
#: s/php.md.tt2:15
msgid ""
"**However**, you should probably be using an abstraction layer.\n"
"The [ODBC](http://php.net/manual/en/book.uodbc.php) and\n"
"[PDO](http://www.php.net/manual/en/book.pdo.php) extensions both\n"
"support parameterization and multiple databases:"
msgstr ""
#: s/php.md.tt2:20
msgid ""
"Using mysqli\n"
"------------"
msgstr ""
#: s/php.md.tt2:23
msgid "The MySQL Improved extension handles bound parameters."
msgstr ""
#: s/php.md.tt2:25
msgid ""
" $stmt = $db->prepare('update people set name = ? where id = ?');\n"
" $stmt->bind_param('si',$name,$id);\n"
" $stmt->execute();"
msgstr ""
#: s/php.md.tt2:29
msgid ""
"Using ADODB\n"
"-----------"
msgstr ""
#: s/php.md.tt2:32
msgid ""
"ADODB provides a way to prepare, bind and execute all in the same method "
"call."
msgstr ""
#: s/php.md.tt2:34
msgid ""
" $dbConnection = NewADOConnection($connectionString);\n"
" $sqlResult = $dbConnection->Execute(\n"
" 'SELECT user_id,first_name,last_name FROM users WHERE username=? AND "
"password=?',\n"
" array($_REQUEST['username'], sha1($_REQUEST['password'])\n"
" );"
msgstr ""
#: s/php.md.tt2:40
msgid ""
"Using the ODBC layer\n"
"--------------------"
msgstr ""
#: s/php.md.tt2:43
msgid ""
" $stmt = odbc_prepare( $conn, 'SELECT * FROM users WHERE email = ?' );\n"
" $success = odbc_execute( $stmt, array($email) );"
msgstr ""
#: s/php.md.tt2:46
msgid "Or:"
msgstr ""
#: s/php.md.tt2:48
msgid ""
" $res = odbc_exec($conn, 'SELECT * FROM users WHERE email = ?', array"
"($email));\n"
" $sth = $dbh->prepare('SELECT * FROM users WHERE email = :email');\n"
" $sth->execute(array(':email' => $email));"
msgstr ""
#: s/php.md.tt2:52
msgid ""
"Using the PDO layer\n"
"-------------------"
msgstr ""
#: s/php.md.tt2:55
msgid "Here's the long way to do bind parameters."
msgstr ""
#: s/php.md.tt2:57
msgid ""
" $dbh = new PDO('mysql:dbname=testdb;host=127.0.0.1', $user, $password);\n"
" $stmt = $dbh->prepare('INSERT INTO REGISTRY (name, value) VALUES (:"
"name, :value)');\n"
" $stmt->bindParam(':name', $name);\n"
" $stmt->bindParam(':value', $value);"
msgstr ""
#: s/php.md.tt2:62
msgid ""
" // insert one row\n"
" $name = 'one';\n"
" $value = 1;\n"
" $stmt->execute();"
msgstr ""
#: s/php.md.tt2:67
msgid "And a shorter way to pass things in."
msgstr ""
#: s/php.md.tt2:69
msgid ""
" $dbh = new PDO('mysql:dbname=testdb;host=127.0.0.1', $user, $password);\n"
" $stmt = $dbh->prepare('UPDATE people SET name = :new_name WHERE id = :"
"id');\n"
" $stmt->execute( array('new_name' => $name, 'id' => $id) );\n"
msgstr ""
#: s/plsql.md.tt2:1
msgid ""
"PL/SQL\n"
"======"
msgstr ""
#: s/plsql.md.tt2:4
msgid "Examples assume the following table structure:"
msgstr ""
#: s/plsql.md.tt2:6
msgid ""
" CREATE TABLE users (\n"
" username VARCHAR2(8) UNIQUE,\n"
" accessed_at DATE,\n"
" superuser NUMBER(1,0)\n"
" );"
msgstr ""
#: s/plsql.md.tt2:12
msgid ""
" INSERT INTO users VALUES ('janihur', sysdate, 0);\n"
" INSERT INTO users VALUES ('petdance', sysdate - 12, 1);\n"
" INSERT INTO users VALUES ('albundy', sysdate - 3, 0);\n"
" INSERT INTO users VALUES ('donduck', sysdate - 18, 0);"
msgstr ""
#: s/plsql.md.tt2:17
msgid ""
"Always prefer static SQL when possible\n"
"--------------------------------------"
msgstr ""
#: s/plsql.md.tt2:20
msgid "Static SQL leaves no room for SQL injection."
msgstr ""
#: s/plsql.md.tt2:22
msgid ""