Skip to content

Commit 9cab0ba

Browse files
committed
Apply syntax highlighting to code in news posts
Highlights the code examples according to the CSS class on the present site (if existing).
1 parent 0ebc81d commit 9cab0ba

7 files changed

+259
-171
lines changed

de/news/_posts/2011-02-18-exception-methoden-knnen-safe-umgehen.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@ Sicherheitsstufen umgehen und einen *untainted* String destruktiv
2121
bearbeiten und in einen *tainted* umwandeln. Damit kann ein Angreifer
2222
beliebige *untainted* Strings wie folgt verändern:
2323

24-
$secret_path = "foo"
25-
26-
proc do
27-
$SAFE = 4
28-
Exception.new($secret_path).to_s
29-
$secret_path.replace "/etc/passwd"
30-
end.call
31-
32-
open($secret_path) do
33-
...
34-
end
24+
{% highlight ruby %}
25+
$secret_path = "foo"
26+
27+
proc do
28+
$SAFE = 4
29+
Exception.new($secret_path).to_s
30+
$secret_path.replace "/etc/passwd"
31+
end.call
32+
33+
open($secret_path) do
34+
...
35+
end
36+
{% endhighlight %}
3537

3638
### Betroffene Versionen
3739

de/news/_posts/2012-02-16-sicherheitsfix-fr-rubys-openssl-modul-erlaube-0n-splitting-als-gegenmanahme-fr-den-tls-beast-angriff.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ Optionen aus `SSL_OP_ALL` deaktivieren können. Nichtsdestotrotz ist die
3030
Standardoption noch immer `SSL_OP_ALL`, man kann jedoch einen SSL-Socket
3131
mit “0/n splitting” zur BEAST-Prävention wie folgt erstellen:
3232

33-
ctx = SSLContext.new
34-
ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
35-
ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER
36-
37-
SSLSocket.new(socket, ctx)
33+
{% highlight ruby %}
34+
ctx = SSLContext.new
35+
ctx.options = OP_ALL & ~OP_DONT_INSERT_EMPTY_FRAGMENTS
36+
ctx.verify_mode = OpenSSL::SSL::VERIFY_PEER
37+
38+
SSLSocket.new(socket, ctx)
39+
{% endhighlight %}
3840

3941
Dank geht an Apple für die Meldung des Problems.
4042

de/news/_posts/2012-10-12-durch-ungltiges-nul-zeichen-werden-unabsichtlich-dateien-erzeugt.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,12 @@ Dateinamen bisher allerdings nicht auf solche Zeichen, sondern gaben ihn
2323
direkt an die unterliegenden Lowlevel-Routinen weiter, was zur
2424
unbeabsichtigten Erstellung von Dateien etwa wie folgt führen kann:
2525

26-
p File.exists?("foo") #=> false
27-
open("foo\0bar", "w") { |f| f.puts "hai" }
28-
p File.exists?("foo") #=> true
29-
p File.exists?("foo\0bar") #=> wirft ArgumentError
26+
{% highlight ruby %}
27+
p File.exists?("foo") #=> false
28+
open("foo\0bar", "w") { |f| f.puts "hai" }
29+
p File.exists?("foo") #=> true
30+
p File.exists?("foo\0bar") #=> wirft ArgumentError
31+
{% endhighlight %}
3032

3133
## Betroffene Versionen
3234

id/news/_posts/2008-03-31-rush-ruby-shell-sistem-operasi-abstrak-dalam-ruby.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ lang: id
99
dan remote login (ssh), yang ditulis dengan Ruby dan menerima syntax
1010
Ruby untuk menjalankan sistem operasi. Seperti operasi berikut:
1111

12-
processes.each { |p| p.kill if p.command == “mongrel_rails“ }
12+
{% highlight ruby %}
13+
processes.each { |p| p.kill if p.command == “mongrel_rails“ }
14+
{% endhighlight %}
1315

1416
Atau
1517

16-
local = Rush::Box.new(’localhost‘)
17-
remote = Rush::Box.new(’my.remote.server.com‘)
18-
local_dir = local[’/Users/adam/myproj/‘]
19-
remote_dir = remote[’/home/myproj/app/‘]
20-
local_dir.copy_to remote_dir
21-
remote_dir[’**/.svn/‘].each { |d| d.destroy }
18+
{% highlight ruby %}
19+
local = Rush::Box.new(’localhost‘)
20+
remote = Rush::Box.new(’my.remote.server.com‘)
21+
local_dir = local[’/Users/adam/myproj/‘]
22+
remote_dir = remote[’/home/myproj/app/‘]
23+
local_dir.copy_to remote_dir
24+
remote_dir[**/.svn/‘].each { |d| d.destroy }
25+
{% endhighlight %}
2226

2327
Anda dapat membuat sesuatu dengan menggunakan usual UNIX commands, Rush
2428
abstracts sebuah kumpulan dari sitem tasks dan memudahkan anda untuk

0 commit comments

Comments
 (0)