@@ -24,7 +24,7 @@ function trafic_limiter_canPass($ip)
2424 $ tfilename ='./data/trafic_limiter.php ' ;
2525 if (!is_file ($ tfilename ))
2626 {
27- file_put_contents ($ tfilename ,"<?php \n\$GLOBALS['trafic_limiter']=array(); \n?> " );
27+ file_put_contents ($ tfilename ,"<?php \n\$GLOBALS['trafic_limiter']=array(); \n?> " , LOCK_EX );
2828 chmod ($ tfilename ,0705 );
2929 }
3030 require $ tfilename ;
@@ -140,7 +140,7 @@ function deletePaste($pasteid)
140140 if (!is_dir ('data ' ))
141141 {
142142 mkdir ('data ' ,0705 );
143- file_put_contents ('data/.htaccess ' ,"Allow from none \nDeny from all \n" );
143+ file_put_contents ('data/.htaccess ' ,"Allow from none \nDeny from all \n" , LOCK_EX );
144144 }
145145
146146 // Make sure last paste from the IP address was more than 10 seconds ago.
@@ -266,7 +266,7 @@ function deletePaste($pasteid)
266266 exit ;
267267 }
268268
269- file_put_contents ($ discdir .$ filename ,json_encode ($ storage ));
269+ file_put_contents ($ discdir .$ filename ,json_encode ($ storage ), LOCK_EX );
270270 echo json_encode (array ('status ' =>0 ,'id ' =>$ dataid )); // 0 = no error
271271 exit ;
272272 }
@@ -280,7 +280,7 @@ function deletePaste($pasteid)
280280 exit ;
281281 }
282282 // New paste
283- file_put_contents ($ storagedir .$ dataid ,json_encode ($ storage ));
283+ file_put_contents ($ storagedir .$ dataid ,json_encode ($ storage ), LOCK_EX );
284284
285285 // Generate the "delete" token.
286286 // The token is the hmac of the pasteid signed with the server salt.
0 commit comments