« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 4 of about 4 for greet (0.001 sec.)
Script Injection Attacks 11169
« Request Injection Attacks MongoDB\Driver » PHP Manual Security Script Injection Attacks 検索 Script Injection Attacks If you are using JavaScript, make sure that any variables that cross the PHP- to-JavaScript boundary are passed in the s ... up commands, and any other time you may pass JavaScript into the database. For example, suppose we have some JavaScript to greet a user in the database logs. We could do: <?php $m = new MongoDB\Driver\Manager ; // Don't do this!!! $username = $_GET [ ... ; $_GET [ 'field' ] = 'derick' ; $args = [ $_GET [ 'field' ] ]; $cmd = new \MongoDB\Driver\Command ( [ 'eval' => "function greet(username) { print('Hello, ' + username + '!'); }" , 'args' => $args , ] ); $r = $m -> executeCommand ( 'dramio' , $cmd ); ... ?> This adds an argument to the JavaScript scope, which gets used as argument for the greet function. Now if someone tries to send malicious code, MongoDB will harmlessly print Hello, '); db.dropDatabase(); print(' ...
https://man.mtool.work/php/8.3/mongodb.security.script_injection.html
Script Injection Attacks 11003
« Request Injection Attacks MongoDB\Driver » PHP Manual Security Script Injection Attacks 検索 Script Injection Attacks If you are using JavaScript, make sure that any variables that cross the PHP- to-JavaScript boundary are passed in the s ... up commands, and any other time you may pass JavaScript into the database. For example, suppose we have some JavaScript to greet a user in the database logs. We could do: <?php $m = new MongoDB\Driver\Manager ; // Don't do this!!! $username = $_GET [ ... ; $_GET [ 'field' ] = 'derick' ; $args = [ $_GET [ 'field' ] ]; $cmd = new \MongoDB\Driver\Command ( [ 'eval' => "function greet(username) { print('Hello, ' + username + '!'); }" , 'args' => $args , ] ); $r = $m -> executeCommand ( 'dramio' , $cmd ); ... ?> This adds an argument to the JavaScript scope, which gets used as argument for the greet function. Now if someone tries to send malicious code, MongoDB will harmlessly print Hello, '); db.dropDatabase(); print(' ...
https://man.mtool.work/php/8.3/mongodb.security.script_injection.html
無名関数 7397
« 内部(ビルトイン)関数 アロー関数 » PHP Manual 関数 無名関数 検索 無名関数 無名関数は クロージャ とも呼ばれ、 関数名を指定せずに関数を作成できるようにするものです。 callable パラメータとして使う際に便利ですが、用途はそれにとどまりません。 ... 数へのクロージャの代入は、他の代入と同じように記述し、 同じく最後にセミコロンをつけます。 例2 変数への無名関数の代入 <?php $greet = function( $name ) { printf ( "Hello %s\r\n" , $name ); }; $greet ( 'World' ); $greet ( 'PHP' ); クロージャは、変数を親の ...
https://man.mtool.work/php/8.3/functions.anonymous.html
無名関数 7397
« 内部(ビルトイン)関数 アロー関数 » PHP Manual 関数 無名関数 検索 無名関数 無名関数は クロージャ とも呼ばれ、 関数名を指定せずに関数を作成できるようにするものです。 callable パラメータとして使う際に便利ですが、用途はそれにとどまりません。 ... 数へのクロージャの代入は、他の代入と同じように記述し、 同じく最後にセミコロンをつけます。 例2 変数への無名関数の代入 <?php $greet = function( $name ) { printf ( "Hello %s\r\n" , $name ); }; $greet ( 'World' ); $greet ( 'PHP' ); クロージャは、変数を親の ...
https://man.mtool.work/php/8.3/functions.anonymous.html
PREV 1 NEXT