PHPerKaigi2024ã§ç»å£ããã¨ãã®è³æã§ãã https://fortee.jp/phperkaigi-2024/proposal/ae2ded4d-8e7e-47a0-85d1-26a8c92308ac
PHPerKaigi 2022 2022/04/10 10:40ã Track A ã¬ã®ã¥ã©ã¼ãã¼ã¯ï¼40åï¼ PHP ã¯ãã¼ã¸ã§ã³ã追ãæ¯ã«å宣è¨ãä¾å¤ã表æãåæåãªã©ã®æ©è½ãå¤§å¹ ã«å¼·åãããå ç¢ãªã³ã¼ããæ¸ãããã®æ©è½ãå å®ãã¦ãã¾ããããããã®æ©è½ã¯ã©ã使ãã¨å¹æçãªã®ã§ããããã â¦
PHPerKaigi 2022 ã®ã»ãã·ã§ã³åç»ã§ãã 2022/04/10(40å) ã¹ãã¼ã«ã¼: åç°å人 ( @t_wada ) ã¿ã¤ãã«: äºé²ã«åãé²å¾¡ãªã - å ç¢ãªã³ã¼ããå°ãæ§ã ãªè¨è¨ã®ãã³ã PHP ã¯ãã¼ã¸ã§ã³ã追ãæ¯ã«å宣è¨ãä¾å¤ã表æãåæåãªã©ã®æ©è½ãå¤§å¹ ã«å¼·åãããå ç¢ãªã³ã¼ããæ¸ãããã®æ©è½ãå å®ãã¦ãã¾ããããããã®æ©è½ã¯ã©ã使ãã¨å¹æçãªã®ã§ããããã æ¬è¬æ¼ã§ã¯ PHP 8.1 ããã¼ã¹ã«ãã¦ã誤ããæ³å®ãã¦ãã§ãã¯ããã®ã§ã¯ãªãããããã誤ãã«ããè¨è¨ã¨ã¯ã©ã®ãããªãã®ããã¤ã¾ããäºé²ãã®è¦³ç¹ã軸足ã«ãå ç¢ãªã³ã¼ããå°ãããã®æ§ã ãªè¨è¨ã®ãã³ãããç´¹ä»ãã¾ãã https://fortee.jp/phperkaigi-2022/proposal/ef8cf4ed-63fe-42f8-8145-b3e70054458b
æ£è¦è¡¨ç¾ã«ããããªãã¼ã·ã§ã³çã§ãå®å ¨ä¸è´ã示ãç®ç㧠^ 㨠$ ãç¨ããæ¹æ³ãä¸è¬çã§ãããæ£ãã㯠\A 㨠\z ãç¨ããå¿ è¦ãããã¾ããRubyã®å ´å ^ 㨠$ ã使ã£ã¦å®å ¨ä¸è´ã®ããªãã¼ã·ã§ã³ãè¡ãã¨èå¼±æ§ãå ¥ããããã¯ãã¨ãªãã¾ããPerlãPHPã®å ´åã¯ãRubyç¨ã§ã¯ããã¾ãããä¸å ·åãçããã®ã§ \A 㨠\z ã使ãããã«ãã¾ãããã ã¯ãã㫠大å£ããã®ããã°ã¨ã³ããªãPHPeråããRuby/Railsã®è½ã¨ãç©´ãã«ã¯ãRubyã®è½ã¨ãç©´ã¨ãã¦ãå®å ¨ä¸è´æ¤ç´¢ã®æå®ã¨ãã¦ãæ£è¦è¡¨ç¾ã® ^ 㨠$ ãæå®ããä¾ããRuby on Rails Security Guideããã®å¼ç¨ã¨ãã¦ç´¹ä»ããã¦ãã¾ãã以ä¸ã®æ£è¦è¡¨ç¾ã¯ãXSS対çã¨ãã¦ãhttpã¹ãã¼ã ãããã¯httpsã¹ãã¼ã ã®URLã®ã¿ã許å¯ããæ£è¦è¡¨ç¾ã®ã¤ããã§ãã /^https?:\/\/[^\n]+$/
ããã«ã¡ã¯ãNGE16ã§ãã ä»åãããç°¡æçãªæ票ã·ã¹ãã ãä½ã£ã¦ããããã¨æãã¾ãã ãã£ããã§ãããé²ãã¦ããã¾ãããã MySQLã®è¨å®ãã¼ã¿ã管çããããã«ãMySQLã®è¨å®ãè¡ãªã£ã¦ããã¾ãã ã¾ãããã¼ã¿ãã¼ã¹ã®ä½æãè¡ãã¾ãã create database nge16_poll_php;ã¦ã¼ã¶ã¼ãä½æãã¾ãã grant all on nge16_poll_php. * to dbuser@localhost identified by '******';nge16_poll_phpã®ãã¼ã¿ãã¼ã¹ã«åãæ¿ãã¾ãã use nge16_poll_phpãã¼ãã«ãä½æãã¾ãã create table answers ( id int not null auto_increment primary key, answers int not null, created date
è¦ä»¶ PHPã§CSVãèªã¿è¾¼ãæ¹æ³ã¯ãããä¸ã§ããããè¦ã¤ããã¾ãããæåã³ã¼ãã®å¤æã®ããã«ä¸æ¦å¥ãã¡ã¤ã«ã«ä¿åããããèªã¿è¾¼ãã ãã¼ã¿ã«ã¢ã¯ã»ã¹ãã«ããã£ããã§ãä½åº¦æ¸ãã¦ããªãã¨ãªãã¹ãããªãã¦ã¾ããã§ããããã£ã¨ããæ¹æ³ãããããããªãããªã¼ã£ã¦ã ã§ãä»åæºè¶³ã®ããCSVãã¼ãã¼ãæ¸ããã®ã§ããç´¹ä»ãã¾ãã è¦ä»¶ã¯ä»¥ä¸ã®éãã CSVãã¼ã¿ä¸ã« " ãæ¹è¡ãå ¥ã£ã¦ããå ´åã«ãæ£ãã対å¿ãããã å¤æ°ã«èªã¿è¾¼ã¾ãããã¼ã¿ã¯æåã³ã¼ãUTF-8ã«ãããã¨ã æåã³ã¼ãã®å¤æã®éã«ä¸æãã¡ã¤ã«ãä½ããªãã§æ¸ãããã«ãããã åã¬ã³ã¼ãã®åã«ã¢ã¯ã»ã¹ããã®ã«ãã«ã©ã åçªå·ãããªãã¦CSV1è¡ç®ã®ãããæååããã¼ã«ãããã æ°ä¸è¡ãããã®ãã¼ã¿ãªãããã£ã¨èªã¿è¾¼ãã§æ¬²ããã PHP5.3ã§ãåããããã CSVèªã¿è¾¼ã¿PHPé¢æ° ã¨ãããã¨ã§ãPHPãã£ã«ã¿(php://filter)
æ¨æ¥12æ11æ¥ã«ç¬¬ä¸åéPHPåå¼·ä¼ãéå¬ãããã¾ãããç§ãå«ãçºè¡¨è 6人ã¨ãããã¨ã§ãã¨ã¦ãçãä¸ãã£ãåå¼·ä¼ã«ãªãã¾ãããçºè¡¨è ã®çãã¾ãã¾ããåå ããã ããçãã¾ãæ¬å½ã«ãããã¨ããããã¾ãããã¾ãä¼å ´æä¾ããã ãããã¯ã·ãæ ªå¼ä¼ç¤¾ãã¾ã«ã大å¤ãä¸è©±ã«ãªãã¾ããã 以ä¸ãç§ã®çºè¡¨è³æã§ãã PHPã¢ããªã±ã¼ã·ã§ã³ãsymlinkåãæ¿ãã§ãããã¤ãã¦ããã¨realpathãã£ãã·ã¥çµ¡ã¿ã§ä½ããããã©ãã«ãããã¾ããããã¨ãããããã§è¤æ°ã®ãããã¯ãç´¹ä»ãããããªå 容ã§ãããã¿ã¤ãã«ã®éããä¸çªè©±ãããã£ãã®ã¯mod_phpã¨php-fpmã¨ã§OPcacheã®æåãå¤ãã話ã ã£ããã§ãããããªãå ¥ãçµãã å 容ã ã£ãã®ã§ãã¾ãä¼ãããªãã£ãããããã¾ããã 質åã¿ã¤ã ã«ã@edvakfããããé¢ç½ãã¨ãã½ã¼ããèããã¨ãã§ãã¾ãããPixivã§ã¯ãã®æã®åé¡ã«ä¸éãããã£ãçµæãç¾å¨ã§
Monday, September 21, 2015 01:28:00 PM PHP ãã®è¨äºã¯å æ¥ã®æ£è¦è¡¨ç¾ãç°¡åã«ä½ãã«ã¯ã®ç¶ç·¨ã«ãªãã¾ãã ååãRFC3986ã®ãããªè¤éãªæ£è¦è¡¨ç¾ãVerbal Expressionã®æ¢åå®è£ ã§ãããã¨ããã¨ããã¾ãã§ããªãã¨ããåé¡ã«ç´é¢ãã¾ããã ããã§Rubyã§å®è£ ããã¦ããHEXPRESSãPHPã¸ç§»æ¤ãããã¨ããæµãã§ãã PHPçHexpressãä½ã£ã ãã£ãã移æ¤ãã¦ã¿ã¾ããã hexpress PSR-2ã®å¯¾å¿ãå®æ½ä¸ãªã®ã§ãããRubyå´ã®æ©è½ã¨ãã¹ãã¯ãã¹ã¦ç§»æ¤ããPHPçã§ããã¤ãæ©è½è¿½å ããã¦ãã¾ãã ã©ããªæãã READMEã«æ¸ãã¦ããã¨ããã¤ã³ã¹ãã¼ã«ã¯composerçµç±ã§ã§ãã¾ãã use Hexpress\Hexpress; $pattern = (new Hexpress()) ->start("http")
2. ã¢ã¸ã§ã³ã ⢠ä¾ãã°ãPHPãé¿ãã ⢠htmlspecialchars æåã¨ã³ã³ã¼ãã£ã³ã°ãã§ãã¯ã®æ¹å ⢠register_globalsãéæ¨å¥¨ã« ⢠ãã¸ãã¯ã¯ã©ã¼ããéæ¨å¥¨ã« ⢠æå·å¦çã«å®å ¨ãªæ¬ä¼¼ä¹±æ°çæå¨ã®ãµãã¼ã ⢠ã»ãã·ã§ã³IDçæã®å®å ¨æ§å¼·å ⢠ãã«ãã¤ãæ»æã®é²å¾¡æ©è½ã®è¿½å ⢠PDOã®DBæ¥ç¶æã®æåã¨ã³ã³ã¼ãã£ã³ã°æå®ãå¯è½ã« ⢠headeré¢æ°ã®ãã°ä¿®æ£ ⢠å®å ¨ãªãã¹ã¯ã¼ãä¿åãç°¡åã«ã§ããããã«ãªã£ã Copyright © 2016 Hiroshi Tokumaru 2 3. 徳丸浩ã®èªå·±ç´¹ä» ⢠çµæ´ â 1985å¹´ 京ã»ã©æ ªå¼ä¼ç¤¾å ¥ç¤¾ â 1995å¹´ 京ã»ã©ã³ãã¥ãã±ã¼ã·ã§ã³ã·ã¹ãã æ ªå¼ä¼ç¤¾(KCCS)ã«åºåã»è»¢ç± â 2008å¹´ KCCSéè·ãHASHã³ã³ãµã«ãã£ã³ã°æ ªå¼ä¼ç¤¾è¨ç« ⢠çµé¨ããã㨠â 京ã»ã©å ¥ç¤¾å½æã¯CADãè¨
社é·ãã㰠社é·ããã° æ¥æ¬ã®ãã¹ã³ãã®ç½ªã¨æ¥æ¬äººã®æ å ±å ãã¹ã³ãã«ãããããã¬ã³ãããã å½æ°ã¸ã®æ´è³å ±éã®å§¿å¢ããã  ããããèªåèªèº«ã§èª¿ã¹ Read More » 2016å¹´8æ3æ¥ ç¤¾é·ããã° ãªãï¼ï¼ãä¸å½ãªã®ï¼ï¼ï¼ ã¨ã³ããªãã¸ã¯ã¢ã¸ã¢ã¸ã®äºæ¥å±éã ã客ãã¾ã«å¼ã³ããã¦ãã¾ãã ããããã¡ã®ææ¡ãã¼ã㯠&nbs Read More » 2016å¹´7æ28æ¥ ç¤¾é·ããã° ã¿ã«ã ã¼ãã¨ã¦ãã¤äººã¨ã®æ³ãåº ããå°ãã¿ã«ã ã¼ããèªã¿è§£ãã¾ãã å¤ãã®å¤©æãåªç§ãªèµ·æ¥å®¶ã輩åºãç¶ãã ã¦ãã¤ã®äººã ã®è«ºã¯ã¨ã¦ã Read More » 2016å¹´5æ8æ¥ ç¤¾é·ããã° ã¿ã«ã ã¼ã ããèªåã®æèã«æ³¨æãããã¨ããã ãã®è¨èã«ã¯ã ããæ¬ã§åºä¼ããããã¨ããã®ãè¦ãã¦ãã¾ãã & Read More » 2016å¹´5æ4æ¥ ç¤¾é·ããã° ãã©ãããã¨ã¨ã¸ããææ5000å¹´ã®å ã¤ãå
æ¢ã«ããã¤ãã®è¨äºã§ææãããã¾ãããPHPã®unserializeé¢æ°ã«å¤é¨ç±æ¥ã®å¤ãå¦çãããã¨èå¼±æ§ã®åå ã«ãªãã¾ãã ããããããã°è¨äºçãè¦ã¦ããã¨ãå¤é¨ç±æ¥ã®å¤ãunserializeé¢æ°ã«å¦çããã¦ããã±ã¼ã¹ãå¤ãããã¾ãã ã¦ã¼ã¹ã±ã¼ã¹ã®ä¸ä¾ã¨ãã¦ã¯ããè¤æ°ã®å¤ãã¯ããã¼ã«ã»ããããæ¹æ³ãã¨ãã¦ç¨ããå ´åã§ãã PHP ã¯ããã¼ã«è¤æ°ã®å¤ãä¸æ¬ç»é²ããæ¹æ³ã¨ããè¨äºã§ã¯ã以ä¸ã®æ¹æ³ã§è¤æ°ã®å¤ãã¯ããã¼ã«ã»ãããã¦ãã¾ãã $status = array( "height" => 167, "weight" => 50, "sight" => 1.2 ); setcookie("status", serialize($status)); ã¯ããã¼ã®åãåãå´ã¯ä»¥ä¸ã®ã³ã¼ãã§ãã print_r(unserialize($_COOKIE['status'])); åºåçµæã¯ä»¥ä¸
PHPã«ã³ãã¡ã¬ã³ã¹é¢è¥¿2015ã§ã®ç§ã®ã»ãã·ã§ã³ãPHPã«ç¡ãã»ãã¥ãªãã£æ©è½ãã®ã¹ã©ã¤ãã§ãã ä½ãç¡ãã®ããç¥ã£ã¦ããã°å¯¾å¿ã§ãã¾ãã ä½ãåé¡ã«ãªã£ã¦ããã®ããç¥ã£ã¦ããã°å¯¾å¿ã§ãã¾ãã ã»ãã¥ãªãã£å¯¾çã¯è·äººææµï¼èå¼±æ§å¯¾çãã³ã¼ãä¸ã«æ£ãã°ããå ¨ä½ãææ¡ããªãã¨å®å ¨ã«ã§ããªãä½ãæ¹ï¼ã§ã¯ãªããCERT/SANS/OWASPãæ¨å¥¨ããã»ãã¥ãªãã£å¯¾çãè¡ããã¨ã³ã¸ãã¢ãªã³ã°çï¼ç§å¦çãä½ç³»çãªä½ãæ¹ï¼ãè¡ãæ¹ãç°¡åãã¤ããå®å ¨ãé«å質ãªã¢ããªã±ã¼ã·ã§ã³ãä½ãã¾ãã PDFããã¦ã³ãã¼ããããæ¹ã¯ããã°ãã覧ãã ããã http://blog.ohgaki.net/missing-security-related-parts-of-phpRead less
ããã«ã¡ã¯ãã¦ã§ãéçºæ å½ã®æ¨æ¸ã§ãã çªç¶ã§ãããPHP 㧠CSV ãã¡ã¤ã«ãé£æ³é åã«å¤æãã¦ã´ãã§ã´ãã§â¦ã£ã¦ããããã¾ãããï¼ ç§ãå æ¥éçºä¸ã«ãCSV ã®é¢æ°ãªãã ã£ãããªã¼ã¨æã£ã¦ãphp csvãã§æ¤ç´¢ãã¦ããã®ã§ããããã¡ã¼ã¹ããã¥ã¼ãå®çªã® fopen ã㦠fgetcsv ã®å ¬å¼ãµã³ãã«ãè¨äºã°ããã§ã¿ã¤ãã«éããï¼ãã ã£ãã®ã§ã調æ»ãã¦ã¿ãã¨ãããæå¤ã¨é¢ç½ããã¨ããããã¾ããã ãã£ã±ã fgetcsv ã ããããªãã£ã ä¼¼ããããªæ©è½ãæã¤é¢æ°ãè¤æ°ãããå ¬å¼ããã¥ã¡ã³ããè¦ã¦ãã©ãã使ã£ã¦ãããããããªãããªãã¦ã㨠PHP ã§ã¯ãããããã¡ã§ããCSV å¤æããã£ã±ãããããªæ¹æ³ãããã¾ããã ããã§ä»åã¯ããããã CSV å¤æå¦çãæ¤è¨¼ããå¦çæéã¨ã¡ã¢ãªä½¿ç¨éãæ¯è¼ãã¾ããå¦çã¯ã¬ã³ã¼ããã¨ã®é£æ³é åã«å¤æããã®ã¿ã§ãããã»ããã§ããæåã³ã¼ãã®å¤æã
å¼ç¤¾æ¬ç¤¾ã®éº»å¸åçªç§»è»¢ã«ä¼´ããæ¬ç¤¾è¿ãã®éº»å¸å³æ¸é¤¨ãå©ç¨ãã¦ãã¾ãã麻å¸å³æ¸é¤¨ã¯åå°æã®ã¤ã¡ã¼ã¸ã«ããçæ´ãªå»ºç©ã§ãèµæ¸ããªãå ´åã¯æ¸¯åºã®ä»ã®å³æ¸é¤¨ããåãå¯ãï¼ç¡æã§ãï¼ãã§ãã¾ãã®ã§ãããå©ç¨ãã¦ãã¾ããä»åã¯ãå±±ç°ç¥¥å¯ããã®ã10æ¥ã§ãã¼ããPHPå ¥éæ室 第4ç ããåãã¦èªãã§ã¿ã¾ãããä¸èªãã¦ãæ¬æ¸ãã»ãã¥ãªãã£ã«ãããé æ ®ããã¦ãããã¨ããããã¾ããã®ã§ã以ä¸ã«ãç´¹ä»ãããã¨æãã¾ãã ã¯ãã¹ãµã¤ãã¹ã¯ãªããã£ã³ã°(XSS) 表示ã®éã«HTMLã¨ã¹ã±ã¼ãããã¨ããååãå¿ å®ã«å®ã£ã¦ãã¾ãããã®ãããä¸è¨ã® e() ã¨ããé¢æ°ãå®ç¾©ãã¦å¼ã³åºãã¦ãã¾ãã function e($str, $charset = 'UTF-8') { return htmlspecialchars($str, ENT_QUOTES, $charset); } ãã®ä»ã«ãXSS対çã¨ãã¦éè¦ãªä¸è¨ã®
Here was my setup on an Amazon Medium Instance using APC: php.ini configuration [APC] extension=apc.so apc.enabled=1 apc.shm_segments=1 ;32M per WordPress install apc.shm_size=128M ;Relative to the number of cached files (you may need to watch your stats for a day or two to find out a good number) apc.num_files_hint=7000 ;Relative to the size of WordPress apc.user_entries_hint=4096 ;The number of
ãã7æã§ãã ä»å¹´ãååãçµãã£ã¦ãã¾ãã¾ããï¼ï¼¾Ïï¼¾ï¼ï¼ ãã¾ã«ã¯ããã°ã©ãã³ã°ã£ã½ã話é¡ãã PHPã§éçºããã£ã¦ãã¦ãããã¯ä¾¿å©ï¼ãã¨æãã ç¾å¨ãæç¨ãã¦ããæ¹æ³ãç´¹ä»ãã¦ã¿ã¾ãã (æ¹ãã¦ã°ã°ã£ã¦ã¿ã¦ãããã«ã¯è¦ã¤ãããªãã£ãã®ã§ï¼ï¼¾Ïï¼¾ï¼ï¼) PHPã§éçºãè¡ã£ã¦ããéã« echoã§è¤æ°è¡ãåºåããããªãå ´åããããã¨æãã¾ãã (è¤æ°è¡ãå¤æ°ã¸ä»£å ¥ãããå ´åãå«ã¿ã¾ãã) ãããã£ãå ´åãç§ã¯ãã¢ããã¥ã¡ã³ããç¨ãã¾ãã ã¾ãã以ä¸ã®ããã«ãã¢ããã¥ã¡ã³ãå 㧠å¤æ°ãå±éã§ããæ©è½ã¯é常ã«æç¨ã§ãã PHPã½ã¼ã¹: <?php $tempstr = â2è¡ç®â; echo <<< EOT 1è¡ç®<br /> {$tempstr}<br /> 3è¡ç® EOT; ?> åºå: 1è¡ç® 2è¡ç® 3è¡ç® ãã ããé¢æ°ã¯å±éãããªãããã htmlspecialcharsçãå©ç¨ãã
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}