الفرق بين المراجعتين ل"Ruby/SecurityError"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
سطر 1: سطر 1:
يُطلق الاستثناء <code>SecurityError</code> عند محاولة تنفيذ عملية قد تكون غير آمنة، عادة عندما يُرفع ‎<code>$SAFE</code>  مستوى فوق <code>0</code><syntaxhighlight lang="ruby">
+
يُطلق الاستثناء <code>SecurityError</code> عند محاولة تنفيذ عملية قد تكون غير آمنة، عادة عندما يُرفع مستوى  ‎<code>$SAFE</code>  فوق <code>0</code><syntaxhighlight lang="ruby">
 
foo = "bar"
 
foo = "bar"
 
proc = Proc.new do
 
proc = Proc.new do
سطر 6: سطر 6:
 
end
 
end
 
proc.call
 
proc.call
</syntaxhighlight>سيُطلق الاستثناء:<syntaxhighlight lang="ruby">
+
</syntaxhighlight>ستطلق الاستثناء:<syntaxhighlight lang="ruby">
 
SecurityError: Insecure: Insecure operation `untaint' at level 3
 
SecurityError: Insecure: Insecure operation `untaint' at level 3
  

مراجعة 00:14، 2 نوفمبر 2018

يُطلق الاستثناء SecurityError عند محاولة تنفيذ عملية قد تكون غير آمنة، عادة عندما يُرفع مستوى ‎$SAFE  فوق 0

foo = "bar"
proc = Proc.new do
  $SAFE = 3
  foo.untaint
end
proc.call

ستطلق الاستثناء:

SecurityError: Insecure: Insecure operation `untaint' at level 3

مصادر