formatting.php 265 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416
  1. <?php
  2. /**
  3. * Main WordPress Formatting API.
  4. *
  5. * Handles many functions for formatting output.
  6. *
  7. * @package WordPress
  8. */
  9. /**
  10. * Replaces common plain text characters into formatted entities
  11. *
  12. * As an example,
  13. *
  14. * 'cause today's effort makes it worth tomorrow's "holiday" ...
  15. *
  16. * Becomes:
  17. *
  18. * &#8217;cause today&#8217;s effort makes it worth tomorrow&#8217;s &#8220;holiday&#8221; &#8230;
  19. *
  20. * Code within certain html blocks are skipped.
  21. *
  22. * Do not use this function before the {@see 'init'} action hook; everything will break.
  23. *
  24. * @since 0.71
  25. *
  26. * @global array $wp_cockneyreplace Array of formatted entities for certain common phrases
  27. * @global array $shortcode_tags
  28. * @staticvar array $static_characters
  29. * @staticvar array $static_replacements
  30. * @staticvar array $dynamic_characters
  31. * @staticvar array $dynamic_replacements
  32. * @staticvar array $default_no_texturize_tags
  33. * @staticvar array $default_no_texturize_shortcodes
  34. * @staticvar bool $run_texturize
  35. * @staticvar string $apos
  36. * @staticvar string $prime
  37. * @staticvar string $double_prime
  38. * @staticvar string $opening_quote
  39. * @staticvar string $closing_quote
  40. * @staticvar string $opening_single_quote
  41. * @staticvar string $closing_single_quote
  42. * @staticvar string $open_q_flag
  43. * @staticvar string $open_sq_flag
  44. * @staticvar string $apos_flag
  45. *
  46. * @param string $text The text to be formatted
  47. * @param bool $reset Set to true for unit testing. Translated patterns will reset.
  48. * @return string The string replaced with html entities
  49. */
  50. function wptexturize( $text, $reset = false ) {
  51. global $wp_cockneyreplace, $shortcode_tags;
  52. static $static_characters = null,
  53. $static_replacements = null,
  54. $dynamic_characters = null,
  55. $dynamic_replacements = null,
  56. $default_no_texturize_tags = null,
  57. $default_no_texturize_shortcodes = null,
  58. $run_texturize = true,
  59. $apos = null,
  60. $prime = null,
  61. $double_prime = null,
  62. $opening_quote = null,
  63. $closing_quote = null,
  64. $opening_single_quote = null,
  65. $closing_single_quote = null,
  66. $open_q_flag = '<!--oq-->',
  67. $open_sq_flag = '<!--osq-->',
  68. $apos_flag = '<!--apos-->';
  69. // If there's nothing to do, just stop.
  70. if ( empty( $text ) || false === $run_texturize ) {
  71. return $text;
  72. }
  73. // Set up static variables. Run once only.
  74. if ( $reset || ! isset( $static_characters ) ) {
  75. /**
  76. * Filters whether to skip running wptexturize().
  77. *
  78. * Passing false to the filter will effectively short-circuit wptexturize().
  79. * returning the original text passed to the function instead.
  80. *
  81. * The filter runs only once, the first time wptexturize() is called.
  82. *
  83. * @since 4.0.0
  84. *
  85. * @see wptexturize()
  86. *
  87. * @param bool $run_texturize Whether to short-circuit wptexturize().
  88. */
  89. $run_texturize = apply_filters( 'run_wptexturize', $run_texturize );
  90. if ( false === $run_texturize ) {
  91. return $text;
  92. }
  93. /* translators: opening curly double quote */
  94. $opening_quote = _x( '&#8220;', 'opening curly double quote' );
  95. /* translators: closing curly double quote */
  96. $closing_quote = _x( '&#8221;', 'closing curly double quote' );
  97. /* translators: apostrophe, for example in 'cause or can't */
  98. $apos = _x( '&#8217;', 'apostrophe' );
  99. /* translators: prime, for example in 9' (nine feet) */
  100. $prime = _x( '&#8242;', 'prime' );
  101. /* translators: double prime, for example in 9" (nine inches) */
  102. $double_prime = _x( '&#8243;', 'double prime' );
  103. /* translators: opening curly single quote */
  104. $opening_single_quote = _x( '&#8216;', 'opening curly single quote' );
  105. /* translators: closing curly single quote */
  106. $closing_single_quote = _x( '&#8217;', 'closing curly single quote' );
  107. /* translators: en dash */
  108. $en_dash = _x( '&#8211;', 'en dash' );
  109. /* translators: em dash */
  110. $em_dash = _x( '&#8212;', 'em dash' );
  111. $default_no_texturize_tags = array('pre', 'code', 'kbd', 'style', 'script', 'tt');
  112. $default_no_texturize_shortcodes = array('code');
  113. // if a plugin has provided an autocorrect array, use it
  114. if ( isset($wp_cockneyreplace) ) {
  115. $cockney = array_keys( $wp_cockneyreplace );
  116. $cockneyreplace = array_values( $wp_cockneyreplace );
  117. } else {
  118. /* translators: This is a comma-separated list of words that defy the syntax of quotations in normal use,
  119. * for example... 'We do not have enough words yet' ... is a typical quoted phrase. But when we write
  120. * lines of code 'til we have enough of 'em, then we need to insert apostrophes instead of quotes.
  121. */
  122. $cockney = explode( ',', _x( "'tain't,'twere,'twas,'tis,'twill,'til,'bout,'nuff,'round,'cause,'em",
  123. 'Comma-separated list of words to texturize in your language' ) );
  124. $cockneyreplace = explode( ',', _x( '&#8217;tain&#8217;t,&#8217;twere,&#8217;twas,&#8217;tis,&#8217;twill,&#8217;til,&#8217;bout,&#8217;nuff,&#8217;round,&#8217;cause,&#8217;em',
  125. 'Comma-separated list of replacement words in your language' ) );
  126. }
  127. $static_characters = array_merge( array( '...', '``', '\'\'', ' (tm)' ), $cockney );
  128. $static_replacements = array_merge( array( '&#8230;', $opening_quote, $closing_quote, ' &#8482;' ), $cockneyreplace );
  129. // Pattern-based replacements of characters.
  130. // Sort the remaining patterns into several arrays for performance tuning.
  131. $dynamic_characters = array( 'apos' => array(), 'quote' => array(), 'dash' => array() );
  132. $dynamic_replacements = array( 'apos' => array(), 'quote' => array(), 'dash' => array() );
  133. $dynamic = array();
  134. $spaces = wp_spaces_regexp();
  135. // '99' and '99" are ambiguous among other patterns; assume it's an abbreviated year at the end of a quotation.
  136. if ( "'" !== $apos || "'" !== $closing_single_quote ) {
  137. $dynamic[ '/\'(\d\d)\'(?=\Z|[.,:;!?)}\-\]]|&gt;|' . $spaces . ')/' ] = $apos_flag . '$1' . $closing_single_quote;
  138. }
  139. if ( "'" !== $apos || '"' !== $closing_quote ) {
  140. $dynamic[ '/\'(\d\d)"(?=\Z|[.,:;!?)}\-\]]|&gt;|' . $spaces . ')/' ] = $apos_flag . '$1' . $closing_quote;
  141. }
  142. // '99 '99s '99's (apostrophe) But never '9 or '99% or '999 or '99.0.
  143. if ( "'" !== $apos ) {
  144. $dynamic[ '/\'(?=\d\d(?:\Z|(?![%\d]|[.,]\d)))/' ] = $apos_flag;
  145. }
  146. // Quoted Numbers like '0.42'
  147. if ( "'" !== $opening_single_quote && "'" !== $closing_single_quote ) {
  148. $dynamic[ '/(?<=\A|' . $spaces . ')\'(\d[.,\d]*)\'/' ] = $open_sq_flag . '$1' . $closing_single_quote;
  149. }
  150. // Single quote at start, or preceded by (, {, <, [, ", -, or spaces.
  151. if ( "'" !== $opening_single_quote ) {
  152. $dynamic[ '/(?<=\A|[([{"\-]|&lt;|' . $spaces . ')\'/' ] = $open_sq_flag;
  153. }
  154. // Apostrophe in a word. No spaces, double apostrophes, or other punctuation.
  155. if ( "'" !== $apos ) {
  156. $dynamic[ '/(?<!' . $spaces . ')\'(?!\Z|[.,:;!?"\'(){}[\]\-]|&[lg]t;|' . $spaces . ')/' ] = $apos_flag;
  157. }
  158. $dynamic_characters['apos'] = array_keys( $dynamic );
  159. $dynamic_replacements['apos'] = array_values( $dynamic );
  160. $dynamic = array();
  161. // Quoted Numbers like "42"
  162. if ( '"' !== $opening_quote && '"' !== $closing_quote ) {
  163. $dynamic[ '/(?<=\A|' . $spaces . ')"(\d[.,\d]*)"/' ] = $open_q_flag . '$1' . $closing_quote;
  164. }
  165. // Double quote at start, or preceded by (, {, <, [, -, or spaces, and not followed by spaces.
  166. if ( '"' !== $opening_quote ) {
  167. $dynamic[ '/(?<=\A|[([{\-]|&lt;|' . $spaces . ')"(?!' . $spaces . ')/' ] = $open_q_flag;
  168. }
  169. $dynamic_characters['quote'] = array_keys( $dynamic );
  170. $dynamic_replacements['quote'] = array_values( $dynamic );
  171. $dynamic = array();
  172. // Dashes and spaces
  173. $dynamic[ '/---/' ] = $em_dash;
  174. $dynamic[ '/(?<=^|' . $spaces . ')--(?=$|' . $spaces . ')/' ] = $em_dash;
  175. $dynamic[ '/(?<!xn)--/' ] = $en_dash;
  176. $dynamic[ '/(?<=^|' . $spaces . ')-(?=$|' . $spaces . ')/' ] = $en_dash;
  177. $dynamic_characters['dash'] = array_keys( $dynamic );
  178. $dynamic_replacements['dash'] = array_values( $dynamic );
  179. }
  180. // Must do this every time in case plugins use these filters in a context sensitive manner
  181. /**
  182. * Filters the list of HTML elements not to texturize.
  183. *
  184. * @since 2.8.0
  185. *
  186. * @param array $default_no_texturize_tags An array of HTML element names.
  187. */
  188. $no_texturize_tags = apply_filters( 'no_texturize_tags', $default_no_texturize_tags );
  189. /**
  190. * Filters the list of shortcodes not to texturize.
  191. *
  192. * @since 2.8.0
  193. *
  194. * @param array $default_no_texturize_shortcodes An array of shortcode names.
  195. */
  196. $no_texturize_shortcodes = apply_filters( 'no_texturize_shortcodes', $default_no_texturize_shortcodes );
  197. $no_texturize_tags_stack = array();
  198. $no_texturize_shortcodes_stack = array();
  199. // Look for shortcodes and HTML elements.
  200. preg_match_all( '@\[/?([^<>&/\[\]\x00-\x20=]++)@', $text, $matches );
  201. $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
  202. $found_shortcodes = ! empty( $tagnames );
  203. $shortcode_regex = $found_shortcodes ? _get_wptexturize_shortcode_regex( $tagnames ) : '';
  204. $regex = _get_wptexturize_split_regex( $shortcode_regex );
  205. $textarr = preg_split( $regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY );
  206. foreach ( $textarr as &$curl ) {
  207. // Only call _wptexturize_pushpop_element if $curl is a delimiter.
  208. $first = $curl[0];
  209. if ( '<' === $first ) {
  210. if ( '<!--' === substr( $curl, 0, 4 ) ) {
  211. // This is an HTML comment delimiter.
  212. continue;
  213. } else {
  214. // This is an HTML element delimiter.
  215. // Replace each & with &#038; unless it already looks like an entity.
  216. $curl = preg_replace( '/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', '&#038;', $curl );
  217. _wptexturize_pushpop_element( $curl, $no_texturize_tags_stack, $no_texturize_tags );
  218. }
  219. } elseif ( '' === trim( $curl ) ) {
  220. // This is a newline between delimiters. Performance improves when we check this.
  221. continue;
  222. } elseif ( '[' === $first && $found_shortcodes && 1 === preg_match( '/^' . $shortcode_regex . '$/', $curl ) ) {
  223. // This is a shortcode delimiter.
  224. if ( '[[' !== substr( $curl, 0, 2 ) && ']]' !== substr( $curl, -2 ) ) {
  225. // Looks like a normal shortcode.
  226. _wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes );
  227. } else {
  228. // Looks like an escaped shortcode.
  229. continue;
  230. }
  231. } elseif ( empty( $no_texturize_shortcodes_stack ) && empty( $no_texturize_tags_stack ) ) {
  232. // This is neither a delimiter, nor is this content inside of no_texturize pairs. Do texturize.
  233. $curl = str_replace( $static_characters, $static_replacements, $curl );
  234. if ( false !== strpos( $curl, "'" ) ) {
  235. $curl = preg_replace( $dynamic_characters['apos'], $dynamic_replacements['apos'], $curl );
  236. $curl = wptexturize_primes( $curl, "'", $prime, $open_sq_flag, $closing_single_quote );
  237. $curl = str_replace( $apos_flag, $apos, $curl );
  238. $curl = str_replace( $open_sq_flag, $opening_single_quote, $curl );
  239. }
  240. if ( false !== strpos( $curl, '"' ) ) {
  241. $curl = preg_replace( $dynamic_characters['quote'], $dynamic_replacements['quote'], $curl );
  242. $curl = wptexturize_primes( $curl, '"', $double_prime, $open_q_flag, $closing_quote );
  243. $curl = str_replace( $open_q_flag, $opening_quote, $curl );
  244. }
  245. if ( false !== strpos( $curl, '-' ) ) {
  246. $curl = preg_replace( $dynamic_characters['dash'], $dynamic_replacements['dash'], $curl );
  247. }
  248. // 9x9 (times), but never 0x9999
  249. if ( 1 === preg_match( '/(?<=\d)x\d/', $curl ) ) {
  250. // Searching for a digit is 10 times more expensive than for the x, so we avoid doing this one!
  251. $curl = preg_replace( '/\b(\d(?(?<=0)[\d\.,]+|[\d\.,]*))x(\d[\d\.,]*)\b/', '$1&#215;$2', $curl );
  252. }
  253. // Replace each & with &#038; unless it already looks like an entity.
  254. $curl = preg_replace( '/&(?!#(?:\d+|x[a-f0-9]+);|[a-z1-4]{1,8};)/i', '&#038;', $curl );
  255. }
  256. }
  257. return implode( '', $textarr );
  258. }
  259. /**
  260. * Implements a logic tree to determine whether or not "7'." represents seven feet,
  261. * then converts the special char into either a prime char or a closing quote char.
  262. *
  263. * @since 4.3.0
  264. *
  265. * @param string $haystack The plain text to be searched.
  266. * @param string $needle The character to search for such as ' or ".
  267. * @param string $prime The prime char to use for replacement.
  268. * @param string $open_quote The opening quote char. Opening quote replacement must be
  269. * accomplished already.
  270. * @param string $close_quote The closing quote char to use for replacement.
  271. * @return string The $haystack value after primes and quotes replacements.
  272. */
  273. function wptexturize_primes( $haystack, $needle, $prime, $open_quote, $close_quote ) {
  274. $spaces = wp_spaces_regexp();
  275. $flag = '<!--wp-prime-or-quote-->';
  276. $quote_pattern = "/$needle(?=\\Z|[.,:;!?)}\\-\\]]|&gt;|" . $spaces . ")/";
  277. $prime_pattern = "/(?<=\\d)$needle/";
  278. $flag_after_digit = "/(?<=\\d)$flag/";
  279. $flag_no_digit = "/(?<!\\d)$flag/";
  280. $sentences = explode( $open_quote, $haystack );
  281. foreach ( $sentences as $key => &$sentence ) {
  282. if ( false === strpos( $sentence, $needle ) ) {
  283. continue;
  284. } elseif ( 0 !== $key && 0 === substr_count( $sentence, $close_quote ) ) {
  285. $sentence = preg_replace( $quote_pattern, $flag, $sentence, -1, $count );
  286. if ( $count > 1 ) {
  287. // This sentence appears to have multiple closing quotes. Attempt Vulcan logic.
  288. $sentence = preg_replace( $flag_no_digit, $close_quote, $sentence, -1, $count2 );
  289. if ( 0 === $count2 ) {
  290. // Try looking for a quote followed by a period.
  291. $count2 = substr_count( $sentence, "$flag." );
  292. if ( $count2 > 0 ) {
  293. // Assume the rightmost quote-period match is the end of quotation.
  294. $pos = strrpos( $sentence, "$flag." );
  295. } else {
  296. // When all else fails, make the rightmost candidate a closing quote.
  297. // This is most likely to be problematic in the context of bug #18549.
  298. $pos = strrpos( $sentence, $flag );
  299. }
  300. $sentence = substr_replace( $sentence, $close_quote, $pos, strlen( $flag ) );
  301. }
  302. // Use conventional replacement on any remaining primes and quotes.
  303. $sentence = preg_replace( $prime_pattern, $prime, $sentence );
  304. $sentence = preg_replace( $flag_after_digit, $prime, $sentence );
  305. $sentence = str_replace( $flag, $close_quote, $sentence );
  306. } elseif ( 1 == $count ) {
  307. // Found only one closing quote candidate, so give it priority over primes.
  308. $sentence = str_replace( $flag, $close_quote, $sentence );
  309. $sentence = preg_replace( $prime_pattern, $prime, $sentence );
  310. } else {
  311. // No closing quotes found. Just run primes pattern.
  312. $sentence = preg_replace( $prime_pattern, $prime, $sentence );
  313. }
  314. } else {
  315. $sentence = preg_replace( $prime_pattern, $prime, $sentence );
  316. $sentence = preg_replace( $quote_pattern, $close_quote, $sentence );
  317. }
  318. if ( '"' == $needle && false !== strpos( $sentence, '"' ) ) {
  319. $sentence = str_replace( '"', $close_quote, $sentence );
  320. }
  321. }
  322. return implode( $open_quote, $sentences );
  323. }
  324. /**
  325. * Search for disabled element tags. Push element to stack on tag open and pop
  326. * on tag close.
  327. *
  328. * Assumes first char of $text is tag opening and last char is tag closing.
  329. * Assumes second char of $text is optionally '/' to indicate closing as in </html>.
  330. *
  331. * @since 2.9.0
  332. * @access private
  333. *
  334. * @param string $text Text to check. Must be a tag like `<html>` or `[shortcode]`.
  335. * @param array $stack List of open tag elements.
  336. * @param array $disabled_elements The tag names to match against. Spaces are not allowed in tag names.
  337. */
  338. function _wptexturize_pushpop_element( $text, &$stack, $disabled_elements ) {
  339. // Is it an opening tag or closing tag?
  340. if ( isset( $text[1] ) && '/' !== $text[1] ) {
  341. $opening_tag = true;
  342. $name_offset = 1;
  343. } elseif ( 0 == count( $stack ) ) {
  344. // Stack is empty. Just stop.
  345. return;
  346. } else {
  347. $opening_tag = false;
  348. $name_offset = 2;
  349. }
  350. // Parse out the tag name.
  351. $space = strpos( $text, ' ' );
  352. if ( false === $space ) {
  353. $space = -1;
  354. } else {
  355. $space -= $name_offset;
  356. }
  357. $tag = substr( $text, $name_offset, $space );
  358. // Handle disabled tags.
  359. if ( in_array( $tag, $disabled_elements ) ) {
  360. if ( $opening_tag ) {
  361. /*
  362. * This disables texturize until we find a closing tag of our type
  363. * (e.g. <pre>) even if there was invalid nesting before that
  364. *
  365. * Example: in the case <pre>sadsadasd</code>"baba"</pre>
  366. * "baba" won't be texturize
  367. */
  368. array_push( $stack, $tag );
  369. } elseif ( end( $stack ) == $tag ) {
  370. array_pop( $stack );
  371. }
  372. }
  373. }
  374. /**
  375. * Replaces double line-breaks with paragraph elements.
  376. *
  377. * A group of regex replaces used to identify text formatted with newlines and
  378. * replace double line-breaks with HTML paragraph tags. The remaining line-breaks
  379. * after conversion become <<br />> tags, unless $br is set to '0' or 'false'.
  380. *
  381. * @since 0.71
  382. *
  383. * @param string $pee The text which has to be formatted.
  384. * @param bool $br Optional. If set, this will convert all remaining line-breaks
  385. * after paragraphing. Default true.
  386. * @return string Text which has been converted into correct paragraph tags.
  387. */
  388. function wpautop( $pee, $br = true ) {
  389. $pre_tags = array();
  390. if ( trim($pee) === '' )
  391. return '';
  392. // Just to make things a little easier, pad the end.
  393. $pee = $pee . "\n";
  394. /*
  395. * Pre tags shouldn't be touched by autop.
  396. * Replace pre tags with placeholders and bring them back after autop.
  397. */
  398. if ( strpos($pee, '<pre') !== false ) {
  399. $pee_parts = explode( '</pre>', $pee );
  400. $last_pee = array_pop($pee_parts);
  401. $pee = '';
  402. $i = 0;
  403. foreach ( $pee_parts as $pee_part ) {
  404. $start = strpos($pee_part, '<pre');
  405. // Malformed html?
  406. if ( $start === false ) {
  407. $pee .= $pee_part;
  408. continue;
  409. }
  410. $name = "<pre wp-pre-tag-$i></pre>";
  411. $pre_tags[$name] = substr( $pee_part, $start ) . '</pre>';
  412. $pee .= substr( $pee_part, 0, $start ) . $name;
  413. $i++;
  414. }
  415. $pee .= $last_pee;
  416. }
  417. // Change multiple <br>s into two line breaks, which will turn into paragraphs.
  418. $pee = preg_replace('|<br\s*/?>\s*<br\s*/?>|', "\n\n", $pee);
  419. $allblocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';
  420. // Add a double line break above block-level opening tags.
  421. $pee = preg_replace('!(<' . $allblocks . '[\s/>])!', "\n\n$1", $pee);
  422. // Add a double line break below block-level closing tags.
  423. $pee = preg_replace('!(</' . $allblocks . '>)!', "$1\n\n", $pee);
  424. // Standardize newline characters to "\n".
  425. $pee = str_replace(array("\r\n", "\r"), "\n", $pee);
  426. // Find newlines in all elements and add placeholders.
  427. $pee = wp_replace_in_html_tags( $pee, array( "\n" => " <!-- wpnl --> " ) );
  428. // Collapse line breaks before and after <option> elements so they don't get autop'd.
  429. if ( strpos( $pee, '<option' ) !== false ) {
  430. $pee = preg_replace( '|\s*<option|', '<option', $pee );
  431. $pee = preg_replace( '|</option>\s*|', '</option>', $pee );
  432. }
  433. /*
  434. * Collapse line breaks inside <object> elements, before <param> and <embed> elements
  435. * so they don't get autop'd.
  436. */
  437. if ( strpos( $pee, '</object>' ) !== false ) {
  438. $pee = preg_replace( '|(<object[^>]*>)\s*|', '$1', $pee );
  439. $pee = preg_replace( '|\s*</object>|', '</object>', $pee );
  440. $pee = preg_replace( '%\s*(</?(?:param|embed)[^>]*>)\s*%', '$1', $pee );
  441. }
  442. /*
  443. * Collapse line breaks inside <audio> and <video> elements,
  444. * before and after <source> and <track> elements.
  445. */
  446. if ( strpos( $pee, '<source' ) !== false || strpos( $pee, '<track' ) !== false ) {
  447. $pee = preg_replace( '%([<\[](?:audio|video)[^>\]]*[>\]])\s*%', '$1', $pee );
  448. $pee = preg_replace( '%\s*([<\[]/(?:audio|video)[>\]])%', '$1', $pee );
  449. $pee = preg_replace( '%\s*(<(?:source|track)[^>]*>)\s*%', '$1', $pee );
  450. }
  451. // Collapse line breaks before and after <figcaption> elements.
  452. if ( strpos( $pee, '<figcaption' ) !== false ) {
  453. $pee = preg_replace( '|\s*(<figcaption[^>]*>)|', '$1', $pee );
  454. $pee = preg_replace( '|</figcaption>\s*|', '</figcaption>', $pee );
  455. }
  456. // Remove more than two contiguous line breaks.
  457. $pee = preg_replace("/\n\n+/", "\n\n", $pee);
  458. // Split up the contents into an array of strings, separated by double line breaks.
  459. $pees = preg_split('/\n\s*\n/', $pee, -1, PREG_SPLIT_NO_EMPTY);
  460. // Reset $pee prior to rebuilding.
  461. $pee = '';
  462. // Rebuild the content as a string, wrapping every bit with a <p>.
  463. foreach ( $pees as $tinkle ) {
  464. $pee .= '<p>' . trim($tinkle, "\n") . "</p>\n";
  465. }
  466. // Under certain strange conditions it could create a P of entirely whitespace.
  467. $pee = preg_replace('|<p>\s*</p>|', '', $pee);
  468. // Add a closing <p> inside <div>, <address>, or <form> tag if missing.
  469. $pee = preg_replace('!<p>([^<]+)</(div|address|form)>!', "<p>$1</p></$2>", $pee);
  470. // If an opening or closing block element tag is wrapped in a <p>, unwrap it.
  471. $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
  472. // In some cases <li> may get wrapped in <p>, fix them.
  473. $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee);
  474. // If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.
  475. $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee);
  476. $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
  477. // If an opening or closing block element tag is preceded by an opening <p> tag, remove it.
  478. $pee = preg_replace('!<p>\s*(</?' . $allblocks . '[^>]*>)!', "$1", $pee);
  479. // If an opening or closing block element tag is followed by a closing <p> tag, remove it.
  480. $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*</p>!', "$1", $pee);
  481. // Optionally insert line breaks.
  482. if ( $br ) {
  483. // Replace newlines that shouldn't be touched with a placeholder.
  484. $pee = preg_replace_callback('/<(script|style).*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee);
  485. // Normalize <br>
  486. $pee = str_replace( array( '<br>', '<br/>' ), '<br />', $pee );
  487. // Replace any new line characters that aren't preceded by a <br /> with a <br />.
  488. $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee);
  489. // Replace newline placeholders with newlines.
  490. $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
  491. }
  492. // If a <br /> tag is after an opening or closing block tag, remove it.
  493. $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\s*<br />!', "$1", $pee);
  494. // If a <br /> tag is before a subset of opening or closing block tags, remove it.
  495. $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
  496. $pee = preg_replace( "|\n</p>$|", '</p>', $pee );
  497. // Replace placeholder <pre> tags with their original content.
  498. if ( !empty($pre_tags) )
  499. $pee = str_replace(array_keys($pre_tags), array_values($pre_tags), $pee);
  500. // Restore newlines in all elements.
  501. if ( false !== strpos( $pee, '<!-- wpnl -->' ) ) {
  502. $pee = str_replace( array( ' <!-- wpnl --> ', '<!-- wpnl -->' ), "\n", $pee );
  503. }
  504. return $pee;
  505. }
  506. /**
  507. * Separate HTML elements and comments from the text.
  508. *
  509. * @since 4.2.4
  510. *
  511. * @param string $input The text which has to be formatted.
  512. * @return array The formatted text.
  513. */
  514. function wp_html_split( $input ) {
  515. return preg_split( get_html_split_regex(), $input, -1, PREG_SPLIT_DELIM_CAPTURE );
  516. }
  517. /**
  518. * Retrieve the regular expression for an HTML element.
  519. *
  520. * @since 4.4.0
  521. *
  522. * @staticvar string $regex
  523. *
  524. * @return string The regular expression
  525. */
  526. function get_html_split_regex() {
  527. static $regex;
  528. if ( ! isset( $regex ) ) {
  529. $comments =
  530. '!' // Start of comment, after the <.
  531. . '(?:' // Unroll the loop: Consume everything until --> is found.
  532. . '-(?!->)' // Dash not followed by end of comment.
  533. . '[^\-]*+' // Consume non-dashes.
  534. . ')*+' // Loop possessively.
  535. . '(?:-->)?'; // End of comment. If not found, match all input.
  536. $cdata =
  537. '!\[CDATA\[' // Start of comment, after the <.
  538. . '[^\]]*+' // Consume non-].
  539. . '(?:' // Unroll the loop: Consume everything until ]]> is found.
  540. . '](?!]>)' // One ] not followed by end of comment.
  541. . '[^\]]*+' // Consume non-].
  542. . ')*+' // Loop possessively.
  543. . '(?:]]>)?'; // End of comment. If not found, match all input.
  544. $escaped =
  545. '(?=' // Is the element escaped?
  546. . '!--'
  547. . '|'
  548. . '!\[CDATA\['
  549. . ')'
  550. . '(?(?=!-)' // If yes, which type?
  551. . $comments
  552. . '|'
  553. . $cdata
  554. . ')';
  555. $regex =
  556. '/(' // Capture the entire match.
  557. . '<' // Find start of element.
  558. . '(?' // Conditional expression follows.
  559. . $escaped // Find end of escaped element.
  560. . '|' // ... else ...
  561. . '[^>]*>?' // Find end of normal element.
  562. . ')'
  563. . ')/';
  564. }
  565. return $regex;
  566. }
  567. /**
  568. * Retrieve the combined regular expression for HTML and shortcodes.
  569. *
  570. * @access private
  571. * @ignore
  572. * @internal This function will be removed in 4.5.0 per Shortcode API Roadmap.
  573. * @since 4.4.0
  574. *
  575. * @staticvar string $html_regex
  576. *
  577. * @param string $shortcode_regex The result from _get_wptexturize_shortcode_regex(). Optional.
  578. * @return string The regular expression
  579. */
  580. function _get_wptexturize_split_regex( $shortcode_regex = '' ) {
  581. static $html_regex;
  582. if ( ! isset( $html_regex ) ) {
  583. $comment_regex =
  584. '!' // Start of comment, after the <.
  585. . '(?:' // Unroll the loop: Consume everything until --> is found.
  586. . '-(?!->)' // Dash not followed by end of comment.
  587. . '[^\-]*+' // Consume non-dashes.
  588. . ')*+' // Loop possessively.
  589. . '(?:-->)?'; // End of comment. If not found, match all input.
  590. $html_regex = // Needs replaced with wp_html_split() per Shortcode API Roadmap.
  591. '<' // Find start of element.
  592. . '(?(?=!--)' // Is this a comment?
  593. . $comment_regex // Find end of comment.
  594. . '|'
  595. . '[^>]*>?' // Find end of element. If not found, match all input.
  596. . ')';
  597. }
  598. if ( empty( $shortcode_regex ) ) {
  599. $regex = '/(' . $html_regex . ')/';
  600. } else {
  601. $regex = '/(' . $html_regex . '|' . $shortcode_regex . ')/';
  602. }
  603. return $regex;
  604. }
  605. /**
  606. * Retrieve the regular expression for shortcodes.
  607. *
  608. * @access private
  609. * @ignore
  610. * @internal This function will be removed in 4.5.0 per Shortcode API Roadmap.
  611. * @since 4.4.0
  612. *
  613. * @param array $tagnames List of shortcodes to find.
  614. * @return string The regular expression
  615. */
  616. function _get_wptexturize_shortcode_regex( $tagnames ) {
  617. $tagregexp = join( '|', array_map( 'preg_quote', $tagnames ) );
  618. $tagregexp = "(?:$tagregexp)(?=[\\s\\]\\/])"; // Excerpt of get_shortcode_regex().
  619. $regex =
  620. '\[' // Find start of shortcode.
  621. . '[\/\[]?' // Shortcodes may begin with [/ or [[
  622. . $tagregexp // Only match registered shortcodes, because performance.
  623. . '(?:'
  624. . '[^\[\]<>]+' // Shortcodes do not contain other shortcodes. Quantifier critical.
  625. . '|'
  626. . '<[^\[\]>]*>' // HTML elements permitted. Prevents matching ] before >.
  627. . ')*+' // Possessive critical.
  628. . '\]' // Find end of shortcode.
  629. . '\]?'; // Shortcodes may end with ]]
  630. return $regex;
  631. }
  632. /**
  633. * Replace characters or phrases within HTML elements only.
  634. *
  635. * @since 4.2.3
  636. *
  637. * @param string $haystack The text which has to be formatted.
  638. * @param array $replace_pairs In the form array('from' => 'to', ...).
  639. * @return string The formatted text.
  640. */
  641. function wp_replace_in_html_tags( $haystack, $replace_pairs ) {
  642. // Find all elements.
  643. $textarr = wp_html_split( $haystack );
  644. $changed = false;
  645. // Optimize when searching for one item.
  646. if ( 1 === count( $replace_pairs ) ) {
  647. // Extract $needle and $replace.
  648. foreach ( $replace_pairs as $needle => $replace );
  649. // Loop through delimiters (elements) only.
  650. for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
  651. if ( false !== strpos( $textarr[$i], $needle ) ) {
  652. $textarr[$i] = str_replace( $needle, $replace, $textarr[$i] );
  653. $changed = true;
  654. }
  655. }
  656. } else {
  657. // Extract all $needles.
  658. $needles = array_keys( $replace_pairs );
  659. // Loop through delimiters (elements) only.
  660. for ( $i = 1, $c = count( $textarr ); $i < $c; $i += 2 ) {
  661. foreach ( $needles as $needle ) {
  662. if ( false !== strpos( $textarr[$i], $needle ) ) {
  663. $textarr[$i] = strtr( $textarr[$i], $replace_pairs );
  664. $changed = true;
  665. // After one strtr() break out of the foreach loop and look at next element.
  666. break;
  667. }
  668. }
  669. }
  670. }
  671. if ( $changed ) {
  672. $haystack = implode( $textarr );
  673. }
  674. return $haystack;
  675. }
  676. /**
  677. * Newline preservation help function for wpautop
  678. *
  679. * @since 3.1.0
  680. * @access private
  681. *
  682. * @param array $matches preg_replace_callback matches array
  683. * @return string
  684. */
  685. function _autop_newline_preservation_helper( $matches ) {
  686. return str_replace( "\n", "<WPPreserveNewline />", $matches[0] );
  687. }
  688. /**
  689. * Don't auto-p wrap shortcodes that stand alone
  690. *
  691. * Ensures that shortcodes are not wrapped in `<p>...</p>`.
  692. *
  693. * @since 2.9.0
  694. *
  695. * @global array $shortcode_tags
  696. *
  697. * @param string $pee The content.
  698. * @return string The filtered content.
  699. */
  700. function shortcode_unautop( $pee ) {
  701. global $shortcode_tags;
  702. if ( empty( $shortcode_tags ) || !is_array( $shortcode_tags ) ) {
  703. return $pee;
  704. }
  705. $tagregexp = join( '|', array_map( 'preg_quote', array_keys( $shortcode_tags ) ) );
  706. $spaces = wp_spaces_regexp();
  707. $pattern =
  708. '/'
  709. . '<p>' // Opening paragraph
  710. . '(?:' . $spaces . ')*+' // Optional leading whitespace
  711. . '(' // 1: The shortcode
  712. . '\\[' // Opening bracket
  713. . "($tagregexp)" // 2: Shortcode name
  714. . '(?![\\w-])' // Not followed by word character or hyphen
  715. // Unroll the loop: Inside the opening shortcode tag
  716. . '[^\\]\\/]*' // Not a closing bracket or forward slash
  717. . '(?:'
  718. . '\\/(?!\\])' // A forward slash not followed by a closing bracket
  719. . '[^\\]\\/]*' // Not a closing bracket or forward slash
  720. . ')*?'
  721. . '(?:'
  722. . '\\/\\]' // Self closing tag and closing bracket
  723. . '|'
  724. . '\\]' // Closing bracket
  725. . '(?:' // Unroll the loop: Optionally, anything between the opening and closing shortcode tags
  726. . '[^\\[]*+' // Not an opening bracket
  727. . '(?:'
  728. . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing shortcode tag
  729. . '[^\\[]*+' // Not an opening bracket
  730. . ')*+'
  731. . '\\[\\/\\2\\]' // Closing shortcode tag
  732. . ')?'
  733. . ')'
  734. . ')'
  735. . '(?:' . $spaces . ')*+' // optional trailing whitespace
  736. . '<\\/p>' // closing paragraph
  737. . '/';
  738. return preg_replace( $pattern, '$1', $pee );
  739. }
  740. /**
  741. * Checks to see if a string is utf8 encoded.
  742. *
  743. * NOTE: This function checks for 5-Byte sequences, UTF8
  744. * has Bytes Sequences with a maximum length of 4.
  745. *
  746. * @author bmorel at ssi dot fr (modified)
  747. * @since 1.2.1
  748. *
  749. * @param string $str The string to be checked
  750. * @return bool True if $str fits a UTF-8 model, false otherwise.
  751. */
  752. function seems_utf8( $str ) {
  753. mbstring_binary_safe_encoding();
  754. $length = strlen($str);
  755. reset_mbstring_encoding();
  756. for ($i=0; $i < $length; $i++) {
  757. $c = ord($str[$i]);
  758. if ($c < 0x80) $n = 0; // 0bbbbbbb
  759. elseif (($c & 0xE0) == 0xC0) $n=1; // 110bbbbb
  760. elseif (($c & 0xF0) == 0xE0) $n=2; // 1110bbbb
  761. elseif (($c & 0xF8) == 0xF0) $n=3; // 11110bbb
  762. elseif (($c & 0xFC) == 0xF8) $n=4; // 111110bb
  763. elseif (($c & 0xFE) == 0xFC) $n=5; // 1111110b
  764. else return false; // Does not match any model
  765. for ($j=0; $j<$n; $j++) { // n bytes matching 10bbbbbb follow ?
  766. if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))
  767. return false;
  768. }
  769. }
  770. return true;
  771. }
  772. /**
  773. * Converts a number of special characters into their HTML entities.
  774. *
  775. * Specifically deals with: &, <, >, ", and '.
  776. *
  777. * $quote_style can be set to ENT_COMPAT to encode " to
  778. * &quot;, or ENT_QUOTES to do both. Default is ENT_NOQUOTES where no quotes are encoded.
  779. *
  780. * @since 1.2.2
  781. * @access private
  782. *
  783. * @staticvar string $_charset
  784. *
  785. * @param string $string The text which is to be encoded.
  786. * @param int|string $quote_style Optional. Converts double quotes if set to ENT_COMPAT,
  787. * both single and double if set to ENT_QUOTES or none if set to ENT_NOQUOTES.
  788. * Also compatible with old values; converting single quotes if set to 'single',
  789. * double if set to 'double' or both if otherwise set.
  790. * Default is ENT_NOQUOTES.
  791. * @param string $charset Optional. The character encoding of the string. Default is false.
  792. * @param bool $double_encode Optional. Whether to encode existing html entities. Default is false.
  793. * @return string The encoded text with HTML entities.
  794. */
  795. function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false, $double_encode = false ) {
  796. $string = (string) $string;
  797. if ( 0 === strlen( $string ) )
  798. return '';
  799. // Don't bother if there are no specialchars - saves some processing
  800. if ( ! preg_match( '/[&<>"\']/', $string ) )
  801. return $string;
  802. // Account for the previous behaviour of the function when the $quote_style is not an accepted value
  803. if ( empty( $quote_style ) )
  804. $quote_style = ENT_NOQUOTES;
  805. elseif ( ! in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) )
  806. $quote_style = ENT_QUOTES;
  807. // Store the site charset as a static to avoid multiple calls to wp_load_alloptions()
  808. if ( ! $charset ) {
  809. static $_charset = null;
  810. if ( ! isset( $_charset ) ) {
  811. $alloptions = wp_load_alloptions();
  812. $_charset = isset( $alloptions['blog_charset'] ) ? $alloptions['blog_charset'] : '';
  813. }
  814. $charset = $_charset;
  815. }
  816. if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) )
  817. $charset = 'UTF-8';
  818. $_quote_style = $quote_style;
  819. if ( $quote_style === 'double' ) {
  820. $quote_style = ENT_COMPAT;
  821. $_quote_style = ENT_COMPAT;
  822. } elseif ( $quote_style === 'single' ) {
  823. $quote_style = ENT_NOQUOTES;
  824. }
  825. if ( ! $double_encode ) {
  826. // Guarantee every &entity; is valid, convert &garbage; into &amp;garbage;
  827. // This is required for PHP < 5.4.0 because ENT_HTML401 flag is unavailable.
  828. $string = wp_kses_normalize_entities( $string );
  829. }
  830. $string = @htmlspecialchars( $string, $quote_style, $charset, $double_encode );
  831. // Back-compat.
  832. if ( 'single' === $_quote_style )
  833. $string = str_replace( "'", '&#039;', $string );
  834. return $string;
  835. }
  836. /**
  837. * Converts a number of HTML entities into their special characters.
  838. *
  839. * Specifically deals with: &, <, >, ", and '.
  840. *
  841. * $quote_style can be set to ENT_COMPAT to decode " entities,
  842. * or ENT_QUOTES to do both " and '. Default is ENT_NOQUOTES where no quotes are decoded.
  843. *
  844. * @since 2.8.0
  845. *
  846. * @param string $string The text which is to be decoded.
  847. * @param string|int $quote_style Optional. Converts double quotes if set to ENT_COMPAT,
  848. * both single and double if set to ENT_QUOTES or
  849. * none if set to ENT_NOQUOTES.
  850. * Also compatible with old _wp_specialchars() values;
  851. * converting single quotes if set to 'single',
  852. * double if set to 'double' or both if otherwise set.
  853. * Default is ENT_NOQUOTES.
  854. * @return string The decoded text without HTML entities.
  855. */
  856. function wp_specialchars_decode( $string, $quote_style = ENT_NOQUOTES ) {
  857. $string = (string) $string;
  858. if ( 0 === strlen( $string ) ) {
  859. return '';
  860. }
  861. // Don't bother if there are no entities - saves a lot of processing
  862. if ( strpos( $string, '&' ) === false ) {
  863. return $string;
  864. }
  865. // Match the previous behaviour of _wp_specialchars() when the $quote_style is not an accepted value
  866. if ( empty( $quote_style ) ) {
  867. $quote_style = ENT_NOQUOTES;
  868. } elseif ( !in_array( $quote_style, array( 0, 2, 3, 'single', 'double' ), true ) ) {
  869. $quote_style = ENT_QUOTES;
  870. }
  871. // More complete than get_html_translation_table( HTML_SPECIALCHARS )
  872. $single = array( '&#039;' => '\'', '&#x27;' => '\'' );
  873. $single_preg = array( '/&#0*39;/' => '&#039;', '/&#x0*27;/i' => '&#x27;' );
  874. $double = array( '&quot;' => '"', '&#034;' => '"', '&#x22;' => '"' );
  875. $double_preg = array( '/&#0*34;/' => '&#034;', '/&#x0*22;/i' => '&#x22;' );
  876. $others = array( '&lt;' => '<', '&#060;' => '<', '&gt;' => '>', '&#062;' => '>', '&amp;' => '&', '&#038;' => '&', '&#x26;' => '&' );
  877. $others_preg = array( '/&#0*60;/' => '&#060;', '/&#0*62;/' => '&#062;', '/&#0*38;/' => '&#038;', '/&#x0*26;/i' => '&#x26;' );
  878. if ( $quote_style === ENT_QUOTES ) {
  879. $translation = array_merge( $single, $double, $others );
  880. $translation_preg = array_merge( $single_preg, $double_preg, $others_preg );
  881. } elseif ( $quote_style === ENT_COMPAT || $quote_style === 'double' ) {
  882. $translation = array_merge( $double, $others );
  883. $translation_preg = array_merge( $double_preg, $others_preg );
  884. } elseif ( $quote_style === 'single' ) {
  885. $translation = array_merge( $single, $others );
  886. $translation_preg = array_merge( $single_preg, $others_preg );
  887. } elseif ( $quote_style === ENT_NOQUOTES ) {
  888. $translation = $others;
  889. $translation_preg = $others_preg;
  890. }
  891. // Remove zero padding on numeric entities
  892. $string = preg_replace( array_keys( $translation_preg ), array_values( $translation_preg ), $string );
  893. // Replace characters according to translation table
  894. return strtr( $string, $translation );
  895. }
  896. /**
  897. * Checks for invalid UTF8 in a string.
  898. *
  899. * @since 2.8.0
  900. *
  901. * @staticvar bool $is_utf8
  902. * @staticvar bool $utf8_pcre
  903. *
  904. * @param string $string The text which is to be checked.
  905. * @param bool $strip Optional. Whether to attempt to strip out invalid UTF8. Default is false.
  906. * @return string The checked text.
  907. */
  908. function wp_check_invalid_utf8( $string, $strip = false ) {
  909. $string = (string) $string;
  910. if ( 0 === strlen( $string ) ) {
  911. return '';
  912. }
  913. // Store the site charset as a static to avoid multiple calls to get_option()
  914. static $is_utf8 = null;
  915. if ( ! isset( $is_utf8 ) ) {
  916. $is_utf8 = in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', 'UTF-8' ) );
  917. }
  918. if ( ! $is_utf8 ) {
  919. return $string;
  920. }
  921. // Check for support for utf8 in the installed PCRE library once and store the result in a static
  922. static $utf8_pcre = null;
  923. if ( ! isset( $utf8_pcre ) ) {
  924. $utf8_pcre = @preg_match( '/^./u', 'a' );
  925. }
  926. // We can't demand utf8 in the PCRE installation, so just return the string in those cases
  927. if ( !$utf8_pcre ) {
  928. return $string;
  929. }
  930. // preg_match fails when it encounters invalid UTF8 in $string
  931. if ( 1 === @preg_match( '/^./us', $string ) ) {
  932. return $string;
  933. }
  934. // Attempt to strip the bad chars if requested (not recommended)
  935. if ( $strip && function_exists( 'iconv' ) ) {
  936. return iconv( 'utf-8', 'utf-8', $string );
  937. }
  938. return '';
  939. }
  940. /**
  941. * Encode the Unicode values to be used in the URI.
  942. *
  943. * @since 1.5.0
  944. *
  945. * @param string $utf8_string
  946. * @param int $length Max length of the string
  947. * @return string String with Unicode encoded for URI.
  948. */
  949. function utf8_uri_encode( $utf8_string, $length = 0 ) {
  950. $unicode = '';
  951. $values = array();
  952. $num_octets = 1;
  953. $unicode_length = 0;
  954. mbstring_binary_safe_encoding();
  955. $string_length = strlen( $utf8_string );
  956. reset_mbstring_encoding();
  957. for ($i = 0; $i < $string_length; $i++ ) {
  958. $value = ord( $utf8_string[ $i ] );
  959. if ( $value < 128 ) {
  960. if ( $length && ( $unicode_length >= $length ) )
  961. break;
  962. $unicode .= chr($value);
  963. $unicode_length++;
  964. } else {
  965. if ( count( $values ) == 0 ) {
  966. if ( $value < 224 ) {
  967. $num_octets = 2;
  968. } elseif ( $value < 240 ) {
  969. $num_octets = 3;
  970. } else {
  971. $num_octets = 4;
  972. }
  973. }
  974. $values[] = $value;
  975. if ( $length && ( $unicode_length + ($num_octets * 3) ) > $length )
  976. break;
  977. if ( count( $values ) == $num_octets ) {
  978. for ( $j = 0; $j < $num_octets; $j++ ) {
  979. $unicode .= '%' . dechex( $values[ $j ] );
  980. }
  981. $unicode_length += $num_octets * 3;
  982. $values = array();
  983. $num_octets = 1;
  984. }
  985. }
  986. }
  987. return $unicode;
  988. }
  989. /**
  990. * Converts all accent characters to ASCII characters.
  991. *
  992. * If there are no accent characters, then the string given is just returned.
  993. *
  994. * **Accent characters converted:**
  995. *
  996. * Currency signs:
  997. *
  998. * | Code | Glyph | Replacement | Description |
  999. * | -------- | ----- | ----------- | ------------------- |
  1000. * | U+00A3 | £ | (empty) | British Pound sign |
  1001. * | U+20AC | € | E | Euro sign |
  1002. *
  1003. * Decompositions for Latin-1 Supplement:
  1004. *
  1005. * | Code | Glyph | Replacement | Description |
  1006. * | ------- | ----- | ----------- | -------------------------------------- |
  1007. * | U+00AA | ª | a | Feminine ordinal indicator |
  1008. * | U+00BA | º | o | Masculine ordinal indicator |
  1009. * | U+00C0 | À | A | Latin capital letter A with grave |
  1010. * | U+00C1 | Á | A | Latin capital letter A with acute |
  1011. * | U+00C2 | Â | A | Latin capital letter A with circumflex |
  1012. * | U+00C3 | Ã | A | Latin capital letter A with tilde |
  1013. * | U+00C4 | Ä | A | Latin capital letter A with diaeresis |
  1014. * | U+00C5 | Å | A | Latin capital letter A with ring above |
  1015. * | U+00C6 | Æ | AE | Latin capital letter AE |
  1016. * | U+00C7 | Ç | C | Latin capital letter C with cedilla |
  1017. * | U+00C8 | È | E | Latin capital letter E with grave |
  1018. * | U+00C9 | É | E | Latin capital letter E with acute |
  1019. * | U+00CA | Ê | E | Latin capital letter E with circumflex |
  1020. * | U+00CB | Ë | E | Latin capital letter E with diaeresis |
  1021. * | U+00CC | Ì | I | Latin capital letter I with grave |
  1022. * | U+00CD | Í | I | Latin capital letter I with acute |
  1023. * | U+00CE | Î | I | Latin capital letter I with circumflex |
  1024. * | U+00CF | Ï | I | Latin capital letter I with diaeresis |
  1025. * | U+00D0 | Ð | D | Latin capital letter Eth |
  1026. * | U+00D1 | Ñ | N | Latin capital letter N with tilde |
  1027. * | U+00D2 | Ò | O | Latin capital letter O with grave |
  1028. * | U+00D3 | Ó | O | Latin capital letter O with acute |
  1029. * | U+00D4 | Ô | O | Latin capital letter O with circumflex |
  1030. * | U+00D5 | Õ | O | Latin capital letter O with tilde |
  1031. * | U+00D6 | Ö | O | Latin capital letter O with diaeresis |
  1032. * | U+00D8 | Ø | O | Latin capital letter O with stroke |
  1033. * | U+00D9 | Ù | U | Latin capital letter U with grave |
  1034. * | U+00DA | Ú | U | Latin capital letter U with acute |
  1035. * | U+00DB | Û | U | Latin capital letter U with circumflex |
  1036. * | U+00DC | Ü | U | Latin capital letter U with diaeresis |
  1037. * | U+00DD | Ý | Y | Latin capital letter Y with acute |
  1038. * | U+00DE | Þ | TH | Latin capital letter Thorn |
  1039. * | U+00DF | ß | s | Latin small letter sharp s |
  1040. * | U+00E0 | à | a | Latin small letter a with grave |
  1041. * | U+00E1 | á | a | Latin small letter a with acute |
  1042. * | U+00E2 | â | a | Latin small letter a with circumflex |
  1043. * | U+00E3 | ã | a | Latin small letter a with tilde |
  1044. * | U+00E4 | ä | a | Latin small letter a with diaeresis |
  1045. * | U+00E5 | å | a | Latin small letter a with ring above |
  1046. * | U+00E6 | æ | ae | Latin small letter ae |
  1047. * | U+00E7 | ç | c | Latin small letter c with cedilla |
  1048. * | U+00E8 | è | e | Latin small letter e with grave |
  1049. * | U+00E9 | é | e | Latin small letter e with acute |
  1050. * | U+00EA | ê | e | Latin small letter e with circumflex |
  1051. * | U+00EB | ë | e | Latin small letter e with diaeresis |
  1052. * | U+00EC | ì | i | Latin small letter i with grave |
  1053. * | U+00ED | í | i | Latin small letter i with acute |
  1054. * | U+00EE | î | i | Latin small letter i with circumflex |
  1055. * | U+00EF | ï | i | Latin small letter i with diaeresis |
  1056. * | U+00F0 | ð | d | Latin small letter Eth |
  1057. * | U+00F1 | ñ | n | Latin small letter n with tilde |
  1058. * | U+00F2 | ò | o | Latin small letter o with grave |
  1059. * | U+00F3 | ó | o | Latin small letter o with acute |
  1060. * | U+00F4 | ô | o | Latin small letter o with circumflex |
  1061. * | U+00F5 | õ | o | Latin small letter o with tilde |
  1062. * | U+00F6 | ö | o | Latin small letter o with diaeresis |
  1063. * | U+00F8 | ø | o | Latin small letter o with stroke |
  1064. * | U+00F9 | ù | u | Latin small letter u with grave |
  1065. * | U+00FA | ú | u | Latin small letter u with acute |
  1066. * | U+00FB | û | u | Latin small letter u with circumflex |
  1067. * | U+00FC | ü | u | Latin small letter u with diaeresis |
  1068. * | U+00FD | ý | y | Latin small letter y with acute |
  1069. * | U+00FE | þ | th | Latin small letter Thorn |
  1070. * | U+00FF | ÿ | y | Latin small letter y with diaeresis |
  1071. *
  1072. * Decompositions for Latin Extended-A:
  1073. *
  1074. * | Code | Glyph | Replacement | Description |
  1075. * | ------- | ----- | ----------- | ------------------------------------------------- |
  1076. * | U+0100 | Ā | A | Latin capital letter A with macron |
  1077. * | U+0101 | ā | a | Latin small letter a with macron |
  1078. * | U+0102 | Ă | A | Latin capital letter A with breve |
  1079. * | U+0103 | ă | a | Latin small letter a with breve |
  1080. * | U+0104 | Ą | A | Latin capital letter A with ogonek |
  1081. * | U+0105 | ą | a | Latin small letter a with ogonek |
  1082. * | U+01006 | Ć | C | Latin capital letter C with acute |
  1083. * | U+0107 | ć | c | Latin small letter c with acute |
  1084. * | U+0108 | Ĉ | C | Latin capital letter C with circumflex |
  1085. * | U+0109 | ĉ | c | Latin small letter c with circumflex |
  1086. * | U+010A | Ċ | C | Latin capital letter C with dot above |
  1087. * | U+010B | ċ | c | Latin small letter c with dot above |
  1088. * | U+010C | Č | C | Latin capital letter C with caron |
  1089. * | U+010D | č | c | Latin small letter c with caron |
  1090. * | U+010E | Ď | D | Latin capital letter D with caron |
  1091. * | U+010F | ď | d | Latin small letter d with caron |
  1092. * | U+0110 | Đ | D | Latin capital letter D with stroke |
  1093. * | U+0111 | đ | d | Latin small letter d with stroke |
  1094. * | U+0112 | Ē | E | Latin capital letter E with macron |
  1095. * | U+0113 | ē | e | Latin small letter e with macron |
  1096. * | U+0114 | Ĕ | E | Latin capital letter E with breve |
  1097. * | U+0115 | ĕ | e | Latin small letter e with breve |
  1098. * | U+0116 | Ė | E | Latin capital letter E with dot above |
  1099. * | U+0117 | ė | e | Latin small letter e with dot above |
  1100. * | U+0118 | Ę | E | Latin capital letter E with ogonek |
  1101. * | U+0119 | ę | e | Latin small letter e with ogonek |
  1102. * | U+011A | Ě | E | Latin capital letter E with caron |
  1103. * | U+011B | ě | e | Latin small letter e with caron |
  1104. * | U+011C | Ĝ | G | Latin capital letter G with circumflex |
  1105. * | U+011D | ĝ | g | Latin small letter g with circumflex |
  1106. * | U+011E | Ğ | G | Latin capital letter G with breve |
  1107. * | U+011F | ğ | g | Latin small letter g with breve |
  1108. * | U+0120 | Ġ | G | Latin capital letter G with dot above |
  1109. * | U+0121 | ġ | g | Latin small letter g with dot above |
  1110. * | U+0122 | Ģ | G | Latin capital letter G with cedilla |
  1111. * | U+0123 | ģ | g | Latin small letter g with cedilla |
  1112. * | U+0124 | Ĥ | H | Latin capital letter H with circumflex |
  1113. * | U+0125 | ĥ | h | Latin small letter h with circumflex |
  1114. * | U+0126 | Ħ | H | Latin capital letter H with stroke |
  1115. * | U+0127 | ħ | h | Latin small letter h with stroke |
  1116. * | U+0128 | Ĩ | I | Latin capital letter I with tilde |
  1117. * | U+0129 | ĩ | i | Latin small letter i with tilde |
  1118. * | U+012A | Ī | I | Latin capital letter I with macron |
  1119. * | U+012B | ī | i | Latin small letter i with macron |
  1120. * | U+012C | Ĭ | I | Latin capital letter I with breve |
  1121. * | U+012D | ĭ | i | Latin small letter i with breve |
  1122. * | U+012E | Į | I | Latin capital letter I with ogonek |
  1123. * | U+012F | į | i | Latin small letter i with ogonek |
  1124. * | U+0130 | İ | I | Latin capital letter I with dot above |
  1125. * | U+0131 | ı | i | Latin small letter dotless i |
  1126. * | U+0132 | IJ | IJ | Latin capital ligature IJ |
  1127. * | U+0133 | ij | ij | Latin small ligature ij |
  1128. * | U+0134 | Ĵ | J | Latin capital letter J with circumflex |
  1129. * | U+0135 | ĵ | j | Latin small letter j with circumflex |
  1130. * | U+0136 | Ķ | K | Latin capital letter K with cedilla |
  1131. * | U+0137 | ķ | k | Latin small letter k with cedilla |
  1132. * | U+0138 | ĸ | k | Latin small letter Kra |
  1133. * | U+0139 | Ĺ | L | Latin capital letter L with acute |
  1134. * | U+013A | ĺ | l | Latin small letter l with acute |
  1135. * | U+013B | Ļ | L | Latin capital letter L with cedilla |
  1136. * | U+013C | ļ | l | Latin small letter l with cedilla |
  1137. * | U+013D | Ľ | L | Latin capital letter L with caron |
  1138. * | U+013E | ľ | l | Latin small letter l with caron |
  1139. * | U+013F | Ŀ | L | Latin capital letter L with middle dot |
  1140. * | U+0140 | ŀ | l | Latin small letter l with middle dot |
  1141. * | U+0141 | Ł | L | Latin capital letter L with stroke |
  1142. * | U+0142 | ł | l | Latin small letter l with stroke |
  1143. * | U+0143 | Ń | N | Latin capital letter N with acute |
  1144. * | U+0144 | ń | n | Latin small letter N with acute |
  1145. * | U+0145 | Ņ | N | Latin capital letter N with cedilla |
  1146. * | U+0146 | ņ | n | Latin small letter n with cedilla |
  1147. * | U+0147 | Ň | N | Latin capital letter N with caron |
  1148. * | U+0148 | ň | n | Latin small letter n with caron |
  1149. * | U+0149 | ʼn | n | Latin small letter n preceded by apostrophe |
  1150. * | U+014A | Ŋ | N | Latin capital letter Eng |
  1151. * | U+014B | ŋ | n | Latin small letter Eng |
  1152. * | U+014C | Ō | O | Latin capital letter O with macron |
  1153. * | U+014D | ō | o | Latin small letter o with macron |
  1154. * | U+014E | Ŏ | O | Latin capital letter O with breve |
  1155. * | U+014F | ŏ | o | Latin small letter o with breve |
  1156. * | U+0150 | Ő | O | Latin capital letter O with double acute |
  1157. * | U+0151 | ő | o | Latin small letter o with double acute |
  1158. * | U+0152 | Œ | OE | Latin capital ligature OE |
  1159. * | U+0153 | œ | oe | Latin small ligature oe |
  1160. * | U+0154 | Ŕ | R | Latin capital letter R with acute |
  1161. * | U+0155 | ŕ | r | Latin small letter r with acute |
  1162. * | U+0156 | Ŗ | R | Latin capital letter R with cedilla |
  1163. * | U+0157 | ŗ | r | Latin small letter r with cedilla |
  1164. * | U+0158 | Ř | R | Latin capital letter R with caron |
  1165. * | U+0159 | ř | r | Latin small letter r with caron |
  1166. * | U+015A | Ś | S | Latin capital letter S with acute |
  1167. * | U+015B | ś | s | Latin small letter s with acute |
  1168. * | U+015C | Ŝ | S | Latin capital letter S with circumflex |
  1169. * | U+015D | ŝ | s | Latin small letter s with circumflex |
  1170. * | U+015E | Ş | S | Latin capital letter S with cedilla |
  1171. * | U+015F | ş | s | Latin small letter s with cedilla |
  1172. * | U+0160 | Š | S | Latin capital letter S with caron |
  1173. * | U+0161 | š | s | Latin small letter s with caron |
  1174. * | U+0162 | Ţ | T | Latin capital letter T with cedilla |
  1175. * | U+0163 | ţ | t | Latin small letter t with cedilla |
  1176. * | U+0164 | Ť | T | Latin capital letter T with caron |
  1177. * | U+0165 | ť | t | Latin small letter t with caron |
  1178. * | U+0166 | Ŧ | T | Latin capital letter T with stroke |
  1179. * | U+0167 | ŧ | t | Latin small letter t with stroke |
  1180. * | U+0168 | Ũ | U | Latin capital letter U with tilde |
  1181. * | U+0169 | ũ | u | Latin small letter u with tilde |
  1182. * | U+016A | Ū | U | Latin capital letter U with macron |
  1183. * | U+016B | ū | u | Latin small letter u with macron |
  1184. * | U+016C | Ŭ | U | Latin capital letter U with breve |
  1185. * | U+016D | ŭ | u | Latin small letter u with breve |
  1186. * | U+016E | Ů | U | Latin capital letter U with ring above |
  1187. * | U+016F | ů | u | Latin small letter u with ring above |
  1188. * | U+0170 | Ű | U | Latin capital letter U with double acute |
  1189. * | U+0171 | ű | u | Latin small letter u with double acute |
  1190. * | U+0172 | Ų | U | Latin capital letter U with ogonek |
  1191. * | U+0173 | ų | u | Latin small letter u with ogonek |
  1192. * | U+0174 | Ŵ | W | Latin capital letter W with circumflex |
  1193. * | U+0175 | ŵ | w | Latin small letter w with circumflex |
  1194. * | U+0176 | Ŷ | Y | Latin capital letter Y with circumflex |
  1195. * | U+0177 | ŷ | y | Latin small letter y with circumflex |
  1196. * | U+0178 | Ÿ | Y | Latin capital letter Y with diaeresis |
  1197. * | U+0179 | Ź | Z | Latin capital letter Z with acute |
  1198. * | U+017A | ź | z | Latin small letter z with acute |
  1199. * | U+017B | Ż | Z | Latin capital letter Z with dot above |
  1200. * | U+017C | ż | z | Latin small letter z with dot above |
  1201. * | U+017D | Ž | Z | Latin capital letter Z with caron |
  1202. * | U+017E | ž | z | Latin small letter z with caron |
  1203. * | U+017F | ſ | s | Latin small letter long s |
  1204. * | U+01A0 | Ơ | O | Latin capital letter O with horn |
  1205. * | U+01A1 | ơ | o | Latin small letter o with horn |
  1206. * | U+01AF | Ư | U | Latin capital letter U with horn |
  1207. * | U+01B0 | ư | u | Latin small letter u with horn |
  1208. * | U+01CD | Ǎ | A | Latin capital letter A with caron |
  1209. * | U+01CE | ǎ | a | Latin small letter a with caron |
  1210. * | U+01CF | Ǐ | I | Latin capital letter I with caron |
  1211. * | U+01D0 | ǐ | i | Latin small letter i with caron |
  1212. * | U+01D1 | Ǒ | O | Latin capital letter O with caron |
  1213. * | U+01D2 | ǒ | o | Latin small letter o with caron |
  1214. * | U+01D3 | Ǔ | U | Latin capital letter U with caron |
  1215. * | U+01D4 | ǔ | u | Latin small letter u with caron |
  1216. * | U+01D5 | Ǖ | U | Latin capital letter U with diaeresis and macron |
  1217. * | U+01D6 | ǖ | u | Latin small letter u with diaeresis and macron |
  1218. * | U+01D7 | Ǘ | U | Latin capital letter U with diaeresis and acute |
  1219. * | U+01D8 | ǘ | u | Latin small letter u with diaeresis and acute |
  1220. * | U+01D9 | Ǚ | U | Latin capital letter U with diaeresis and caron |
  1221. * | U+01DA | ǚ | u | Latin small letter u with diaeresis and caron |
  1222. * | U+01DB | Ǜ | U | Latin capital letter U with diaeresis and grave |
  1223. * | U+01DC | ǜ | u | Latin small letter u with diaeresis and grave |
  1224. *
  1225. * Decompositions for Latin Extended-B:
  1226. *
  1227. * | Code | Glyph | Replacement | Description |
  1228. * | -------- | ----- | ----------- | ----------------------------------------- |
  1229. * | U+0218 | Ș | S | Latin capital letter S with comma below |
  1230. * | U+0219 | ș | s | Latin small letter s with comma below |
  1231. * | U+021A | Ț | T | Latin capital letter T with comma below |
  1232. * | U+021B | ț | t | Latin small letter t with comma below |
  1233. *
  1234. * Vowels with diacritic (Chinese, Hanyu Pinyin):
  1235. *
  1236. * | Code | Glyph | Replacement | Description |
  1237. * | -------- | ----- | ----------- | ----------------------------------------------------- |
  1238. * | U+0251 | ɑ | a | Latin small letter alpha |
  1239. * | U+1EA0 | Ạ | A | Latin capital letter A with dot below |
  1240. * | U+1EA1 | ạ | a | Latin small letter a with dot below |
  1241. * | U+1EA2 | Ả | A | Latin capital letter A with hook above |
  1242. * | U+1EA3 | ả | a | Latin small letter a with hook above |
  1243. * | U+1EA4 | Ấ | A | Latin capital letter A with circumflex and acute |
  1244. * | U+1EA5 | ấ | a | Latin small letter a with circumflex and acute |
  1245. * | U+1EA6 | Ầ | A | Latin capital letter A with circumflex and grave |
  1246. * | U+1EA7 | ầ | a | Latin small letter a with circumflex and grave |
  1247. * | U+1EA8 | Ẩ | A | Latin capital letter A with circumflex and hook above |
  1248. * | U+1EA9 | ẩ | a | Latin small letter a with circumflex and hook above |
  1249. * | U+1EAA | Ẫ | A | Latin capital letter A with circumflex and tilde |
  1250. * | U+1EAB | ẫ | a | Latin small letter a with circumflex and tilde |
  1251. * | U+1EA6 | Ậ | A | Latin capital letter A with circumflex and dot below |
  1252. * | U+1EAD | ậ | a | Latin small letter a with circumflex and dot below |
  1253. * | U+1EAE | Ắ | A | Latin capital letter A with breve and acute |
  1254. * | U+1EAF | ắ | a | Latin small letter a with breve and acute |
  1255. * | U+1EB0 | Ằ | A | Latin capital letter A with breve and grave |
  1256. * | U+1EB1 | ằ | a | Latin small letter a with breve and grave |
  1257. * | U+1EB2 | Ẳ | A | Latin capital letter A with breve and hook above |
  1258. * | U+1EB3 | ẳ | a | Latin small letter a with breve and hook above |
  1259. * | U+1EB4 | Ẵ | A | Latin capital letter A with breve and tilde |
  1260. * | U+1EB5 | ẵ | a | Latin small letter a with breve and tilde |
  1261. * | U+1EB6 | Ặ | A | Latin capital letter A with breve and dot below |
  1262. * | U+1EB7 | ặ | a | Latin small letter a with breve and dot below |
  1263. * | U+1EB8 | Ẹ | E | Latin capital letter E with dot below |
  1264. * | U+1EB9 | ẹ | e | Latin small letter e with dot below |
  1265. * | U+1EBA | Ẻ | E | Latin capital letter E with hook above |
  1266. * | U+1EBB | ẻ | e | Latin small letter e with hook above |
  1267. * | U+1EBC | Ẽ | E | Latin capital letter E with tilde |
  1268. * | U+1EBD | ẽ | e | Latin small letter e with tilde |
  1269. * | U+1EBE | Ế | E | Latin capital letter E with circumflex and acute |
  1270. * | U+1EBF | ế | e | Latin small letter e with circumflex and acute |
  1271. * | U+1EC0 | Ề | E | Latin capital letter E with circumflex and grave |
  1272. * | U+1EC1 | ề | e | Latin small letter e with circumflex and grave |
  1273. * | U+1EC2 | Ể | E | Latin capital letter E with circumflex and hook above |
  1274. * | U+1EC3 | ể | e | Latin small letter e with circumflex and hook above |
  1275. * | U+1EC4 | Ễ | E | Latin capital letter E with circumflex and tilde |
  1276. * | U+1EC5 | ễ | e | Latin small letter e with circumflex and tilde |
  1277. * | U+1EC6 | Ệ | E | Latin capital letter E with circumflex and dot below |
  1278. * | U+1EC7 | ệ | e | Latin small letter e with circumflex and dot below |
  1279. * | U+1EC8 | Ỉ | I | Latin capital letter I with hook above |
  1280. * | U+1EC9 | ỉ | i | Latin small letter i with hook above |
  1281. * | U+1ECA | Ị | I | Latin capital letter I with dot below |
  1282. * | U+1ECB | ị | i | Latin small letter i with dot below |
  1283. * | U+1ECC | Ọ | O | Latin capital letter O with dot below |
  1284. * | U+1ECD | ọ | o | Latin small letter o with dot below |
  1285. * | U+1ECE | Ỏ | O | Latin capital letter O with hook above |
  1286. * | U+1ECF | ỏ | o | Latin small letter o with hook above |
  1287. * | U+1ED0 | Ố | O | Latin capital letter O with circumflex and acute |
  1288. * | U+1ED1 | ố | o | Latin small letter o with circumflex and acute |
  1289. * | U+1ED2 | Ồ | O | Latin capital letter O with circumflex and grave |
  1290. * | U+1ED3 | ồ | o | Latin small letter o with circumflex and grave |
  1291. * | U+1ED4 | Ổ | O | Latin capital letter O with circumflex and hook above |
  1292. * | U+1ED5 | ổ | o | Latin small letter o with circumflex and hook above |
  1293. * | U+1ED6 | Ỗ | O | Latin capital letter O with circumflex and tilde |
  1294. * | U+1ED7 | ỗ | o | Latin small letter o with circumflex and tilde |
  1295. * | U+1ED8 | Ộ | O | Latin capital letter O with circumflex and dot below |
  1296. * | U+1ED9 | ộ | o | Latin small letter o with circumflex and dot below |
  1297. * | U+1EDA | Ớ | O | Latin capital letter O with horn and acute |
  1298. * | U+1EDB | ớ | o | Latin small letter o with horn and acute |
  1299. * | U+1EDC | Ờ | O | Latin capital letter O with horn and grave |
  1300. * | U+1EDD | ờ | o | Latin small letter o with horn and grave |
  1301. * | U+1EDE | Ở | O | Latin capital letter O with horn and hook above |
  1302. * | U+1EDF | ở | o | Latin small letter o with horn and hook above |
  1303. * | U+1EE0 | Ỡ | O | Latin capital letter O with horn and tilde |
  1304. * | U+1EE1 | ỡ | o | Latin small letter o with horn and tilde |
  1305. * | U+1EE2 | Ợ | O | Latin capital letter O with horn and dot below |
  1306. * | U+1EE3 | ợ | o | Latin small letter o with horn and dot below |
  1307. * | U+1EE4 | Ụ | U | Latin capital letter U with dot below |
  1308. * | U+1EE5 | ụ | u | Latin small letter u with dot below |
  1309. * | U+1EE6 | Ủ | U | Latin capital letter U with hook above |
  1310. * | U+1EE7 | ủ | u | Latin small letter u with hook above |
  1311. * | U+1EE8 | Ứ | U | Latin capital letter U with horn and acute |
  1312. * | U+1EE9 | ứ | u | Latin small letter u with horn and acute |
  1313. * | U+1EEA | Ừ | U | Latin capital letter U with horn and grave |
  1314. * | U+1EEB | ừ | u | Latin small letter u with horn and grave |
  1315. * | U+1EEC | Ử | U | Latin capital letter U with horn and hook above |
  1316. * | U+1EED | ử | u | Latin small letter u with horn and hook above |
  1317. * | U+1EEE | Ữ | U | Latin capital letter U with horn and tilde |
  1318. * | U+1EEF | ữ | u | Latin small letter u with horn and tilde |
  1319. * | U+1EF0 | Ự | U | Latin capital letter U with horn and dot below |
  1320. * | U+1EF1 | ự | u | Latin small letter u with horn and dot below |
  1321. * | U+1EF2 | Ỳ | Y | Latin capital letter Y with grave |
  1322. * | U+1EF3 | ỳ | y | Latin small letter y with grave |
  1323. * | U+1EF4 | Ỵ | Y | Latin capital letter Y with dot below |
  1324. * | U+1EF5 | ỵ | y | Latin small letter y with dot below |
  1325. * | U+1EF6 | Ỷ | Y | Latin capital letter Y with hook above |
  1326. * | U+1EF7 | ỷ | y | Latin small letter y with hook above |
  1327. * | U+1EF8 | Ỹ | Y | Latin capital letter Y with tilde |
  1328. * | U+1EF9 | ỹ | y | Latin small letter y with tilde |
  1329. *
  1330. * German (`de_DE`), German formal (`de_DE_formal`), German (Switzerland) formal (`de_CH`),
  1331. * and German (Switzerland) informal (`de_CH_informal`) locales:
  1332. *
  1333. * | Code | Glyph | Replacement | Description |
  1334. * | -------- | ----- | ----------- | --------------------------------------- |
  1335. * | U+00C4 | Ä | Ae | Latin capital letter A with diaeresis |
  1336. * | U+00E4 | ä | ae | Latin small letter a with diaeresis |
  1337. * | U+00D6 | Ö | Oe | Latin capital letter O with diaeresis |
  1338. * | U+00F6 | ö | oe | Latin small letter o with diaeresis |
  1339. * | U+00DC | Ü | Ue | Latin capital letter U with diaeresis |
  1340. * | U+00FC | ü | ue | Latin small letter u with diaeresis |
  1341. * | U+00DF | ß | ss | Latin small letter sharp s |
  1342. *
  1343. * Danish (`da_DK`) locale:
  1344. *
  1345. * | Code | Glyph | Replacement | Description |
  1346. * | -------- | ----- | ----------- | --------------------------------------- |
  1347. * | U+00C6 | Æ | Ae | Latin capital letter AE |
  1348. * | U+00E6 | æ | ae | Latin small letter ae |
  1349. * | U+00D8 | Ø | Oe | Latin capital letter O with stroke |
  1350. * | U+00F8 | ø | oe | Latin small letter o with stroke |
  1351. * | U+00C5 | Å | Aa | Latin capital letter A with ring above |
  1352. * | U+00E5 | å | aa | Latin small letter a with ring above |
  1353. *
  1354. * Catalan (`ca`) locale:
  1355. *
  1356. * | Code | Glyph | Replacement | Description |
  1357. * | -------- | ----- | ----------- | --------------------------------------- |
  1358. * | U+00B7 | l·l | ll | Flown dot (between two Ls) |
  1359. *
  1360. * Serbian (`sr_RS`) and Bosnian (`bs_BA`) locales:
  1361. *
  1362. * | Code | Glyph | Replacement | Description |
  1363. * | -------- | ----- | ----------- | --------------------------------------- |
  1364. * | U+0110 | Đ | DJ | Latin capital letter D with stroke |
  1365. * | U+0111 | đ | dj | Latin small letter d with stroke |
  1366. *
  1367. * @since 1.2.1
  1368. * @since 4.6.0 Added locale support for `de_CH`, `de_CH_informal`, and `ca`.
  1369. * @since 4.7.0 Added locale support for `sr_RS`.
  1370. * @since 4.8.0 Added locale support for `bs_BA`.
  1371. *
  1372. * @param string $string Text that might have accent characters
  1373. * @return string Filtered string with replaced "nice" characters.
  1374. */
  1375. function remove_accents( $string ) {
  1376. if ( !preg_match('/[\x80-\xff]/', $string) )
  1377. return $string;
  1378. if (seems_utf8($string)) {
  1379. $chars = array(
  1380. // Decompositions for Latin-1 Supplement
  1381. 'ª' => 'a', 'º' => 'o',
  1382. 'À' => 'A', 'Á' => 'A',
  1383. 'Â' => 'A', 'Ã' => 'A',
  1384. 'Ä' => 'A', 'Å' => 'A',
  1385. 'Æ' => 'AE','Ç' => 'C',
  1386. 'È' => 'E', 'É' => 'E',
  1387. 'Ê' => 'E', 'Ë' => 'E',
  1388. 'Ì' => 'I', 'Í' => 'I',
  1389. 'Î' => 'I', 'Ï' => 'I',
  1390. 'Ð' => 'D', 'Ñ' => 'N',
  1391. 'Ò' => 'O', 'Ó' => 'O',
  1392. 'Ô' => 'O', 'Õ' => 'O',
  1393. 'Ö' => 'O', 'Ù' => 'U',
  1394. 'Ú' => 'U', 'Û' => 'U',
  1395. 'Ü' => 'U', 'Ý' => 'Y',
  1396. 'Þ' => 'TH','ß' => 's',
  1397. 'à' => 'a', 'á' => 'a',
  1398. 'â' => 'a', 'ã' => 'a',
  1399. 'ä' => 'a', 'å' => 'a',
  1400. 'æ' => 'ae','ç' => 'c',
  1401. 'è' => 'e', 'é' => 'e',
  1402. 'ê' => 'e', 'ë' => 'e',
  1403. 'ì' => 'i', 'í' => 'i',
  1404. 'î' => 'i', 'ï' => 'i',
  1405. 'ð' => 'd', 'ñ' => 'n',
  1406. 'ò' => 'o', 'ó' => 'o',
  1407. 'ô' => 'o', 'õ' => 'o',
  1408. 'ö' => 'o', 'ø' => 'o',
  1409. 'ù' => 'u', 'ú' => 'u',
  1410. 'û' => 'u', 'ü' => 'u',
  1411. 'ý' => 'y', 'þ' => 'th',
  1412. 'ÿ' => 'y', 'Ø' => 'O',
  1413. // Decompositions for Latin Extended-A
  1414. 'Ā' => 'A', 'ā' => 'a',
  1415. 'Ă' => 'A', 'ă' => 'a',
  1416. 'Ą' => 'A', 'ą' => 'a',
  1417. 'Ć' => 'C', 'ć' => 'c',
  1418. 'Ĉ' => 'C', 'ĉ' => 'c',
  1419. 'Ċ' => 'C', 'ċ' => 'c',
  1420. 'Č' => 'C', 'č' => 'c',
  1421. 'Ď' => 'D', 'ď' => 'd',
  1422. 'Đ' => 'D', 'đ' => 'd',
  1423. 'Ē' => 'E', 'ē' => 'e',
  1424. 'Ĕ' => 'E', 'ĕ' => 'e',
  1425. 'Ė' => 'E', 'ė' => 'e',
  1426. 'Ę' => 'E', 'ę' => 'e',
  1427. 'Ě' => 'E', 'ě' => 'e',
  1428. 'Ĝ' => 'G', 'ĝ' => 'g',
  1429. 'Ğ' => 'G', 'ğ' => 'g',
  1430. 'Ġ' => 'G', 'ġ' => 'g',
  1431. 'Ģ' => 'G', 'ģ' => 'g',
  1432. 'Ĥ' => 'H', 'ĥ' => 'h',
  1433. 'Ħ' => 'H', 'ħ' => 'h',
  1434. 'Ĩ' => 'I', 'ĩ' => 'i',
  1435. 'Ī' => 'I', 'ī' => 'i',
  1436. 'Ĭ' => 'I', 'ĭ' => 'i',
  1437. 'Į' => 'I', 'į' => 'i',
  1438. 'İ' => 'I', 'ı' => 'i',
  1439. 'IJ' => 'IJ','ij' => 'ij',
  1440. 'Ĵ' => 'J', 'ĵ' => 'j',
  1441. 'Ķ' => 'K', 'ķ' => 'k',
  1442. 'ĸ' => 'k', 'Ĺ' => 'L',
  1443. 'ĺ' => 'l', 'Ļ' => 'L',
  1444. 'ļ' => 'l', 'Ľ' => 'L',
  1445. 'ľ' => 'l', 'Ŀ' => 'L',
  1446. 'ŀ' => 'l', 'Ł' => 'L',
  1447. 'ł' => 'l', 'Ń' => 'N',
  1448. 'ń' => 'n', 'Ņ' => 'N',
  1449. 'ņ' => 'n', 'Ň' => 'N',
  1450. 'ň' => 'n', 'ʼn' => 'n',
  1451. 'Ŋ' => 'N', 'ŋ' => 'n',
  1452. 'Ō' => 'O', 'ō' => 'o',
  1453. 'Ŏ' => 'O', 'ŏ' => 'o',
  1454. 'Ő' => 'O', 'ő' => 'o',
  1455. 'Œ' => 'OE','œ' => 'oe',
  1456. 'Ŕ' => 'R','ŕ' => 'r',
  1457. 'Ŗ' => 'R','ŗ' => 'r',
  1458. 'Ř' => 'R','ř' => 'r',
  1459. 'Ś' => 'S','ś' => 's',
  1460. 'Ŝ' => 'S','ŝ' => 's',
  1461. 'Ş' => 'S','ş' => 's',
  1462. 'Š' => 'S', 'š' => 's',
  1463. 'Ţ' => 'T', 'ţ' => 't',
  1464. 'Ť' => 'T', 'ť' => 't',
  1465. 'Ŧ' => 'T', 'ŧ' => 't',
  1466. 'Ũ' => 'U', 'ũ' => 'u',
  1467. 'Ū' => 'U', 'ū' => 'u',
  1468. 'Ŭ' => 'U', 'ŭ' => 'u',
  1469. 'Ů' => 'U', 'ů' => 'u',
  1470. 'Ű' => 'U', 'ű' => 'u',
  1471. 'Ų' => 'U', 'ų' => 'u',
  1472. 'Ŵ' => 'W', 'ŵ' => 'w',
  1473. 'Ŷ' => 'Y', 'ŷ' => 'y',
  1474. 'Ÿ' => 'Y', 'Ź' => 'Z',
  1475. 'ź' => 'z', 'Ż' => 'Z',
  1476. 'ż' => 'z', 'Ž' => 'Z',
  1477. 'ž' => 'z', 'ſ' => 's',
  1478. // Decompositions for Latin Extended-B
  1479. 'Ș' => 'S', 'ș' => 's',
  1480. 'Ț' => 'T', 'ț' => 't',
  1481. // Euro Sign
  1482. '€' => 'E',
  1483. // GBP (Pound) Sign
  1484. '£' => '',
  1485. // Vowels with diacritic (Vietnamese)
  1486. // unmarked
  1487. 'Ơ' => 'O', 'ơ' => 'o',
  1488. 'Ư' => 'U', 'ư' => 'u',
  1489. // grave accent
  1490. 'Ầ' => 'A', 'ầ' => 'a',
  1491. 'Ằ' => 'A', 'ằ' => 'a',
  1492. 'Ề' => 'E', 'ề' => 'e',
  1493. 'Ồ' => 'O', 'ồ' => 'o',
  1494. 'Ờ' => 'O', 'ờ' => 'o',
  1495. 'Ừ' => 'U', 'ừ' => 'u',
  1496. 'Ỳ' => 'Y', 'ỳ' => 'y',
  1497. // hook
  1498. 'Ả' => 'A', 'ả' => 'a',
  1499. 'Ẩ' => 'A', 'ẩ' => 'a',
  1500. 'Ẳ' => 'A', 'ẳ' => 'a',
  1501. 'Ẻ' => 'E', 'ẻ' => 'e',
  1502. 'Ể' => 'E', 'ể' => 'e',
  1503. 'Ỉ' => 'I', 'ỉ' => 'i',
  1504. 'Ỏ' => 'O', 'ỏ' => 'o',
  1505. 'Ổ' => 'O', 'ổ' => 'o',
  1506. 'Ở' => 'O', 'ở' => 'o',
  1507. 'Ủ' => 'U', 'ủ' => 'u',
  1508. 'Ử' => 'U', 'ử' => 'u',
  1509. 'Ỷ' => 'Y', 'ỷ' => 'y',
  1510. // tilde
  1511. 'Ẫ' => 'A', 'ẫ' => 'a',
  1512. 'Ẵ' => 'A', 'ẵ' => 'a',
  1513. 'Ẽ' => 'E', 'ẽ' => 'e',
  1514. 'Ễ' => 'E', 'ễ' => 'e',
  1515. 'Ỗ' => 'O', 'ỗ' => 'o',
  1516. 'Ỡ' => 'O', 'ỡ' => 'o',
  1517. 'Ữ' => 'U', 'ữ' => 'u',
  1518. 'Ỹ' => 'Y', 'ỹ' => 'y',
  1519. // acute accent
  1520. 'Ấ' => 'A', 'ấ' => 'a',
  1521. 'Ắ' => 'A', 'ắ' => 'a',
  1522. 'Ế' => 'E', 'ế' => 'e',
  1523. 'Ố' => 'O', 'ố' => 'o',
  1524. 'Ớ' => 'O', 'ớ' => 'o',
  1525. 'Ứ' => 'U', 'ứ' => 'u',
  1526. // dot below
  1527. 'Ạ' => 'A', 'ạ' => 'a',
  1528. 'Ậ' => 'A', 'ậ' => 'a',
  1529. 'Ặ' => 'A', 'ặ' => 'a',
  1530. 'Ẹ' => 'E', 'ẹ' => 'e',
  1531. 'Ệ' => 'E', 'ệ' => 'e',
  1532. 'Ị' => 'I', 'ị' => 'i',
  1533. 'Ọ' => 'O', 'ọ' => 'o',
  1534. 'Ộ' => 'O', 'ộ' => 'o',
  1535. 'Ợ' => 'O', 'ợ' => 'o',
  1536. 'Ụ' => 'U', 'ụ' => 'u',
  1537. 'Ự' => 'U', 'ự' => 'u',
  1538. 'Ỵ' => 'Y', 'ỵ' => 'y',
  1539. // Vowels with diacritic (Chinese, Hanyu Pinyin)
  1540. 'ɑ' => 'a',
  1541. // macron
  1542. 'Ǖ' => 'U', 'ǖ' => 'u',
  1543. // acute accent
  1544. 'Ǘ' => 'U', 'ǘ' => 'u',
  1545. // caron
  1546. 'Ǎ' => 'A', 'ǎ' => 'a',
  1547. 'Ǐ' => 'I', 'ǐ' => 'i',
  1548. 'Ǒ' => 'O', 'ǒ' => 'o',
  1549. 'Ǔ' => 'U', 'ǔ' => 'u',
  1550. 'Ǚ' => 'U', 'ǚ' => 'u',
  1551. // grave accent
  1552. 'Ǜ' => 'U', 'ǜ' => 'u',
  1553. );
  1554. // Used for locale-specific rules
  1555. $locale = get_locale();
  1556. if ( 'de_DE' == $locale || 'de_DE_formal' == $locale || 'de_CH' == $locale || 'de_CH_informal' == $locale ) {
  1557. $chars[ 'Ä' ] = 'Ae';
  1558. $chars[ 'ä' ] = 'ae';
  1559. $chars[ 'Ö' ] = 'Oe';
  1560. $chars[ 'ö' ] = 'oe';
  1561. $chars[ 'Ü' ] = 'Ue';
  1562. $chars[ 'ü' ] = 'ue';
  1563. $chars[ 'ß' ] = 'ss';
  1564. } elseif ( 'da_DK' === $locale ) {
  1565. $chars[ 'Æ' ] = 'Ae';
  1566. $chars[ 'æ' ] = 'ae';
  1567. $chars[ 'Ø' ] = 'Oe';
  1568. $chars[ 'ø' ] = 'oe';
  1569. $chars[ 'Å' ] = 'Aa';
  1570. $chars[ 'å' ] = 'aa';
  1571. } elseif ( 'ca' === $locale ) {
  1572. $chars[ 'l·l' ] = 'll';
  1573. } elseif ( 'sr_RS' === $locale || 'bs_BA' === $locale ) {
  1574. $chars[ 'Đ' ] = 'DJ';
  1575. $chars[ 'đ' ] = 'dj';
  1576. }
  1577. $string = strtr($string, $chars);
  1578. } else {
  1579. $chars = array();
  1580. // Assume ISO-8859-1 if not UTF-8
  1581. $chars['in'] = "\x80\x83\x8a\x8e\x9a\x9e"
  1582. ."\x9f\xa2\xa5\xb5\xc0\xc1\xc2"
  1583. ."\xc3\xc4\xc5\xc7\xc8\xc9\xca"
  1584. ."\xcb\xcc\xcd\xce\xcf\xd1\xd2"
  1585. ."\xd3\xd4\xd5\xd6\xd8\xd9\xda"
  1586. ."\xdb\xdc\xdd\xe0\xe1\xe2\xe3"
  1587. ."\xe4\xe5\xe7\xe8\xe9\xea\xeb"
  1588. ."\xec\xed\xee\xef\xf1\xf2\xf3"
  1589. ."\xf4\xf5\xf6\xf8\xf9\xfa\xfb"
  1590. ."\xfc\xfd\xff";
  1591. $chars['out'] = "EfSZszYcYuAAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy";
  1592. $string = strtr($string, $chars['in'], $chars['out']);
  1593. $double_chars = array();
  1594. $double_chars['in'] = array("\x8c", "\x9c", "\xc6", "\xd0", "\xde", "\xdf", "\xe6", "\xf0", "\xfe");
  1595. $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th');
  1596. $string = str_replace($double_chars['in'], $double_chars['out'], $string);
  1597. }
  1598. return $string;
  1599. }
  1600. /**
  1601. * Sanitizes a filename, replacing whitespace with dashes.
  1602. *
  1603. * Removes special characters that are illegal in filenames on certain
  1604. * operating systems and special characters requiring special escaping
  1605. * to manipulate at the command line. Replaces spaces and consecutive
  1606. * dashes with a single dash. Trims period, dash and underscore from beginning
  1607. * and end of filename. It is not guaranteed that this function will return a
  1608. * filename that is allowed to be uploaded.
  1609. *
  1610. * @since 2.1.0
  1611. *
  1612. * @param string $filename The filename to be sanitized
  1613. * @return string The sanitized filename
  1614. */
  1615. function sanitize_file_name( $filename ) {
  1616. $filename_raw = $filename;
  1617. $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0));
  1618. /**
  1619. * Filters the list of characters to remove from a filename.
  1620. *
  1621. * @since 2.8.0
  1622. *
  1623. * @param array $special_chars Characters to remove.
  1624. * @param string $filename_raw Filename as it was passed into sanitize_file_name().
  1625. */
  1626. $special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
  1627. $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
  1628. $filename = str_replace( $special_chars, '', $filename );
  1629. $filename = str_replace( array( '%20', '+' ), '-', $filename );
  1630. $filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );
  1631. $filename = trim( $filename, '.-_' );
  1632. if ( false === strpos( $filename, '.' ) ) {
  1633. $mime_types = wp_get_mime_types();
  1634. $filetype = wp_check_filetype( 'test.' . $filename, $mime_types );
  1635. if ( $filetype['ext'] === $filename ) {
  1636. $filename = 'unnamed-file.' . $filetype['ext'];
  1637. }
  1638. }
  1639. // Split the filename into a base and extension[s]
  1640. $parts = explode('.', $filename);
  1641. // Return if only one extension
  1642. if ( count( $parts ) <= 2 ) {
  1643. /**
  1644. * Filters a sanitized filename string.
  1645. *
  1646. * @since 2.8.0
  1647. *
  1648. * @param string $filename Sanitized filename.
  1649. * @param string $filename_raw The filename prior to sanitization.
  1650. */
  1651. return apply_filters( 'sanitize_file_name', $filename, $filename_raw );
  1652. }
  1653. // Process multiple extensions
  1654. $filename = array_shift($parts);
  1655. $extension = array_pop($parts);
  1656. $mimes = get_allowed_mime_types();
  1657. /*
  1658. * Loop over any intermediate extensions. Postfix them with a trailing underscore
  1659. * if they are a 2 - 5 character long alpha string not in the extension whitelist.
  1660. */
  1661. foreach ( (array) $parts as $part) {
  1662. $filename .= '.' . $part;
  1663. if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) {
  1664. $allowed = false;
  1665. foreach ( $mimes as $ext_preg => $mime_match ) {
  1666. $ext_preg = '!^(' . $ext_preg . ')$!i';
  1667. if ( preg_match( $ext_preg, $part ) ) {
  1668. $allowed = true;
  1669. break;
  1670. }
  1671. }
  1672. if ( !$allowed )
  1673. $filename .= '_';
  1674. }
  1675. }
  1676. $filename .= '.' . $extension;
  1677. /** This filter is documented in wp-includes/formatting.php */
  1678. return apply_filters('sanitize_file_name', $filename, $filename_raw);
  1679. }
  1680. /**
  1681. * Sanitizes a username, stripping out unsafe characters.
  1682. *
  1683. * Removes tags, octets, entities, and if strict is enabled, will only keep
  1684. * alphanumeric, _, space, ., -, @. After sanitizing, it passes the username,
  1685. * raw username (the username in the parameter), and the value of $strict as
  1686. * parameters for the {@see 'sanitize_user'} filter.
  1687. *
  1688. * @since 2.0.0
  1689. *
  1690. * @param string $username The username to be sanitized.
  1691. * @param bool $strict If set limits $username to specific characters. Default false.
  1692. * @return string The sanitized username, after passing through filters.
  1693. */
  1694. function sanitize_user( $username, $strict = false ) {
  1695. $raw_username = $username;
  1696. $username = wp_strip_all_tags( $username );
  1697. $username = remove_accents( $username );
  1698. // Kill octets
  1699. $username = preg_replace( '|%([a-fA-F0-9][a-fA-F0-9])|', '', $username );
  1700. $username = preg_replace( '/&.+?;/', '', $username ); // Kill entities
  1701. // If strict, reduce to ASCII for max portability.
  1702. if ( $strict )
  1703. $username = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $username );
  1704. $username = trim( $username );
  1705. // Consolidate contiguous whitespace
  1706. $username = preg_replace( '|\s+|', ' ', $username );
  1707. /**
  1708. * Filters a sanitized username string.
  1709. *
  1710. * @since 2.0.1
  1711. *
  1712. * @param string $username Sanitized username.
  1713. * @param string $raw_username The username prior to sanitization.
  1714. * @param bool $strict Whether to limit the sanitization to specific characters. Default false.
  1715. */
  1716. return apply_filters( 'sanitize_user', $username, $raw_username, $strict );
  1717. }
  1718. /**
  1719. * Sanitizes a string key.
  1720. *
  1721. * Keys are used as internal identifiers. Lowercase alphanumeric characters, dashes and underscores are allowed.
  1722. *
  1723. * @since 3.0.0
  1724. *
  1725. * @param string $key String key
  1726. * @return string Sanitized key
  1727. */
  1728. function sanitize_key( $key ) {
  1729. $raw_key = $key;
  1730. $key = strtolower( $key );
  1731. $key = preg_replace( '/[^a-z0-9_\-]/', '', $key );
  1732. /**
  1733. * Filters a sanitized key string.
  1734. *
  1735. * @since 3.0.0
  1736. *
  1737. * @param string $key Sanitized key.
  1738. * @param string $raw_key The key prior to sanitization.
  1739. */
  1740. return apply_filters( 'sanitize_key', $key, $raw_key );
  1741. }
  1742. /**
  1743. * Sanitizes a title, or returns a fallback title.
  1744. *
  1745. * Specifically, HTML and PHP tags are stripped. Further actions can be added
  1746. * via the plugin API. If $title is empty and $fallback_title is set, the latter
  1747. * will be used.
  1748. *
  1749. * @since 1.0.0
  1750. *
  1751. * @param string $title The string to be sanitized.
  1752. * @param string $fallback_title Optional. A title to use if $title is empty.
  1753. * @param string $context Optional. The operation for which the string is sanitized
  1754. * @return string The sanitized string.
  1755. */
  1756. function sanitize_title( $title, $fallback_title = '', $context = 'save' ) {
  1757. $raw_title = $title;
  1758. if ( 'save' == $context )
  1759. $title = remove_accents($title);
  1760. /**
  1761. * Filters a sanitized title string.
  1762. *
  1763. * @since 1.2.0
  1764. *
  1765. * @param string $title Sanitized title.
  1766. * @param string $raw_title The title prior to sanitization.
  1767. * @param string $context The context for which the title is being sanitized.
  1768. */
  1769. $title = apply_filters( 'sanitize_title', $title, $raw_title, $context );
  1770. if ( '' === $title || false === $title )
  1771. $title = $fallback_title;
  1772. return $title;
  1773. }
  1774. /**
  1775. * Sanitizes a title with the 'query' context.
  1776. *
  1777. * Used for querying the database for a value from URL.
  1778. *
  1779. * @since 3.1.0
  1780. *
  1781. * @param string $title The string to be sanitized.
  1782. * @return string The sanitized string.
  1783. */
  1784. function sanitize_title_for_query( $title ) {
  1785. return sanitize_title( $title, '', 'query' );
  1786. }
  1787. /**
  1788. * Sanitizes a title, replacing whitespace and a few other characters with dashes.
  1789. *
  1790. * Limits the output to alphanumeric characters, underscore (_) and dash (-).
  1791. * Whitespace becomes a dash.
  1792. *
  1793. * @since 1.2.0
  1794. *
  1795. * @param string $title The title to be sanitized.
  1796. * @param string $raw_title Optional. Not used.
  1797. * @param string $context Optional. The operation for which the string is sanitized.
  1798. * @return string The sanitized title.
  1799. */
  1800. function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'display' ) {
  1801. $title = strip_tags($title);
  1802. // Preserve escaped octets.
  1803. $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
  1804. // Remove percent signs that are not part of an octet.
  1805. $title = str_replace('%', '', $title);
  1806. // Restore octets.
  1807. $title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
  1808. if (seems_utf8($title)) {
  1809. if (function_exists('mb_strtolower')) {
  1810. $title = mb_strtolower($title, 'UTF-8');
  1811. }
  1812. $title = utf8_uri_encode($title, 200);
  1813. }
  1814. $title = strtolower($title);
  1815. if ( 'save' == $context ) {
  1816. // Convert nbsp, ndash and mdash to hyphens
  1817. $title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );
  1818. // Convert nbsp, ndash and mdash HTML entities to hyphens
  1819. $title = str_replace( array( '&nbsp;', '&#160;', '&ndash;', '&#8211;', '&mdash;', '&#8212;' ), '-', $title );
  1820. // Convert forward slash to hyphen
  1821. $title = str_replace( '/', '-', $title );
  1822. // Strip these characters entirely
  1823. $title = str_replace( array(
  1824. // iexcl and iquest
  1825. '%c2%a1', '%c2%bf',
  1826. // angle quotes
  1827. '%c2%ab', '%c2%bb', '%e2%80%b9', '%e2%80%ba',
  1828. // curly quotes
  1829. '%e2%80%98', '%e2%80%99', '%e2%80%9c', '%e2%80%9d',
  1830. '%e2%80%9a', '%e2%80%9b', '%e2%80%9e', '%e2%80%9f',
  1831. // copy, reg, deg, hellip and trade
  1832. '%c2%a9', '%c2%ae', '%c2%b0', '%e2%80%a6', '%e2%84%a2',
  1833. // acute accents
  1834. '%c2%b4', '%cb%8a', '%cc%81', '%cd%81',
  1835. // grave accent, macron, caron
  1836. '%cc%80', '%cc%84', '%cc%8c',
  1837. ), '', $title );
  1838. // Convert times to x
  1839. $title = str_replace( '%c3%97', 'x', $title );
  1840. }
  1841. $title = preg_replace('/&.+?;/', '', $title); // kill entities
  1842. $title = str_replace('.', '-', $title);
  1843. $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
  1844. $title = preg_replace('/\s+/', '-', $title);
  1845. $title = preg_replace('|-+|', '-', $title);
  1846. $title = trim($title, '-');
  1847. return $title;
  1848. }
  1849. /**
  1850. * Ensures a string is a valid SQL 'order by' clause.
  1851. *
  1852. * Accepts one or more columns, with or without a sort order (ASC / DESC).
  1853. * e.g. 'column_1', 'column_1, column_2', 'column_1 ASC, column_2 DESC' etc.
  1854. *
  1855. * Also accepts 'RAND()'.
  1856. *
  1857. * @since 2.5.1
  1858. *
  1859. * @param string $orderby Order by clause to be validated.
  1860. * @return string|false Returns $orderby if valid, false otherwise.
  1861. */
  1862. function sanitize_sql_orderby( $orderby ) {
  1863. if ( preg_match( '/^\s*(([a-z0-9_]+|`[a-z0-9_]+`)(\s+(ASC|DESC))?\s*(,\s*(?=[a-z0-9_`])|$))+$/i', $orderby ) || preg_match( '/^\s*RAND\(\s*\)\s*$/i', $orderby ) ) {
  1864. return $orderby;
  1865. }
  1866. return false;
  1867. }
  1868. /**
  1869. * Sanitizes an HTML classname to ensure it only contains valid characters.
  1870. *
  1871. * Strips the string down to A-Z,a-z,0-9,_,-. If this results in an empty
  1872. * string then it will return the alternative value supplied.
  1873. *
  1874. * @todo Expand to support the full range of CDATA that a class attribute can contain.
  1875. *
  1876. * @since 2.8.0
  1877. *
  1878. * @param string $class The classname to be sanitized
  1879. * @param string $fallback Optional. The value to return if the sanitization ends up as an empty string.
  1880. * Defaults to an empty string.
  1881. * @return string The sanitized value
  1882. */
  1883. function sanitize_html_class( $class, $fallback = '' ) {
  1884. //Strip out any % encoded octets
  1885. $sanitized = preg_replace( '|%[a-fA-F0-9][a-fA-F0-9]|', '', $class );
  1886. //Limit to A-Z,a-z,0-9,_,-
  1887. $sanitized = preg_replace( '/[^A-Za-z0-9_-]/', '', $sanitized );
  1888. if ( '' == $sanitized && $fallback ) {
  1889. return sanitize_html_class( $fallback );
  1890. }
  1891. /**
  1892. * Filters a sanitized HTML class string.
  1893. *
  1894. * @since 2.8.0
  1895. *
  1896. * @param string $sanitized The sanitized HTML class.
  1897. * @param string $class HTML class before sanitization.
  1898. * @param string $fallback The fallback string.
  1899. */
  1900. return apply_filters( 'sanitize_html_class', $sanitized, $class, $fallback );
  1901. }
  1902. /**
  1903. * Converts lone & characters into `&#038;` (a.k.a. `&amp;`)
  1904. *
  1905. * @since 0.71
  1906. *
  1907. * @param string $content String of characters to be converted.
  1908. * @param string $deprecated Not used.
  1909. * @return string Converted string.
  1910. */
  1911. function convert_chars( $content, $deprecated = '' ) {
  1912. if ( ! empty( $deprecated ) ) {
  1913. _deprecated_argument( __FUNCTION__, '0.71' );
  1914. }
  1915. if ( strpos( $content, '&' ) !== false ) {
  1916. $content = preg_replace( '/&([^#])(?![a-z1-4]{1,8};)/i', '&#038;$1', $content );
  1917. }
  1918. return $content;
  1919. }
  1920. /**
  1921. * Converts invalid Unicode references range to valid range.
  1922. *
  1923. * @since 4.3.0
  1924. *
  1925. * @param string $content String with entities that need converting.
  1926. * @return string Converted string.
  1927. */
  1928. function convert_invalid_entities( $content ) {
  1929. $wp_htmltranswinuni = array(
  1930. '&#128;' => '&#8364;', // the Euro sign
  1931. '&#129;' => '',
  1932. '&#130;' => '&#8218;', // these are Windows CP1252 specific characters
  1933. '&#131;' => '&#402;', // they would look weird on non-Windows browsers
  1934. '&#132;' => '&#8222;',
  1935. '&#133;' => '&#8230;',
  1936. '&#134;' => '&#8224;',
  1937. '&#135;' => '&#8225;',
  1938. '&#136;' => '&#710;',
  1939. '&#137;' => '&#8240;',
  1940. '&#138;' => '&#352;',
  1941. '&#139;' => '&#8249;',
  1942. '&#140;' => '&#338;',
  1943. '&#141;' => '',
  1944. '&#142;' => '&#381;',
  1945. '&#143;' => '',
  1946. '&#144;' => '',
  1947. '&#145;' => '&#8216;',
  1948. '&#146;' => '&#8217;',
  1949. '&#147;' => '&#8220;',
  1950. '&#148;' => '&#8221;',
  1951. '&#149;' => '&#8226;',
  1952. '&#150;' => '&#8211;',
  1953. '&#151;' => '&#8212;',
  1954. '&#152;' => '&#732;',
  1955. '&#153;' => '&#8482;',
  1956. '&#154;' => '&#353;',
  1957. '&#155;' => '&#8250;',
  1958. '&#156;' => '&#339;',
  1959. '&#157;' => '',
  1960. '&#158;' => '&#382;',
  1961. '&#159;' => '&#376;'
  1962. );
  1963. if ( strpos( $content, '&#1' ) !== false ) {
  1964. $content = strtr( $content, $wp_htmltranswinuni );
  1965. }
  1966. return $content;
  1967. }
  1968. /**
  1969. * Balances tags if forced to, or if the 'use_balanceTags' option is set to true.
  1970. *
  1971. * @since 0.71
  1972. *
  1973. * @param string $text Text to be balanced
  1974. * @param bool $force If true, forces balancing, ignoring the value of the option. Default false.
  1975. * @return string Balanced text
  1976. */
  1977. function balanceTags( $text, $force = false ) {
  1978. if ( $force || get_option('use_balanceTags') == 1 ) {
  1979. return force_balance_tags( $text );
  1980. } else {
  1981. return $text;
  1982. }
  1983. }
  1984. /**
  1985. * Balances tags of string using a modified stack.
  1986. *
  1987. * @since 2.0.4
  1988. *
  1989. * @author Leonard Lin <leonard@acm.org>
  1990. * @license GPL
  1991. * @copyright November 4, 2001
  1992. * @version 1.1
  1993. * @todo Make better - change loop condition to $text in 1.2
  1994. * @internal Modified by Scott Reilly (coffee2code) 02 Aug 2004
  1995. * 1.1 Fixed handling of append/stack pop order of end text
  1996. * Added Cleaning Hooks
  1997. * 1.0 First Version
  1998. *
  1999. * @param string $text Text to be balanced.
  2000. * @return string Balanced text.
  2001. */
  2002. function force_balance_tags( $text ) {
  2003. $tagstack = array();
  2004. $stacksize = 0;
  2005. $tagqueue = '';
  2006. $newtext = '';
  2007. // Known single-entity/self-closing tags
  2008. $single_tags = array( 'area', 'base', 'basefont', 'br', 'col', 'command', 'embed', 'frame', 'hr', 'img', 'input', 'isindex', 'link', 'meta', 'param', 'source' );
  2009. // Tags that can be immediately nested within themselves
  2010. $nestable_tags = array( 'blockquote', 'div', 'object', 'q', 'span' );
  2011. // WP bug fix for comments - in case you REALLY meant to type '< !--'
  2012. $text = str_replace('< !--', '< !--', $text);
  2013. // WP bug fix for LOVE <3 (and other situations with '<' before a number)
  2014. $text = preg_replace('#<([0-9]{1})#', '&lt;$1', $text);
  2015. while ( preg_match("/<(\/?[\w:]*)\s*([^>]*)>/", $text, $regex) ) {
  2016. $newtext .= $tagqueue;
  2017. $i = strpos($text, $regex[0]);
  2018. $l = strlen($regex[0]);
  2019. // clear the shifter
  2020. $tagqueue = '';
  2021. // Pop or Push
  2022. if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag
  2023. $tag = strtolower(substr($regex[1],1));
  2024. // if too many closing tags
  2025. if ( $stacksize <= 0 ) {
  2026. $tag = '';
  2027. // or close to be safe $tag = '/' . $tag;
  2028. }
  2029. // if stacktop value = tag close value then pop
  2030. elseif ( $tagstack[$stacksize - 1] == $tag ) { // found closing tag
  2031. $tag = '</' . $tag . '>'; // Close Tag
  2032. // Pop
  2033. array_pop( $tagstack );
  2034. $stacksize--;
  2035. } else { // closing tag not at top, search for it
  2036. for ( $j = $stacksize-1; $j >= 0; $j-- ) {
  2037. if ( $tagstack[$j] == $tag ) {
  2038. // add tag to tagqueue
  2039. for ( $k = $stacksize-1; $k >= $j; $k--) {
  2040. $tagqueue .= '</' . array_pop( $tagstack ) . '>';
  2041. $stacksize--;
  2042. }
  2043. break;
  2044. }
  2045. }
  2046. $tag = '';
  2047. }
  2048. } else { // Begin Tag
  2049. $tag = strtolower($regex[1]);
  2050. // Tag Cleaning
  2051. // If it's an empty tag "< >", do nothing
  2052. if ( '' == $tag ) {
  2053. // do nothing
  2054. }
  2055. // ElseIf it presents itself as a self-closing tag...
  2056. elseif ( substr( $regex[2], -1 ) == '/' ) {
  2057. // ...but it isn't a known single-entity self-closing tag, then don't let it be treated as such and
  2058. // immediately close it with a closing tag (the tag will encapsulate no text as a result)
  2059. if ( ! in_array( $tag, $single_tags ) )
  2060. $regex[2] = trim( substr( $regex[2], 0, -1 ) ) . "></$tag";
  2061. }
  2062. // ElseIf it's a known single-entity tag but it doesn't close itself, do so
  2063. elseif ( in_array($tag, $single_tags) ) {
  2064. $regex[2] .= '/';
  2065. }
  2066. // Else it's not a single-entity tag
  2067. else {
  2068. // If the top of the stack is the same as the tag we want to push, close previous tag
  2069. if ( $stacksize > 0 && !in_array($tag, $nestable_tags) && $tagstack[$stacksize - 1] == $tag ) {
  2070. $tagqueue = '</' . array_pop( $tagstack ) . '>';
  2071. $stacksize--;
  2072. }
  2073. $stacksize = array_push( $tagstack, $tag );
  2074. }
  2075. // Attributes
  2076. $attributes = $regex[2];
  2077. if ( ! empty( $attributes ) && $attributes[0] != '>' )
  2078. $attributes = ' ' . $attributes;
  2079. $tag = '<' . $tag . $attributes . '>';
  2080. //If already queuing a close tag, then put this tag on, too
  2081. if ( !empty($tagqueue) ) {
  2082. $tagqueue .= $tag;
  2083. $tag = '';
  2084. }
  2085. }
  2086. $newtext .= substr($text, 0, $i) . $tag;
  2087. $text = substr($text, $i + $l);
  2088. }
  2089. // Clear Tag Queue
  2090. $newtext .= $tagqueue;
  2091. // Add Remaining text
  2092. $newtext .= $text;
  2093. // Empty Stack
  2094. while( $x = array_pop($tagstack) )
  2095. $newtext .= '</' . $x . '>'; // Add remaining tags to close
  2096. // WP fix for the bug with HTML comments
  2097. $newtext = str_replace("< !--","<!--",$newtext);
  2098. $newtext = str_replace("< !--","< !--",$newtext);
  2099. return $newtext;
  2100. }
  2101. /**
  2102. * Acts on text which is about to be edited.
  2103. *
  2104. * The $content is run through esc_textarea(), which uses htmlspecialchars()
  2105. * to convert special characters to HTML entities. If `$richedit` is set to true,
  2106. * it is simply a holder for the {@see 'format_to_edit'} filter.
  2107. *
  2108. * @since 0.71
  2109. * @since 4.4.0 The `$richedit` parameter was renamed to `$rich_text` for clarity.
  2110. *
  2111. * @param string $content The text about to be edited.
  2112. * @param bool $rich_text Optional. Whether `$content` should be considered rich text,
  2113. * in which case it would not be passed through esc_textarea().
  2114. * Default false.
  2115. * @return string The text after the filter (and possibly htmlspecialchars()) has been run.
  2116. */
  2117. function format_to_edit( $content, $rich_text = false ) {
  2118. /**
  2119. * Filters the text to be formatted for editing.
  2120. *
  2121. * @since 1.2.0
  2122. *
  2123. * @param string $content The text, prior to formatting for editing.
  2124. */
  2125. $content = apply_filters( 'format_to_edit', $content );
  2126. if ( ! $rich_text )
  2127. $content = esc_textarea( $content );
  2128. return $content;
  2129. }
  2130. /**
  2131. * Add leading zeros when necessary.
  2132. *
  2133. * If you set the threshold to '4' and the number is '10', then you will get
  2134. * back '0010'. If you set the threshold to '4' and the number is '5000', then you
  2135. * will get back '5000'.
  2136. *
  2137. * Uses sprintf to append the amount of zeros based on the $threshold parameter
  2138. * and the size of the number. If the number is large enough, then no zeros will
  2139. * be appended.
  2140. *
  2141. * @since 0.71
  2142. *
  2143. * @param int $number Number to append zeros to if not greater than threshold.
  2144. * @param int $threshold Digit places number needs to be to not have zeros added.
  2145. * @return string Adds leading zeros to number if needed.
  2146. */
  2147. function zeroise( $number, $threshold ) {
  2148. return sprintf( '%0' . $threshold . 's', $number );
  2149. }
  2150. /**
  2151. * Adds backslashes before letters and before a number at the start of a string.
  2152. *
  2153. * @since 0.71
  2154. *
  2155. * @param string $string Value to which backslashes will be added.
  2156. * @return string String with backslashes inserted.
  2157. */
  2158. function backslashit( $string ) {
  2159. if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' )
  2160. $string = '\\\\' . $string;
  2161. return addcslashes( $string, 'A..Za..z' );
  2162. }
  2163. /**
  2164. * Appends a trailing slash.
  2165. *
  2166. * Will remove trailing forward and backslashes if it exists already before adding
  2167. * a trailing forward slash. This prevents double slashing a string or path.
  2168. *
  2169. * The primary use of this is for paths and thus should be used for paths. It is
  2170. * not restricted to paths and offers no specific path support.
  2171. *
  2172. * @since 1.2.0
  2173. *
  2174. * @param string $string What to add the trailing slash to.
  2175. * @return string String with trailing slash added.
  2176. */
  2177. function trailingslashit( $string ) {
  2178. return untrailingslashit( $string ) . '/';
  2179. }
  2180. /**
  2181. * Removes trailing forward slashes and backslashes if they exist.
  2182. *
  2183. * The primary use of this is for paths and thus should be used for paths. It is
  2184. * not restricted to paths and offers no specific path support.
  2185. *
  2186. * @since 2.2.0
  2187. *
  2188. * @param string $string What to remove the trailing slashes from.
  2189. * @return string String without the trailing slashes.
  2190. */
  2191. function untrailingslashit( $string ) {
  2192. return rtrim( $string, '/\\' );
  2193. }
  2194. /**
  2195. * Adds slashes to escape strings.
  2196. *
  2197. * Slashes will first be removed if magic_quotes_gpc is set, see {@link
  2198. * https://secure.php.net/magic_quotes} for more details.
  2199. *
  2200. * @since 0.71
  2201. *
  2202. * @param string $gpc The string returned from HTTP request data.
  2203. * @return string Returns a string escaped with slashes.
  2204. */
  2205. function addslashes_gpc($gpc) {
  2206. if ( get_magic_quotes_gpc() )
  2207. $gpc = stripslashes($gpc);
  2208. return wp_slash($gpc);
  2209. }
  2210. /**
  2211. * Navigates through an array, object, or scalar, and removes slashes from the values.
  2212. *
  2213. * @since 2.0.0
  2214. *
  2215. * @param mixed $value The value to be stripped.
  2216. * @return mixed Stripped value.
  2217. */
  2218. function stripslashes_deep( $value ) {
  2219. return map_deep( $value, 'stripslashes_from_strings_only' );
  2220. }
  2221. /**
  2222. * Callback function for `stripslashes_deep()` which strips slashes from strings.
  2223. *
  2224. * @since 4.4.0
  2225. *
  2226. * @param mixed $value The array or string to be stripped.
  2227. * @return mixed $value The stripped value.
  2228. */
  2229. function stripslashes_from_strings_only( $value ) {
  2230. return is_string( $value ) ? stripslashes( $value ) : $value;
  2231. }
  2232. /**
  2233. * Navigates through an array, object, or scalar, and encodes the values to be used in a URL.
  2234. *
  2235. * @since 2.2.0
  2236. *
  2237. * @param mixed $value The array or string to be encoded.
  2238. * @return mixed $value The encoded value.
  2239. */
  2240. function urlencode_deep( $value ) {
  2241. return map_deep( $value, 'urlencode' );
  2242. }
  2243. /**
  2244. * Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.
  2245. *
  2246. * @since 3.4.0
  2247. *
  2248. * @param mixed $value The array or string to be encoded.
  2249. * @return mixed $value The encoded value.
  2250. */
  2251. function rawurlencode_deep( $value ) {
  2252. return map_deep( $value, 'rawurlencode' );
  2253. }
  2254. /**
  2255. * Navigates through an array, object, or scalar, and decodes URL-encoded values
  2256. *
  2257. * @since 4.4.0
  2258. *
  2259. * @param mixed $value The array or string to be decoded.
  2260. * @return mixed $value The decoded value.
  2261. */
  2262. function urldecode_deep( $value ) {
  2263. return map_deep( $value, 'urldecode' );
  2264. }
  2265. /**
  2266. * Converts email addresses characters to HTML entities to block spam bots.
  2267. *
  2268. * @since 0.71
  2269. *
  2270. * @param string $email_address Email address.
  2271. * @param int $hex_encoding Optional. Set to 1 to enable hex encoding.
  2272. * @return string Converted email address.
  2273. */
  2274. function antispambot( $email_address, $hex_encoding = 0 ) {
  2275. $email_no_spam_address = '';
  2276. for ( $i = 0, $len = strlen( $email_address ); $i < $len; $i++ ) {
  2277. $j = rand( 0, 1 + $hex_encoding );
  2278. if ( $j == 0 ) {
  2279. $email_no_spam_address .= '&#' . ord( $email_address[$i] ) . ';';
  2280. } elseif ( $j == 1 ) {
  2281. $email_no_spam_address .= $email_address[$i];
  2282. } elseif ( $j == 2 ) {
  2283. $email_no_spam_address .= '%' . zeroise( dechex( ord( $email_address[$i] ) ), 2 );
  2284. }
  2285. }
  2286. return str_replace( '@', '&#64;', $email_no_spam_address );
  2287. }
  2288. /**
  2289. * Callback to convert URI match to HTML A element.
  2290. *
  2291. * This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
  2292. *
  2293. * @since 2.3.2
  2294. * @access private
  2295. *
  2296. * @param array $matches Single Regex Match.
  2297. * @return string HTML A element with URI address.
  2298. */
  2299. function _make_url_clickable_cb( $matches ) {
  2300. $url = $matches[2];
  2301. if ( ')' == $matches[3] && strpos( $url, '(' ) ) {
  2302. // If the trailing character is a closing parethesis, and the URL has an opening parenthesis in it, add the closing parenthesis to the URL.
  2303. // Then we can let the parenthesis balancer do its thing below.
  2304. $url .= $matches[3];
  2305. $suffix = '';
  2306. } else {
  2307. $suffix = $matches[3];
  2308. }
  2309. // Include parentheses in the URL only if paired
  2310. while ( substr_count( $url, '(' ) < substr_count( $url, ')' ) ) {
  2311. $suffix = strrchr( $url, ')' ) . $suffix;
  2312. $url = substr( $url, 0, strrpos( $url, ')' ) );
  2313. }
  2314. $url = esc_url($url);
  2315. if ( empty($url) )
  2316. return $matches[0];
  2317. return $matches[1] . "<a href=\"$url\" rel=\"nofollow\">$url</a>" . $suffix;
  2318. }
  2319. /**
  2320. * Callback to convert URL match to HTML A element.
  2321. *
  2322. * This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
  2323. *
  2324. * @since 2.3.2
  2325. * @access private
  2326. *
  2327. * @param array $matches Single Regex Match.
  2328. * @return string HTML A element with URL address.
  2329. */
  2330. function _make_web_ftp_clickable_cb( $matches ) {
  2331. $ret = '';
  2332. $dest = $matches[2];
  2333. $dest = 'http://' . $dest;
  2334. // removed trailing [.,;:)] from URL
  2335. if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
  2336. $ret = substr($dest, -1);
  2337. $dest = substr($dest, 0, strlen($dest)-1);
  2338. }
  2339. $dest = esc_url($dest);
  2340. if ( empty($dest) )
  2341. return $matches[0];
  2342. return $matches[1] . "<a href=\"$dest\" rel=\"nofollow\">$dest</a>$ret";
  2343. }
  2344. /**
  2345. * Callback to convert email address match to HTML A element.
  2346. *
  2347. * This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
  2348. *
  2349. * @since 2.3.2
  2350. * @access private
  2351. *
  2352. * @param array $matches Single Regex Match.
  2353. * @return string HTML A element with email address.
  2354. */
  2355. function _make_email_clickable_cb( $matches ) {
  2356. $email = $matches[2] . '@' . $matches[3];
  2357. return $matches[1] . "<a href=\"mailto:$email\">$email</a>";
  2358. }
  2359. /**
  2360. * Convert plaintext URI to HTML links.
  2361. *
  2362. * Converts URI, www and ftp, and email addresses. Finishes by fixing links
  2363. * within links.
  2364. *
  2365. * @since 0.71
  2366. *
  2367. * @param string $text Content to convert URIs.
  2368. * @return string Content with converted URIs.
  2369. */
  2370. function make_clickable( $text ) {
  2371. $r = '';
  2372. $textarr = preg_split( '/(<[^<>]+>)/', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // split out HTML tags
  2373. $nested_code_pre = 0; // Keep track of how many levels link is nested inside <pre> or <code>
  2374. foreach ( $textarr as $piece ) {
  2375. if ( preg_match( '|^<code[\s>]|i', $piece ) || preg_match( '|^<pre[\s>]|i', $piece ) || preg_match( '|^<script[\s>]|i', $piece ) || preg_match( '|^<style[\s>]|i', $piece ) )
  2376. $nested_code_pre++;
  2377. elseif ( $nested_code_pre && ( '</code>' === strtolower( $piece ) || '</pre>' === strtolower( $piece ) || '</script>' === strtolower( $piece ) || '</style>' === strtolower( $piece ) ) )
  2378. $nested_code_pre--;
  2379. if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
  2380. $r .= $piece;
  2381. continue;
  2382. }
  2383. // Long strings might contain expensive edge cases ...
  2384. if ( 10000 < strlen( $piece ) ) {
  2385. // ... break it up
  2386. foreach ( _split_str_by_whitespace( $piece, 2100 ) as $chunk ) { // 2100: Extra room for scheme and leading and trailing paretheses
  2387. if ( 2101 < strlen( $chunk ) ) {
  2388. $r .= $chunk; // Too big, no whitespace: bail.
  2389. } else {
  2390. $r .= make_clickable( $chunk );
  2391. }
  2392. }
  2393. } else {
  2394. $ret = " $piece "; // Pad with whitespace to simplify the regexes
  2395. $url_clickable = '~
  2396. ([\\s(<.,;:!?]) # 1: Leading whitespace, or punctuation
  2397. ( # 2: URL
  2398. [\\w]{1,20}+:// # Scheme and hier-part prefix
  2399. (?=\S{1,2000}\s) # Limit to URLs less than about 2000 characters long
  2400. [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]*+ # Non-punctuation URL character
  2401. (?: # Unroll the Loop: Only allow puctuation URL character if followed by a non-punctuation URL character
  2402. [\'.,;:!?)] # Punctuation URL character
  2403. [\\w\\x80-\\xff#%\\~/@\\[\\]*(+=&$-]++ # Non-punctuation URL character
  2404. )*
  2405. )
  2406. (\)?) # 3: Trailing closing parenthesis (for parethesis balancing post processing)
  2407. ~xS'; // The regex is a non-anchored pattern and does not have a single fixed starting character.
  2408. // Tell PCRE to spend more time optimizing since, when used on a page load, it will probably be used several times.
  2409. $ret = preg_replace_callback( $url_clickable, '_make_url_clickable_cb', $ret );
  2410. $ret = preg_replace_callback( '#([\s>])((www|ftp)\.[\w\\x80-\\xff\#$%&~/.\-;:=,?@\[\]+]+)#is', '_make_web_ftp_clickable_cb', $ret );
  2411. $ret = preg_replace_callback( '#([\s>])([.0-9a-z_+-]+)@(([0-9a-z-]+\.)+[0-9a-z]{2,})#i', '_make_email_clickable_cb', $ret );
  2412. $ret = substr( $ret, 1, -1 ); // Remove our whitespace padding.
  2413. $r .= $ret;
  2414. }
  2415. }
  2416. // Cleanup of accidental links within links
  2417. return preg_replace( '#(<a([ \r\n\t]+[^>]+?>|>))<a [^>]+?>([^>]+?)</a></a>#i', "$1$3</a>", $r );
  2418. }
  2419. /**
  2420. * Breaks a string into chunks by splitting at whitespace characters.
  2421. * The length of each returned chunk is as close to the specified length goal as possible,
  2422. * with the caveat that each chunk includes its trailing delimiter.
  2423. * Chunks longer than the goal are guaranteed to not have any inner whitespace.
  2424. *
  2425. * Joining the returned chunks with empty delimiters reconstructs the input string losslessly.
  2426. *
  2427. * Input string must have no null characters (or eventual transformations on output chunks must not care about null characters)
  2428. *
  2429. * _split_str_by_whitespace( "1234 67890 1234 67890a cd 1234 890 123456789 1234567890a 45678 1 3 5 7 90 ", 10 ) ==
  2430. * array (
  2431. * 0 => '1234 67890 ', // 11 characters: Perfect split
  2432. * 1 => '1234 ', // 5 characters: '1234 67890a' was too long
  2433. * 2 => '67890a cd ', // 10 characters: '67890a cd 1234' was too long
  2434. * 3 => '1234 890 ', // 11 characters: Perfect split
  2435. * 4 => '123456789 ', // 10 characters: '123456789 1234567890a' was too long
  2436. * 5 => '1234567890a ', // 12 characters: Too long, but no inner whitespace on which to split
  2437. * 6 => ' 45678 ', // 11 characters: Perfect split
  2438. * 7 => '1 3 5 7 90 ', // 11 characters: End of $string
  2439. * );
  2440. *
  2441. * @since 3.4.0
  2442. * @access private
  2443. *
  2444. * @param string $string The string to split.
  2445. * @param int $goal The desired chunk length.
  2446. * @return array Numeric array of chunks.
  2447. */
  2448. function _split_str_by_whitespace( $string, $goal ) {
  2449. $chunks = array();
  2450. $string_nullspace = strtr( $string, "\r\n\t\v\f ", "\000\000\000\000\000\000" );
  2451. while ( $goal < strlen( $string_nullspace ) ) {
  2452. $pos = strrpos( substr( $string_nullspace, 0, $goal + 1 ), "\000" );
  2453. if ( false === $pos ) {
  2454. $pos = strpos( $string_nullspace, "\000", $goal + 1 );
  2455. if ( false === $pos ) {
  2456. break;
  2457. }
  2458. }
  2459. $chunks[] = substr( $string, 0, $pos + 1 );
  2460. $string = substr( $string, $pos + 1 );
  2461. $string_nullspace = substr( $string_nullspace, $pos + 1 );
  2462. }
  2463. if ( $string ) {
  2464. $chunks[] = $string;
  2465. }
  2466. return $chunks;
  2467. }
  2468. /**
  2469. * Adds rel nofollow string to all HTML A elements in content.
  2470. *
  2471. * @since 1.5.0
  2472. *
  2473. * @param string $text Content that may contain HTML A elements.
  2474. * @return string Converted content.
  2475. */
  2476. function wp_rel_nofollow( $text ) {
  2477. // This is a pre save filter, so text is already escaped.
  2478. $text = stripslashes($text);
  2479. $text = preg_replace_callback('|<a (.+?)>|i', 'wp_rel_nofollow_callback', $text);
  2480. return wp_slash( $text );
  2481. }
  2482. /**
  2483. * Callback to add rel=nofollow string to HTML A element.
  2484. *
  2485. * Will remove already existing rel="nofollow" and rel='nofollow' from the
  2486. * string to prevent from invalidating (X)HTML.
  2487. *
  2488. * @since 2.3.0
  2489. *
  2490. * @param array $matches Single Match
  2491. * @return string HTML A Element with rel nofollow.
  2492. */
  2493. function wp_rel_nofollow_callback( $matches ) {
  2494. $text = $matches[1];
  2495. $atts = wp_kses_hair( $matches[1], wp_allowed_protocols() );
  2496. $rel = 'nofollow';
  2497. if ( ! empty( $atts['href'] ) ) {
  2498. if ( in_array( strtolower( wp_parse_url( $atts['href']['value'], PHP_URL_SCHEME ) ), array( 'http', 'https' ), true ) ) {
  2499. if ( strtolower( wp_parse_url( $atts['href']['value'], PHP_URL_HOST ) ) === strtolower( wp_parse_url( home_url(), PHP_URL_HOST ) ) ) {
  2500. return "<a $text>";
  2501. }
  2502. }
  2503. }
  2504. if ( ! empty( $atts['rel'] ) ) {
  2505. $parts = array_map( 'trim', explode( ' ', $atts['rel']['value'] ) );
  2506. if ( false === array_search( 'nofollow', $parts ) ) {
  2507. $parts[] = 'nofollow';
  2508. }
  2509. $rel = implode( ' ', $parts );
  2510. unset( $atts['rel'] );
  2511. $html = '';
  2512. foreach ( $atts as $name => $value ) {
  2513. if ( isset( $value['vless'] ) && 'y' === $value['vless'] ) {
  2514. $html .= $name . ' ';
  2515. } else {
  2516. $html .= "{$name}=\"" . esc_attr( $value['value'] ) . '" ';
  2517. }
  2518. }
  2519. $text = trim( $html );
  2520. }
  2521. return "<a $text rel=\"" . esc_attr( $rel ) . "\">";
  2522. }
  2523. /**
  2524. * Convert one smiley code to the icon graphic file equivalent.
  2525. *
  2526. * Callback handler for convert_smilies().
  2527. *
  2528. * Looks up one smiley code in the $wpsmiliestrans global array and returns an
  2529. * `<img>` string for that smiley.
  2530. *
  2531. * @since 2.8.0
  2532. *
  2533. * @global array $wpsmiliestrans
  2534. *
  2535. * @param array $matches Single match. Smiley code to convert to image.
  2536. * @return string Image string for smiley.
  2537. */
  2538. function translate_smiley( $matches ) {
  2539. global $wpsmiliestrans;
  2540. if ( count( $matches ) == 0 )
  2541. return '';
  2542. $smiley = trim( reset( $matches ) );
  2543. $img = $wpsmiliestrans[ $smiley ];
  2544. $matches = array();
  2545. $ext = preg_match( '/\.([^.]+)$/', $img, $matches ) ? strtolower( $matches[1] ) : false;
  2546. $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png' );
  2547. // Don't convert smilies that aren't images - they're probably emoji.
  2548. if ( ! in_array( $ext, $image_exts ) ) {
  2549. return $img;
  2550. }
  2551. /**
  2552. * Filters the Smiley image URL before it's used in the image element.
  2553. *
  2554. * @since 2.9.0
  2555. *
  2556. * @param string $smiley_url URL for the smiley image.
  2557. * @param string $img Filename for the smiley image.
  2558. * @param string $site_url Site URL, as returned by site_url().
  2559. */
  2560. $src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
  2561. return sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', esc_url( $src_url ), esc_attr( $smiley ) );
  2562. }
  2563. /**
  2564. * Convert text equivalent of smilies to images.
  2565. *
  2566. * Will only convert smilies if the option 'use_smilies' is true and the global
  2567. * used in the function isn't empty.
  2568. *
  2569. * @since 0.71
  2570. *
  2571. * @global string|array $wp_smiliessearch
  2572. *
  2573. * @param string $text Content to convert smilies from text.
  2574. * @return string Converted content with text smilies replaced with images.
  2575. */
  2576. function convert_smilies( $text ) {
  2577. global $wp_smiliessearch;
  2578. $output = '';
  2579. if ( get_option( 'use_smilies' ) && ! empty( $wp_smiliessearch ) ) {
  2580. // HTML loop taken from texturize function, could possible be consolidated
  2581. $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE ); // capture the tags as well as in between
  2582. $stop = count( $textarr );// loop stuff
  2583. // Ignore proessing of specific tags
  2584. $tags_to_ignore = 'code|pre|style|script|textarea';
  2585. $ignore_block_element = '';
  2586. for ( $i = 0; $i < $stop; $i++ ) {
  2587. $content = $textarr[$i];
  2588. // If we're in an ignore block, wait until we find its closing tag
  2589. if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {
  2590. $ignore_block_element = $matches[1];
  2591. }
  2592. // If it's not a tag and not in ignore block
  2593. if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] ) {
  2594. $content = preg_replace_callback( $wp_smiliessearch, 'translate_smiley', $content );
  2595. }
  2596. // did we exit ignore block
  2597. if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) {
  2598. $ignore_block_element = '';
  2599. }
  2600. $output .= $content;
  2601. }
  2602. } else {
  2603. // return default text.
  2604. $output = $text;
  2605. }
  2606. return $output;
  2607. }
  2608. /**
  2609. * Verifies that an email is valid.
  2610. *
  2611. * Does not grok i18n domains. Not RFC compliant.
  2612. *
  2613. * @since 0.71
  2614. *
  2615. * @param string $email Email address to verify.
  2616. * @param bool $deprecated Deprecated.
  2617. * @return string|bool Either false or the valid email address.
  2618. */
  2619. function is_email( $email, $deprecated = false ) {
  2620. if ( ! empty( $deprecated ) )
  2621. _deprecated_argument( __FUNCTION__, '3.0.0' );
  2622. // Test for the minimum length the email can be
  2623. if ( strlen( $email ) < 6 ) {
  2624. /**
  2625. * Filters whether an email address is valid.
  2626. *
  2627. * This filter is evaluated under several different contexts, such as 'email_too_short',
  2628. * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',
  2629. * 'domain_no_periods', 'sub_hyphen_limits', 'sub_invalid_chars', or no specific context.
  2630. *
  2631. * @since 2.8.0
  2632. *
  2633. * @param bool $is_email Whether the email address has passed the is_email() checks. Default false.
  2634. * @param string $email The email address being checked.
  2635. * @param string $context Context under which the email was tested.
  2636. */
  2637. return apply_filters( 'is_email', false, $email, 'email_too_short' );
  2638. }
  2639. // Test for an @ character after the first position
  2640. if ( strpos( $email, '@', 1 ) === false ) {
  2641. /** This filter is documented in wp-includes/formatting.php */
  2642. return apply_filters( 'is_email', false, $email, 'email_no_at' );
  2643. }
  2644. // Split out the local and domain parts
  2645. list( $local, $domain ) = explode( '@', $email, 2 );
  2646. // LOCAL PART
  2647. // Test for invalid characters
  2648. if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
  2649. /** This filter is documented in wp-includes/formatting.php */
  2650. return apply_filters( 'is_email', false, $email, 'local_invalid_chars' );
  2651. }
  2652. // DOMAIN PART
  2653. // Test for sequences of periods
  2654. if ( preg_match( '/\.{2,}/', $domain ) ) {
  2655. /** This filter is documented in wp-includes/formatting.php */
  2656. return apply_filters( 'is_email', false, $email, 'domain_period_sequence' );
  2657. }
  2658. // Test for leading and trailing periods and whitespace
  2659. if ( trim( $domain, " \t\n\r\0\x0B." ) !== $domain ) {
  2660. /** This filter is documented in wp-includes/formatting.php */
  2661. return apply_filters( 'is_email', false, $email, 'domain_period_limits' );
  2662. }
  2663. // Split the domain into subs
  2664. $subs = explode( '.', $domain );
  2665. // Assume the domain will have at least two subs
  2666. if ( 2 > count( $subs ) ) {
  2667. /** This filter is documented in wp-includes/formatting.php */
  2668. return apply_filters( 'is_email', false, $email, 'domain_no_periods' );
  2669. }
  2670. // Loop through each sub
  2671. foreach ( $subs as $sub ) {
  2672. // Test for leading and trailing hyphens and whitespace
  2673. if ( trim( $sub, " \t\n\r\0\x0B-" ) !== $sub ) {
  2674. /** This filter is documented in wp-includes/formatting.php */
  2675. return apply_filters( 'is_email', false, $email, 'sub_hyphen_limits' );
  2676. }
  2677. // Test for invalid characters
  2678. if ( !preg_match('/^[a-z0-9-]+$/i', $sub ) ) {
  2679. /** This filter is documented in wp-includes/formatting.php */
  2680. return apply_filters( 'is_email', false, $email, 'sub_invalid_chars' );
  2681. }
  2682. }
  2683. // Congratulations your email made it!
  2684. /** This filter is documented in wp-includes/formatting.php */
  2685. return apply_filters( 'is_email', $email, $email, null );
  2686. }
  2687. /**
  2688. * Convert to ASCII from email subjects.
  2689. *
  2690. * @since 1.2.0
  2691. *
  2692. * @param string $string Subject line
  2693. * @return string Converted string to ASCII
  2694. */
  2695. function wp_iso_descrambler( $string ) {
  2696. /* this may only work with iso-8859-1, I'm afraid */
  2697. if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
  2698. return $string;
  2699. } else {
  2700. $subject = str_replace('_', ' ', $matches[2]);
  2701. return preg_replace_callback( '#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject );
  2702. }
  2703. }
  2704. /**
  2705. * Helper function to convert hex encoded chars to ASCII
  2706. *
  2707. * @since 3.1.0
  2708. * @access private
  2709. *
  2710. * @param array $match The preg_replace_callback matches array
  2711. * @return string Converted chars
  2712. */
  2713. function _wp_iso_convert( $match ) {
  2714. return chr( hexdec( strtolower( $match[1] ) ) );
  2715. }
  2716. /**
  2717. * Returns a date in the GMT equivalent.
  2718. *
  2719. * Requires and returns a date in the Y-m-d H:i:s format. If there is a
  2720. * timezone_string available, the date is assumed to be in that timezone,
  2721. * otherwise it simply subtracts the value of the 'gmt_offset' option. Return
  2722. * format can be overridden using the $format parameter.
  2723. *
  2724. * @since 1.2.0
  2725. *
  2726. * @param string $string The date to be converted.
  2727. * @param string $format The format string for the returned date (default is Y-m-d H:i:s)
  2728. * @return string GMT version of the date provided.
  2729. */
  2730. function get_gmt_from_date( $string, $format = 'Y-m-d H:i:s' ) {
  2731. $tz = get_option( 'timezone_string' );
  2732. if ( $tz ) {
  2733. $datetime = date_create( $string, new DateTimeZone( $tz ) );
  2734. if ( ! $datetime ) {
  2735. return gmdate( $format, 0 );
  2736. }
  2737. $datetime->setTimezone( new DateTimeZone( 'UTC' ) );
  2738. $string_gmt = $datetime->format( $format );
  2739. } else {
  2740. if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) ) {
  2741. $datetime = strtotime( $string );
  2742. if ( false === $datetime ) {
  2743. return gmdate( $format, 0 );
  2744. }
  2745. return gmdate( $format, $datetime );
  2746. }
  2747. $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
  2748. $string_gmt = gmdate( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
  2749. }
  2750. return $string_gmt;
  2751. }
  2752. /**
  2753. * Converts a GMT date into the correct format for the blog.
  2754. *
  2755. * Requires and returns a date in the Y-m-d H:i:s format. If there is a
  2756. * timezone_string available, the returned date is in that timezone, otherwise
  2757. * it simply adds the value of gmt_offset. Return format can be overridden
  2758. * using the $format parameter
  2759. *
  2760. * @since 1.2.0
  2761. *
  2762. * @param string $string The date to be converted.
  2763. * @param string $format The format string for the returned date (default is Y-m-d H:i:s)
  2764. * @return string Formatted date relative to the timezone / GMT offset.
  2765. */
  2766. function get_date_from_gmt( $string, $format = 'Y-m-d H:i:s' ) {
  2767. $tz = get_option( 'timezone_string' );
  2768. if ( $tz ) {
  2769. $datetime = date_create( $string, new DateTimeZone( 'UTC' ) );
  2770. if ( ! $datetime )
  2771. return date( $format, 0 );
  2772. $datetime->setTimezone( new DateTimeZone( $tz ) );
  2773. $string_localtime = $datetime->format( $format );
  2774. } else {
  2775. if ( ! preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches) )
  2776. return date( $format, 0 );
  2777. $string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
  2778. $string_localtime = gmdate( $format, $string_time + get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
  2779. }
  2780. return $string_localtime;
  2781. }
  2782. /**
  2783. * Computes an offset in seconds from an iso8601 timezone.
  2784. *
  2785. * @since 1.5.0
  2786. *
  2787. * @param string $timezone Either 'Z' for 0 offset or '±hhmm'.
  2788. * @return int|float The offset in seconds.
  2789. */
  2790. function iso8601_timezone_to_offset( $timezone ) {
  2791. // $timezone is either 'Z' or '[+|-]hhmm'
  2792. if ($timezone == 'Z') {
  2793. $offset = 0;
  2794. } else {
  2795. $sign = (substr($timezone, 0, 1) == '+') ? 1 : -1;
  2796. $hours = intval(substr($timezone, 1, 2));
  2797. $minutes = intval(substr($timezone, 3, 4)) / 60;
  2798. $offset = $sign * HOUR_IN_SECONDS * ($hours + $minutes);
  2799. }
  2800. return $offset;
  2801. }
  2802. /**
  2803. * Converts an iso8601 date to MySQL DateTime format used by post_date[_gmt].
  2804. *
  2805. * @since 1.5.0
  2806. *
  2807. * @param string $date_string Date and time in ISO 8601 format {@link https://en.wikipedia.org/wiki/ISO_8601}.
  2808. * @param string $timezone Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'.
  2809. * @return string The date and time in MySQL DateTime format - Y-m-d H:i:s.
  2810. */
  2811. function iso8601_to_datetime( $date_string, $timezone = 'user' ) {
  2812. $timezone = strtolower($timezone);
  2813. if ($timezone == 'gmt') {
  2814. preg_match('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', $date_string, $date_bits);
  2815. if (!empty($date_bits[7])) { // we have a timezone, so let's compute an offset
  2816. $offset = iso8601_timezone_to_offset($date_bits[7]);
  2817. } else { // we don't have a timezone, so we assume user local timezone (not server's!)
  2818. $offset = HOUR_IN_SECONDS * get_option('gmt_offset');
  2819. }
  2820. $timestamp = gmmktime($date_bits[4], $date_bits[5], $date_bits[6], $date_bits[2], $date_bits[3], $date_bits[1]);
  2821. $timestamp -= $offset;
  2822. return gmdate('Y-m-d H:i:s', $timestamp);
  2823. } elseif ($timezone == 'user') {
  2824. return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string);
  2825. }
  2826. }
  2827. /**
  2828. * Strips out all characters that are not allowable in an email.
  2829. *
  2830. * @since 1.5.0
  2831. *
  2832. * @param string $email Email address to filter.
  2833. * @return string Filtered email address.
  2834. */
  2835. function sanitize_email( $email ) {
  2836. // Test for the minimum length the email can be
  2837. if ( strlen( $email ) < 6 ) {
  2838. /**
  2839. * Filters a sanitized email address.
  2840. *
  2841. * This filter is evaluated under several contexts, including 'email_too_short',
  2842. * 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',
  2843. * 'domain_no_periods', 'domain_no_valid_subs', or no context.
  2844. *
  2845. * @since 2.8.0
  2846. *
  2847. * @param string $email The sanitized email address.
  2848. * @param string $email The email address, as provided to sanitize_email().
  2849. * @param string $message A message to pass to the user.
  2850. */
  2851. return apply_filters( 'sanitize_email', '', $email, 'email_too_short' );
  2852. }
  2853. // Test for an @ character after the first position
  2854. if ( strpos( $email, '@', 1 ) === false ) {
  2855. /** This filter is documented in wp-includes/formatting.php */
  2856. return apply_filters( 'sanitize_email', '', $email, 'email_no_at' );
  2857. }
  2858. // Split out the local and domain parts
  2859. list( $local, $domain ) = explode( '@', $email, 2 );
  2860. // LOCAL PART
  2861. // Test for invalid characters
  2862. $local = preg_replace( '/[^a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]/', '', $local );
  2863. if ( '' === $local ) {
  2864. /** This filter is documented in wp-includes/formatting.php */
  2865. return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );
  2866. }
  2867. // DOMAIN PART
  2868. // Test for sequences of periods
  2869. $domain = preg_replace( '/\.{2,}/', '', $domain );
  2870. if ( '' === $domain ) {
  2871. /** This filter is documented in wp-includes/formatting.php */
  2872. return apply_filters( 'sanitize_email', '', $email, 'domain_period_sequence' );
  2873. }
  2874. // Test for leading and trailing periods and whitespace
  2875. $domain = trim( $domain, " \t\n\r\0\x0B." );
  2876. if ( '' === $domain ) {
  2877. /** This filter is documented in wp-includes/formatting.php */
  2878. return apply_filters( 'sanitize_email', '', $email, 'domain_period_limits' );
  2879. }
  2880. // Split the domain into subs
  2881. $subs = explode( '.', $domain );
  2882. // Assume the domain will have at least two subs
  2883. if ( 2 > count( $subs ) ) {
  2884. /** This filter is documented in wp-includes/formatting.php */
  2885. return apply_filters( 'sanitize_email', '', $email, 'domain_no_periods' );
  2886. }
  2887. // Create an array that will contain valid subs
  2888. $new_subs = array();
  2889. // Loop through each sub
  2890. foreach ( $subs as $sub ) {
  2891. // Test for leading and trailing hyphens
  2892. $sub = trim( $sub, " \t\n\r\0\x0B-" );
  2893. // Test for invalid characters
  2894. $sub = preg_replace( '/[^a-z0-9-]+/i', '', $sub );
  2895. // If there's anything left, add it to the valid subs
  2896. if ( '' !== $sub ) {
  2897. $new_subs[] = $sub;
  2898. }
  2899. }
  2900. // If there aren't 2 or more valid subs
  2901. if ( 2 > count( $new_subs ) ) {
  2902. /** This filter is documented in wp-includes/formatting.php */
  2903. return apply_filters( 'sanitize_email', '', $email, 'domain_no_valid_subs' );
  2904. }
  2905. // Join valid subs into the new domain
  2906. $domain = join( '.', $new_subs );
  2907. // Put the email back together
  2908. $email = $local . '@' . $domain;
  2909. // Congratulations your email made it!
  2910. /** This filter is documented in wp-includes/formatting.php */
  2911. return apply_filters( 'sanitize_email', $email, $email, null );
  2912. }
  2913. /**
  2914. * Determines the difference between two timestamps.
  2915. *
  2916. * The difference is returned in a human readable format such as "1 hour",
  2917. * "5 mins", "2 days".
  2918. *
  2919. * @since 1.5.0
  2920. *
  2921. * @param int $from Unix timestamp from which the difference begins.
  2922. * @param int $to Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
  2923. * @return string Human readable time difference.
  2924. */
  2925. function human_time_diff( $from, $to = '' ) {
  2926. if ( empty( $to ) ) {
  2927. $to = time();
  2928. }
  2929. $diff = (int) abs( $to - $from );
  2930. if ( $diff < HOUR_IN_SECONDS ) {
  2931. $mins = round( $diff / MINUTE_IN_SECONDS );
  2932. if ( $mins <= 1 )
  2933. $mins = 1;
  2934. /* translators: Time difference between two dates, in minutes (min=minute). 1: Number of minutes */
  2935. $since = sprintf( _n( '%s min', '%s mins', $mins ), $mins );
  2936. } elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {
  2937. $hours = round( $diff / HOUR_IN_SECONDS );
  2938. if ( $hours <= 1 )
  2939. $hours = 1;
  2940. /* translators: Time difference between two dates, in hours. 1: Number of hours */
  2941. $since = sprintf( _n( '%s hour', '%s hours', $hours ), $hours );
  2942. } elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {
  2943. $days = round( $diff / DAY_IN_SECONDS );
  2944. if ( $days <= 1 )
  2945. $days = 1;
  2946. /* translators: Time difference between two dates, in days. 1: Number of days */
  2947. $since = sprintf( _n( '%s day', '%s days', $days ), $days );
  2948. } elseif ( $diff < MONTH_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
  2949. $weeks = round( $diff / WEEK_IN_SECONDS );
  2950. if ( $weeks <= 1 )
  2951. $weeks = 1;
  2952. /* translators: Time difference between two dates, in weeks. 1: Number of weeks */
  2953. $since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );
  2954. } elseif ( $diff < YEAR_IN_SECONDS && $diff >= MONTH_IN_SECONDS ) {
  2955. $months = round( $diff / MONTH_IN_SECONDS );
  2956. if ( $months <= 1 )
  2957. $months = 1;
  2958. /* translators: Time difference between two dates, in months. 1: Number of months */
  2959. $since = sprintf( _n( '%s month', '%s months', $months ), $months );
  2960. } elseif ( $diff >= YEAR_IN_SECONDS ) {
  2961. $years = round( $diff / YEAR_IN_SECONDS );
  2962. if ( $years <= 1 )
  2963. $years = 1;
  2964. /* translators: Time difference between two dates, in years. 1: Number of years */
  2965. $since = sprintf( _n( '%s year', '%s years', $years ), $years );
  2966. }
  2967. /**
  2968. * Filters the human readable difference between two timestamps.
  2969. *
  2970. * @since 4.0.0
  2971. *
  2972. * @param string $since The difference in human readable text.
  2973. * @param int $diff The difference in seconds.
  2974. * @param int $from Unix timestamp from which the difference begins.
  2975. * @param int $to Unix timestamp to end the time difference.
  2976. */
  2977. return apply_filters( 'human_time_diff', $since, $diff, $from, $to );
  2978. }
  2979. /**
  2980. * Generates an excerpt from the content, if needed.
  2981. *
  2982. * The excerpt word amount will be 55 words and if the amount is greater than
  2983. * that, then the string ' [&hellip;]' will be appended to the excerpt. If the string
  2984. * is less than 55 words, then the content will be returned as is.
  2985. *
  2986. * The 55 word limit can be modified by plugins/themes using the {@see 'excerpt_length'} filter
  2987. * The ' [&hellip;]' string can be modified by plugins/themes using the {@see 'excerpt_more'} filter
  2988. *
  2989. * @since 1.5.0
  2990. *
  2991. * @param string $text Optional. The excerpt. If set to empty, an excerpt is generated.
  2992. * @return string The excerpt.
  2993. */
  2994. function wp_trim_excerpt( $text = '' ) {
  2995. $raw_excerpt = $text;
  2996. if ( '' == $text ) {
  2997. $text = get_the_content('');
  2998. $text = strip_shortcodes( $text );
  2999. /** This filter is documented in wp-includes/post-template.php */
  3000. $text = apply_filters( 'the_content', $text );
  3001. $text = str_replace(']]>', ']]&gt;', $text);
  3002. /**
  3003. * Filters the number of words in an excerpt.
  3004. *
  3005. * @since 2.7.0
  3006. *
  3007. * @param int $number The number of words. Default 55.
  3008. */
  3009. $excerpt_length = apply_filters( 'excerpt_length', 55 );
  3010. /**
  3011. * Filters the string in the "more" link displayed after a trimmed excerpt.
  3012. *
  3013. * @since 2.9.0
  3014. *
  3015. * @param string $more_string The string shown within the more link.
  3016. */
  3017. $excerpt_more = apply_filters( 'excerpt_more', ' ' . '[&hellip;]' );
  3018. $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
  3019. }
  3020. /**
  3021. * Filters the trimmed excerpt string.
  3022. *
  3023. * @since 2.8.0
  3024. *
  3025. * @param string $text The trimmed text.
  3026. * @param string $raw_excerpt The text prior to trimming.
  3027. */
  3028. return apply_filters( 'wp_trim_excerpt', $text, $raw_excerpt );
  3029. }
  3030. /**
  3031. * Trims text to a certain number of words.
  3032. *
  3033. * This function is localized. For languages that count 'words' by the individual
  3034. * character (such as East Asian languages), the $num_words argument will apply
  3035. * to the number of individual characters.
  3036. *
  3037. * @since 3.3.0
  3038. *
  3039. * @param string $text Text to trim.
  3040. * @param int $num_words Number of words. Default 55.
  3041. * @param string $more Optional. What to append if $text needs to be trimmed. Default '&hellip;'.
  3042. * @return string Trimmed text.
  3043. */
  3044. function wp_trim_words( $text, $num_words = 55, $more = null ) {
  3045. if ( null === $more ) {
  3046. $more = __( '&hellip;' );
  3047. }
  3048. $original_text = $text;
  3049. $text = wp_strip_all_tags( $text );
  3050. /*
  3051. * translators: If your word count is based on single characters (e.g. East Asian characters),
  3052. * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
  3053. * Do not translate into your own language.
  3054. */
  3055. if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
  3056. $text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
  3057. preg_match_all( '/./u', $text, $words_array );
  3058. $words_array = array_slice( $words_array[0], 0, $num_words + 1 );
  3059. $sep = '';
  3060. } else {
  3061. $words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
  3062. $sep = ' ';
  3063. }
  3064. if ( count( $words_array ) > $num_words ) {
  3065. array_pop( $words_array );
  3066. $text = implode( $sep, $words_array );
  3067. $text = $text . $more;
  3068. } else {
  3069. $text = implode( $sep, $words_array );
  3070. }
  3071. /**
  3072. * Filters the text content after words have been trimmed.
  3073. *
  3074. * @since 3.3.0
  3075. *
  3076. * @param string $text The trimmed text.
  3077. * @param int $num_words The number of words to trim the text to. Default 55.
  3078. * @param string $more An optional string to append to the end of the trimmed text, e.g. &hellip;.
  3079. * @param string $original_text The text before it was trimmed.
  3080. */
  3081. return apply_filters( 'wp_trim_words', $text, $num_words, $more, $original_text );
  3082. }
  3083. /**
  3084. * Converts named entities into numbered entities.
  3085. *
  3086. * @since 1.5.1
  3087. *
  3088. * @param string $text The text within which entities will be converted.
  3089. * @return string Text with converted entities.
  3090. */
  3091. function ent2ncr( $text ) {
  3092. /**
  3093. * Filters text before named entities are converted into numbered entities.
  3094. *
  3095. * A non-null string must be returned for the filter to be evaluated.
  3096. *
  3097. * @since 3.3.0
  3098. *
  3099. * @param null $converted_text The text to be converted. Default null.
  3100. * @param string $text The text prior to entity conversion.
  3101. */
  3102. $filtered = apply_filters( 'pre_ent2ncr', null, $text );
  3103. if ( null !== $filtered )
  3104. return $filtered;
  3105. $to_ncr = array(
  3106. '&quot;' => '&#34;',
  3107. '&amp;' => '&#38;',
  3108. '&lt;' => '&#60;',
  3109. '&gt;' => '&#62;',
  3110. '|' => '&#124;',
  3111. '&nbsp;' => '&#160;',
  3112. '&iexcl;' => '&#161;',
  3113. '&cent;' => '&#162;',
  3114. '&pound;' => '&#163;',
  3115. '&curren;' => '&#164;',
  3116. '&yen;' => '&#165;',
  3117. '&brvbar;' => '&#166;',
  3118. '&brkbar;' => '&#166;',
  3119. '&sect;' => '&#167;',
  3120. '&uml;' => '&#168;',
  3121. '&die;' => '&#168;',
  3122. '&copy;' => '&#169;',
  3123. '&ordf;' => '&#170;',
  3124. '&laquo;' => '&#171;',
  3125. '&not;' => '&#172;',
  3126. '&shy;' => '&#173;',
  3127. '&reg;' => '&#174;',
  3128. '&macr;' => '&#175;',
  3129. '&hibar;' => '&#175;',
  3130. '&deg;' => '&#176;',
  3131. '&plusmn;' => '&#177;',
  3132. '&sup2;' => '&#178;',
  3133. '&sup3;' => '&#179;',
  3134. '&acute;' => '&#180;',
  3135. '&micro;' => '&#181;',
  3136. '&para;' => '&#182;',
  3137. '&middot;' => '&#183;',
  3138. '&cedil;' => '&#184;',
  3139. '&sup1;' => '&#185;',
  3140. '&ordm;' => '&#186;',
  3141. '&raquo;' => '&#187;',
  3142. '&frac14;' => '&#188;',
  3143. '&frac12;' => '&#189;',
  3144. '&frac34;' => '&#190;',
  3145. '&iquest;' => '&#191;',
  3146. '&Agrave;' => '&#192;',
  3147. '&Aacute;' => '&#193;',
  3148. '&Acirc;' => '&#194;',
  3149. '&Atilde;' => '&#195;',
  3150. '&Auml;' => '&#196;',
  3151. '&Aring;' => '&#197;',
  3152. '&AElig;' => '&#198;',
  3153. '&Ccedil;' => '&#199;',
  3154. '&Egrave;' => '&#200;',
  3155. '&Eacute;' => '&#201;',
  3156. '&Ecirc;' => '&#202;',
  3157. '&Euml;' => '&#203;',
  3158. '&Igrave;' => '&#204;',
  3159. '&Iacute;' => '&#205;',
  3160. '&Icirc;' => '&#206;',
  3161. '&Iuml;' => '&#207;',
  3162. '&ETH;' => '&#208;',
  3163. '&Ntilde;' => '&#209;',
  3164. '&Ograve;' => '&#210;',
  3165. '&Oacute;' => '&#211;',
  3166. '&Ocirc;' => '&#212;',
  3167. '&Otilde;' => '&#213;',
  3168. '&Ouml;' => '&#214;',
  3169. '&times;' => '&#215;',
  3170. '&Oslash;' => '&#216;',
  3171. '&Ugrave;' => '&#217;',
  3172. '&Uacute;' => '&#218;',
  3173. '&Ucirc;' => '&#219;',
  3174. '&Uuml;' => '&#220;',
  3175. '&Yacute;' => '&#221;',
  3176. '&THORN;' => '&#222;',
  3177. '&szlig;' => '&#223;',
  3178. '&agrave;' => '&#224;',
  3179. '&aacute;' => '&#225;',
  3180. '&acirc;' => '&#226;',
  3181. '&atilde;' => '&#227;',
  3182. '&auml;' => '&#228;',
  3183. '&aring;' => '&#229;',
  3184. '&aelig;' => '&#230;',
  3185. '&ccedil;' => '&#231;',
  3186. '&egrave;' => '&#232;',
  3187. '&eacute;' => '&#233;',
  3188. '&ecirc;' => '&#234;',
  3189. '&euml;' => '&#235;',
  3190. '&igrave;' => '&#236;',
  3191. '&iacute;' => '&#237;',
  3192. '&icirc;' => '&#238;',
  3193. '&iuml;' => '&#239;',
  3194. '&eth;' => '&#240;',
  3195. '&ntilde;' => '&#241;',
  3196. '&ograve;' => '&#242;',
  3197. '&oacute;' => '&#243;',
  3198. '&ocirc;' => '&#244;',
  3199. '&otilde;' => '&#245;',
  3200. '&ouml;' => '&#246;',
  3201. '&divide;' => '&#247;',
  3202. '&oslash;' => '&#248;',
  3203. '&ugrave;' => '&#249;',
  3204. '&uacute;' => '&#250;',
  3205. '&ucirc;' => '&#251;',
  3206. '&uuml;' => '&#252;',
  3207. '&yacute;' => '&#253;',
  3208. '&thorn;' => '&#254;',
  3209. '&yuml;' => '&#255;',
  3210. '&OElig;' => '&#338;',
  3211. '&oelig;' => '&#339;',
  3212. '&Scaron;' => '&#352;',
  3213. '&scaron;' => '&#353;',
  3214. '&Yuml;' => '&#376;',
  3215. '&fnof;' => '&#402;',
  3216. '&circ;' => '&#710;',
  3217. '&tilde;' => '&#732;',
  3218. '&Alpha;' => '&#913;',
  3219. '&Beta;' => '&#914;',
  3220. '&Gamma;' => '&#915;',
  3221. '&Delta;' => '&#916;',
  3222. '&Epsilon;' => '&#917;',
  3223. '&Zeta;' => '&#918;',
  3224. '&Eta;' => '&#919;',
  3225. '&Theta;' => '&#920;',
  3226. '&Iota;' => '&#921;',
  3227. '&Kappa;' => '&#922;',
  3228. '&Lambda;' => '&#923;',
  3229. '&Mu;' => '&#924;',
  3230. '&Nu;' => '&#925;',
  3231. '&Xi;' => '&#926;',
  3232. '&Omicron;' => '&#927;',
  3233. '&Pi;' => '&#928;',
  3234. '&Rho;' => '&#929;',
  3235. '&Sigma;' => '&#931;',
  3236. '&Tau;' => '&#932;',
  3237. '&Upsilon;' => '&#933;',
  3238. '&Phi;' => '&#934;',
  3239. '&Chi;' => '&#935;',
  3240. '&Psi;' => '&#936;',
  3241. '&Omega;' => '&#937;',
  3242. '&alpha;' => '&#945;',
  3243. '&beta;' => '&#946;',
  3244. '&gamma;' => '&#947;',
  3245. '&delta;' => '&#948;',
  3246. '&epsilon;' => '&#949;',
  3247. '&zeta;' => '&#950;',
  3248. '&eta;' => '&#951;',
  3249. '&theta;' => '&#952;',
  3250. '&iota;' => '&#953;',
  3251. '&kappa;' => '&#954;',
  3252. '&lambda;' => '&#955;',
  3253. '&mu;' => '&#956;',
  3254. '&nu;' => '&#957;',
  3255. '&xi;' => '&#958;',
  3256. '&omicron;' => '&#959;',
  3257. '&pi;' => '&#960;',
  3258. '&rho;' => '&#961;',
  3259. '&sigmaf;' => '&#962;',
  3260. '&sigma;' => '&#963;',
  3261. '&tau;' => '&#964;',
  3262. '&upsilon;' => '&#965;',
  3263. '&phi;' => '&#966;',
  3264. '&chi;' => '&#967;',
  3265. '&psi;' => '&#968;',
  3266. '&omega;' => '&#969;',
  3267. '&thetasym;' => '&#977;',
  3268. '&upsih;' => '&#978;',
  3269. '&piv;' => '&#982;',
  3270. '&ensp;' => '&#8194;',
  3271. '&emsp;' => '&#8195;',
  3272. '&thinsp;' => '&#8201;',
  3273. '&zwnj;' => '&#8204;',
  3274. '&zwj;' => '&#8205;',
  3275. '&lrm;' => '&#8206;',
  3276. '&rlm;' => '&#8207;',
  3277. '&ndash;' => '&#8211;',
  3278. '&mdash;' => '&#8212;',
  3279. '&lsquo;' => '&#8216;',
  3280. '&rsquo;' => '&#8217;',
  3281. '&sbquo;' => '&#8218;',
  3282. '&ldquo;' => '&#8220;',
  3283. '&rdquo;' => '&#8221;',
  3284. '&bdquo;' => '&#8222;',
  3285. '&dagger;' => '&#8224;',
  3286. '&Dagger;' => '&#8225;',
  3287. '&bull;' => '&#8226;',
  3288. '&hellip;' => '&#8230;',
  3289. '&permil;' => '&#8240;',
  3290. '&prime;' => '&#8242;',
  3291. '&Prime;' => '&#8243;',
  3292. '&lsaquo;' => '&#8249;',
  3293. '&rsaquo;' => '&#8250;',
  3294. '&oline;' => '&#8254;',
  3295. '&frasl;' => '&#8260;',
  3296. '&euro;' => '&#8364;',
  3297. '&image;' => '&#8465;',
  3298. '&weierp;' => '&#8472;',
  3299. '&real;' => '&#8476;',
  3300. '&trade;' => '&#8482;',
  3301. '&alefsym;' => '&#8501;',
  3302. '&crarr;' => '&#8629;',
  3303. '&lArr;' => '&#8656;',
  3304. '&uArr;' => '&#8657;',
  3305. '&rArr;' => '&#8658;',
  3306. '&dArr;' => '&#8659;',
  3307. '&hArr;' => '&#8660;',
  3308. '&forall;' => '&#8704;',
  3309. '&part;' => '&#8706;',
  3310. '&exist;' => '&#8707;',
  3311. '&empty;' => '&#8709;',
  3312. '&nabla;' => '&#8711;',
  3313. '&isin;' => '&#8712;',
  3314. '&notin;' => '&#8713;',
  3315. '&ni;' => '&#8715;',
  3316. '&prod;' => '&#8719;',
  3317. '&sum;' => '&#8721;',
  3318. '&minus;' => '&#8722;',
  3319. '&lowast;' => '&#8727;',
  3320. '&radic;' => '&#8730;',
  3321. '&prop;' => '&#8733;',
  3322. '&infin;' => '&#8734;',
  3323. '&ang;' => '&#8736;',
  3324. '&and;' => '&#8743;',
  3325. '&or;' => '&#8744;',
  3326. '&cap;' => '&#8745;',
  3327. '&cup;' => '&#8746;',
  3328. '&int;' => '&#8747;',
  3329. '&there4;' => '&#8756;',
  3330. '&sim;' => '&#8764;',
  3331. '&cong;' => '&#8773;',
  3332. '&asymp;' => '&#8776;',
  3333. '&ne;' => '&#8800;',
  3334. '&equiv;' => '&#8801;',
  3335. '&le;' => '&#8804;',
  3336. '&ge;' => '&#8805;',
  3337. '&sub;' => '&#8834;',
  3338. '&sup;' => '&#8835;',
  3339. '&nsub;' => '&#8836;',
  3340. '&sube;' => '&#8838;',
  3341. '&supe;' => '&#8839;',
  3342. '&oplus;' => '&#8853;',
  3343. '&otimes;' => '&#8855;',
  3344. '&perp;' => '&#8869;',
  3345. '&sdot;' => '&#8901;',
  3346. '&lceil;' => '&#8968;',
  3347. '&rceil;' => '&#8969;',
  3348. '&lfloor;' => '&#8970;',
  3349. '&rfloor;' => '&#8971;',
  3350. '&lang;' => '&#9001;',
  3351. '&rang;' => '&#9002;',
  3352. '&larr;' => '&#8592;',
  3353. '&uarr;' => '&#8593;',
  3354. '&rarr;' => '&#8594;',
  3355. '&darr;' => '&#8595;',
  3356. '&harr;' => '&#8596;',
  3357. '&loz;' => '&#9674;',
  3358. '&spades;' => '&#9824;',
  3359. '&clubs;' => '&#9827;',
  3360. '&hearts;' => '&#9829;',
  3361. '&diams;' => '&#9830;'
  3362. );
  3363. return str_replace( array_keys($to_ncr), array_values($to_ncr), $text );
  3364. }
  3365. /**
  3366. * Formats text for the editor.
  3367. *
  3368. * Generally the browsers treat everything inside a textarea as text, but
  3369. * it is still a good idea to HTML entity encode `<`, `>` and `&` in the content.
  3370. *
  3371. * The filter {@see 'format_for_editor'} is applied here. If `$text` is empty the
  3372. * filter will be applied to an empty string.
  3373. *
  3374. * @since 4.3.0
  3375. *
  3376. * @see _WP_Editors::editor()
  3377. *
  3378. * @param string $text The text to be formatted.
  3379. * @param string $default_editor The default editor for the current user.
  3380. * It is usually either 'html' or 'tinymce'.
  3381. * @return string The formatted text after filter is applied.
  3382. */
  3383. function format_for_editor( $text, $default_editor = null ) {
  3384. if ( $text ) {
  3385. $text = htmlspecialchars( $text, ENT_NOQUOTES, get_option( 'blog_charset' ) );
  3386. }
  3387. /**
  3388. * Filters the text after it is formatted for the editor.
  3389. *
  3390. * @since 4.3.0
  3391. *
  3392. * @param string $text The formatted text.
  3393. * @param string $default_editor The default editor for the current user.
  3394. * It is usually either 'html' or 'tinymce'.
  3395. */
  3396. return apply_filters( 'format_for_editor', $text, $default_editor );
  3397. }
  3398. /**
  3399. * Perform a deep string replace operation to ensure the values in $search are no longer present
  3400. *
  3401. * Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
  3402. * e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
  3403. * str_replace would return
  3404. *
  3405. * @since 2.8.1
  3406. * @access private
  3407. *
  3408. * @param string|array $search The value being searched for, otherwise known as the needle.
  3409. * An array may be used to designate multiple needles.
  3410. * @param string $subject The string being searched and replaced on, otherwise known as the haystack.
  3411. * @return string The string with the replaced svalues.
  3412. */
  3413. function _deep_replace( $search, $subject ) {
  3414. $subject = (string) $subject;
  3415. $count = 1;
  3416. while ( $count ) {
  3417. $subject = str_replace( $search, '', $subject, $count );
  3418. }
  3419. return $subject;
  3420. }
  3421. /**
  3422. * Escapes data for use in a MySQL query.
  3423. *
  3424. * Usually you should prepare queries using wpdb::prepare().
  3425. * Sometimes, spot-escaping is required or useful. One example
  3426. * is preparing an array for use in an IN clause.
  3427. *
  3428. * NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string,
  3429. * this prevents certain SQLi attacks from taking place. This change in behaviour
  3430. * may cause issues for code that expects the return value of esc_sql() to be useable
  3431. * for other purposes.
  3432. *
  3433. * @since 2.8.0
  3434. *
  3435. * @global wpdb $wpdb WordPress database abstraction object.
  3436. *
  3437. * @param string|array $data Unescaped data
  3438. * @return string|array Escaped data
  3439. */
  3440. function esc_sql( $data ) {
  3441. global $wpdb;
  3442. return $wpdb->_escape( $data );
  3443. }
  3444. /**
  3445. * Checks and cleans a URL.
  3446. *
  3447. * A number of characters are removed from the URL. If the URL is for displaying
  3448. * (the default behaviour) ampersands are also replaced. The {@see 'clean_url'} filter
  3449. * is applied to the returned cleaned URL.
  3450. *
  3451. * @since 2.8.0
  3452. *
  3453. * @param string $url The URL to be cleaned.
  3454. * @param array $protocols Optional. An array of acceptable protocols.
  3455. * Defaults to return value of wp_allowed_protocols()
  3456. * @param string $_context Private. Use esc_url_raw() for database usage.
  3457. * @return string The cleaned $url after the {@see 'clean_url'} filter is applied.
  3458. */
  3459. function esc_url( $url, $protocols = null, $_context = 'display' ) {
  3460. $original_url = $url;
  3461. if ( '' == $url )
  3462. return $url;
  3463. $url = str_replace( ' ', '%20', $url );
  3464. $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
  3465. if ( '' === $url ) {
  3466. return $url;
  3467. }
  3468. if ( 0 !== stripos( $url, 'mailto:' ) ) {
  3469. $strip = array('%0d', '%0a', '%0D', '%0A');
  3470. $url = _deep_replace($strip, $url);
  3471. }
  3472. $url = str_replace(';//', '://', $url);
  3473. /* If the URL doesn't appear to contain a scheme, we
  3474. * presume it needs http:// prepended (unless a relative
  3475. * link starting with /, # or ? or a php file).
  3476. */
  3477. if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
  3478. ! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
  3479. $url = 'http://' . $url;
  3480. // Replace ampersands and single quotes only when displaying.
  3481. if ( 'display' == $_context ) {
  3482. $url = wp_kses_normalize_entities( $url );
  3483. $url = str_replace( '&amp;', '&#038;', $url );
  3484. $url = str_replace( "'", '&#039;', $url );
  3485. }
  3486. if ( ( false !== strpos( $url, '[' ) ) || ( false !== strpos( $url, ']' ) ) ) {
  3487. $parsed = wp_parse_url( $url );
  3488. $front = '';
  3489. if ( isset( $parsed['scheme'] ) ) {
  3490. $front .= $parsed['scheme'] . '://';
  3491. } elseif ( '/' === $url[0] ) {
  3492. $front .= '//';
  3493. }
  3494. if ( isset( $parsed['user'] ) ) {
  3495. $front .= $parsed['user'];
  3496. }
  3497. if ( isset( $parsed['pass'] ) ) {
  3498. $front .= ':' . $parsed['pass'];
  3499. }
  3500. if ( isset( $parsed['user'] ) || isset( $parsed['pass'] ) ) {
  3501. $front .= '@';
  3502. }
  3503. if ( isset( $parsed['host'] ) ) {
  3504. $front .= $parsed['host'];
  3505. }
  3506. if ( isset( $parsed['port'] ) ) {
  3507. $front .= ':' . $parsed['port'];
  3508. }
  3509. $end_dirty = str_replace( $front, '', $url );
  3510. $end_clean = str_replace( array( '[', ']' ), array( '%5B', '%5D' ), $end_dirty );
  3511. $url = str_replace( $end_dirty, $end_clean, $url );
  3512. }
  3513. if ( '/' === $url[0] ) {
  3514. $good_protocol_url = $url;
  3515. } else {
  3516. if ( ! is_array( $protocols ) )
  3517. $protocols = wp_allowed_protocols();
  3518. $good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
  3519. if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
  3520. return '';
  3521. }
  3522. /**
  3523. * Filters a string cleaned and escaped for output as a URL.
  3524. *
  3525. * @since 2.3.0
  3526. *
  3527. * @param string $good_protocol_url The cleaned URL to be returned.
  3528. * @param string $original_url The URL prior to cleaning.
  3529. * @param string $_context If 'display', replace ampersands and single quotes only.
  3530. */
  3531. return apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );
  3532. }
  3533. /**
  3534. * Performs esc_url() for database usage.
  3535. *
  3536. * @since 2.8.0
  3537. *
  3538. * @param string $url The URL to be cleaned.
  3539. * @param array $protocols An array of acceptable protocols.
  3540. * @return string The cleaned URL.
  3541. */
  3542. function esc_url_raw( $url, $protocols = null ) {
  3543. return esc_url( $url, $protocols, 'db' );
  3544. }
  3545. /**
  3546. * Convert entities, while preserving already-encoded entities.
  3547. *
  3548. * @link https://secure.php.net/htmlentities Borrowed from the PHP Manual user notes.
  3549. *
  3550. * @since 1.2.2
  3551. *
  3552. * @param string $myHTML The text to be converted.
  3553. * @return string Converted text.
  3554. */
  3555. function htmlentities2( $myHTML ) {
  3556. $translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );
  3557. $translation_table[chr(38)] = '&';
  3558. return preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "&amp;", strtr($myHTML, $translation_table) );
  3559. }
  3560. /**
  3561. * Escape single quotes, htmlspecialchar " < > &, and fix line endings.
  3562. *
  3563. * Escapes text strings for echoing in JS. It is intended to be used for inline JS
  3564. * (in a tag attribute, for example onclick="..."). Note that the strings have to
  3565. * be in single quotes. The {@see 'js_escape'} filter is also applied here.
  3566. *
  3567. * @since 2.8.0
  3568. *
  3569. * @param string $text The text to be escaped.
  3570. * @return string Escaped text.
  3571. */
  3572. function esc_js( $text ) {
  3573. $safe_text = wp_check_invalid_utf8( $text );
  3574. $safe_text = _wp_specialchars( $safe_text, ENT_COMPAT );
  3575. $safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes( $safe_text ) );
  3576. $safe_text = str_replace( "\r", '', $safe_text );
  3577. $safe_text = str_replace( "\n", '\\n', addslashes( $safe_text ) );
  3578. /**
  3579. * Filters a string cleaned and escaped for output in JavaScript.
  3580. *
  3581. * Text passed to esc_js() is stripped of invalid or special characters,
  3582. * and properly slashed for output.
  3583. *
  3584. * @since 2.0.6
  3585. *
  3586. * @param string $safe_text The text after it has been escaped.
  3587. * @param string $text The text prior to being escaped.
  3588. */
  3589. return apply_filters( 'js_escape', $safe_text, $text );
  3590. }
  3591. /**
  3592. * Escaping for HTML blocks.
  3593. *
  3594. * @since 2.8.0
  3595. *
  3596. * @param string $text
  3597. * @return string
  3598. */
  3599. function esc_html( $text ) {
  3600. $safe_text = wp_check_invalid_utf8( $text );
  3601. $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
  3602. /**
  3603. * Filters a string cleaned and escaped for output in HTML.
  3604. *
  3605. * Text passed to esc_html() is stripped of invalid or special characters
  3606. * before output.
  3607. *
  3608. * @since 2.8.0
  3609. *
  3610. * @param string $safe_text The text after it has been escaped.
  3611. * @param string $text The text prior to being escaped.
  3612. */
  3613. return apply_filters( 'esc_html', $safe_text, $text );
  3614. }
  3615. /**
  3616. * Escaping for HTML attributes.
  3617. *
  3618. * @since 2.8.0
  3619. *
  3620. * @param string $text
  3621. * @return string
  3622. */
  3623. function esc_attr( $text ) {
  3624. $safe_text = wp_check_invalid_utf8( $text );
  3625. $safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
  3626. /**
  3627. * Filters a string cleaned and escaped for output in an HTML attribute.
  3628. *
  3629. * Text passed to esc_attr() is stripped of invalid or special characters
  3630. * before output.
  3631. *
  3632. * @since 2.0.6
  3633. *
  3634. * @param string $safe_text The text after it has been escaped.
  3635. * @param string $text The text prior to being escaped.
  3636. */
  3637. return apply_filters( 'attribute_escape', $safe_text, $text );
  3638. }
  3639. /**
  3640. * Escaping for textarea values.
  3641. *
  3642. * @since 3.1.0
  3643. *
  3644. * @param string $text
  3645. * @return string
  3646. */
  3647. function esc_textarea( $text ) {
  3648. $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
  3649. /**
  3650. * Filters a string cleaned and escaped for output in a textarea element.
  3651. *
  3652. * @since 3.1.0
  3653. *
  3654. * @param string $safe_text The text after it has been escaped.
  3655. * @param string $text The text prior to being escaped.
  3656. */
  3657. return apply_filters( 'esc_textarea', $safe_text, $text );
  3658. }
  3659. /**
  3660. * Escape an HTML tag name.
  3661. *
  3662. * @since 2.5.0
  3663. *
  3664. * @param string $tag_name
  3665. * @return string
  3666. */
  3667. function tag_escape( $tag_name ) {
  3668. $safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );
  3669. /**
  3670. * Filters a string cleaned and escaped for output as an HTML tag.
  3671. *
  3672. * @since 2.8.0
  3673. *
  3674. * @param string $safe_tag The tag name after it has been escaped.
  3675. * @param string $tag_name The text before it was escaped.
  3676. */
  3677. return apply_filters( 'tag_escape', $safe_tag, $tag_name );
  3678. }
  3679. /**
  3680. * Convert full URL paths to absolute paths.
  3681. *
  3682. * Removes the http or https protocols and the domain. Keeps the path '/' at the
  3683. * beginning, so it isn't a true relative link, but from the web root base.
  3684. *
  3685. * @since 2.1.0
  3686. * @since 4.1.0 Support was added for relative URLs.
  3687. *
  3688. * @param string $link Full URL path.
  3689. * @return string Absolute path.
  3690. */
  3691. function wp_make_link_relative( $link ) {
  3692. return preg_replace( '|^(https?:)?//[^/]+(/?.*)|i', '$2', $link );
  3693. }
  3694. /**
  3695. * Sanitises various option values based on the nature of the option.
  3696. *
  3697. * This is basically a switch statement which will pass $value through a number
  3698. * of functions depending on the $option.
  3699. *
  3700. * @since 2.0.5
  3701. *
  3702. * @global wpdb $wpdb WordPress database abstraction object.
  3703. *
  3704. * @param string $option The name of the option.
  3705. * @param string $value The unsanitised value.
  3706. * @return string Sanitized value.
  3707. */
  3708. function sanitize_option( $option, $value ) {
  3709. global $wpdb;
  3710. $original_value = $value;
  3711. $error = '';
  3712. switch ( $option ) {
  3713. case 'admin_email' :
  3714. case 'new_admin_email' :
  3715. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3716. if ( is_wp_error( $value ) ) {
  3717. $error = $value->get_error_message();
  3718. } else {
  3719. $value = sanitize_email( $value );
  3720. if ( ! is_email( $value ) ) {
  3721. $error = __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' );
  3722. }
  3723. }
  3724. break;
  3725. case 'thumbnail_size_w':
  3726. case 'thumbnail_size_h':
  3727. case 'medium_size_w':
  3728. case 'medium_size_h':
  3729. case 'medium_large_size_w':
  3730. case 'medium_large_size_h':
  3731. case 'large_size_w':
  3732. case 'large_size_h':
  3733. case 'mailserver_port':
  3734. case 'comment_max_links':
  3735. case 'page_on_front':
  3736. case 'page_for_posts':
  3737. case 'rss_excerpt_length':
  3738. case 'default_category':
  3739. case 'default_email_category':
  3740. case 'default_link_category':
  3741. case 'close_comments_days_old':
  3742. case 'comments_per_page':
  3743. case 'thread_comments_depth':
  3744. case 'users_can_register':
  3745. case 'start_of_week':
  3746. case 'site_icon':
  3747. $value = absint( $value );
  3748. break;
  3749. case 'posts_per_page':
  3750. case 'posts_per_rss':
  3751. $value = (int) $value;
  3752. if ( empty($value) )
  3753. $value = 1;
  3754. if ( $value < -1 )
  3755. $value = abs($value);
  3756. break;
  3757. case 'default_ping_status':
  3758. case 'default_comment_status':
  3759. // Options that if not there have 0 value but need to be something like "closed"
  3760. if ( $value == '0' || $value == '')
  3761. $value = 'closed';
  3762. break;
  3763. case 'blogdescription':
  3764. case 'blogname':
  3765. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3766. if ( $value !== $original_value ) {
  3767. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', wp_encode_emoji( $original_value ) );
  3768. }
  3769. if ( is_wp_error( $value ) ) {
  3770. $error = $value->get_error_message();
  3771. } else {
  3772. $value = esc_html( $value );
  3773. }
  3774. break;
  3775. case 'blog_charset':
  3776. $value = preg_replace('/[^a-zA-Z0-9_-]/', '', $value); // strips slashes
  3777. break;
  3778. case 'blog_public':
  3779. // This is the value if the settings checkbox is not checked on POST. Don't rely on this.
  3780. if ( null === $value )
  3781. $value = 1;
  3782. else
  3783. $value = intval( $value );
  3784. break;
  3785. case 'date_format':
  3786. case 'time_format':
  3787. case 'mailserver_url':
  3788. case 'mailserver_login':
  3789. case 'mailserver_pass':
  3790. case 'upload_path':
  3791. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3792. if ( is_wp_error( $value ) ) {
  3793. $error = $value->get_error_message();
  3794. } else {
  3795. $value = strip_tags( $value );
  3796. $value = wp_kses_data( $value );
  3797. }
  3798. break;
  3799. case 'ping_sites':
  3800. $value = explode( "\n", $value );
  3801. $value = array_filter( array_map( 'trim', $value ) );
  3802. $value = array_filter( array_map( 'esc_url_raw', $value ) );
  3803. $value = implode( "\n", $value );
  3804. break;
  3805. case 'gmt_offset':
  3806. $value = preg_replace('/[^0-9:.-]/', '', $value); // strips slashes
  3807. break;
  3808. case 'siteurl':
  3809. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3810. if ( is_wp_error( $value ) ) {
  3811. $error = $value->get_error_message();
  3812. } else {
  3813. if ( preg_match( '#http(s?)://(.+)#i', $value ) ) {
  3814. $value = esc_url_raw( $value );
  3815. } else {
  3816. $error = __( 'The WordPress address you entered did not appear to be a valid URL. Please enter a valid URL.' );
  3817. }
  3818. }
  3819. break;
  3820. case 'home':
  3821. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3822. if ( is_wp_error( $value ) ) {
  3823. $error = $value->get_error_message();
  3824. } else {
  3825. if ( preg_match( '#http(s?)://(.+)#i', $value ) ) {
  3826. $value = esc_url_raw( $value );
  3827. } else {
  3828. $error = __( 'The Site address you entered did not appear to be a valid URL. Please enter a valid URL.' );
  3829. }
  3830. }
  3831. break;
  3832. case 'WPLANG':
  3833. $allowed = get_available_languages();
  3834. if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG ) {
  3835. $allowed[] = WPLANG;
  3836. }
  3837. if ( ! in_array( $value, $allowed ) && ! empty( $value ) ) {
  3838. $value = get_option( $option );
  3839. }
  3840. break;
  3841. case 'illegal_names':
  3842. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3843. if ( is_wp_error( $value ) ) {
  3844. $error = $value->get_error_message();
  3845. } else {
  3846. if ( ! is_array( $value ) )
  3847. $value = explode( ' ', $value );
  3848. $value = array_values( array_filter( array_map( 'trim', $value ) ) );
  3849. if ( ! $value )
  3850. $value = '';
  3851. }
  3852. break;
  3853. case 'limited_email_domains':
  3854. case 'banned_email_domains':
  3855. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3856. if ( is_wp_error( $value ) ) {
  3857. $error = $value->get_error_message();
  3858. } else {
  3859. if ( ! is_array( $value ) )
  3860. $value = explode( "\n", $value );
  3861. $domains = array_values( array_filter( array_map( 'trim', $value ) ) );
  3862. $value = array();
  3863. foreach ( $domains as $domain ) {
  3864. if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) ) {
  3865. $value[] = $domain;
  3866. }
  3867. }
  3868. if ( ! $value )
  3869. $value = '';
  3870. }
  3871. break;
  3872. case 'timezone_string':
  3873. $allowed_zones = timezone_identifiers_list();
  3874. if ( ! in_array( $value, $allowed_zones ) && ! empty( $value ) ) {
  3875. $error = __( 'The timezone you have entered is not valid. Please select a valid timezone.' );
  3876. }
  3877. break;
  3878. case 'permalink_structure':
  3879. case 'category_base':
  3880. case 'tag_base':
  3881. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3882. if ( is_wp_error( $value ) ) {
  3883. $error = $value->get_error_message();
  3884. } else {
  3885. $value = esc_url_raw( $value );
  3886. $value = str_replace( 'http://', '', $value );
  3887. }
  3888. if ( 'permalink_structure' === $option && '' !== $value && ! preg_match( '/%[^\/%]+%/', $value ) ) {
  3889. $error = sprintf(
  3890. /* translators: %s: Codex URL */
  3891. __( 'A structure tag is required when using custom permalinks. <a href="%s">Learn more</a>' ),
  3892. __( 'https://codex.wordpress.org/Using_Permalinks#Choosing_your_permalink_structure' )
  3893. );
  3894. }
  3895. break;
  3896. case 'default_role' :
  3897. if ( ! get_role( $value ) && get_role( 'subscriber' ) )
  3898. $value = 'subscriber';
  3899. break;
  3900. case 'moderation_keys':
  3901. case 'blacklist_keys':
  3902. $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
  3903. if ( is_wp_error( $value ) ) {
  3904. $error = $value->get_error_message();
  3905. } else {
  3906. $value = explode( "\n", $value );
  3907. $value = array_filter( array_map( 'trim', $value ) );
  3908. $value = array_unique( $value );
  3909. $value = implode( "\n", $value );
  3910. }
  3911. break;
  3912. }
  3913. if ( ! empty( $error ) ) {
  3914. $value = get_option( $option );
  3915. if ( function_exists( 'add_settings_error' ) ) {
  3916. add_settings_error( $option, "invalid_{$option}", $error );
  3917. }
  3918. }
  3919. /**
  3920. * Filters an option value following sanitization.
  3921. *
  3922. * @since 2.3.0
  3923. * @since 4.3.0 Added the `$original_value` parameter.
  3924. *
  3925. * @param string $value The sanitized option value.
  3926. * @param string $option The option name.
  3927. * @param string $original_value The original value passed to the function.
  3928. */
  3929. return apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
  3930. }
  3931. /**
  3932. * Maps a function to all non-iterable elements of an array or an object.
  3933. *
  3934. * This is similar to `array_walk_recursive()` but acts upon objects too.
  3935. *
  3936. * @since 4.4.0
  3937. *
  3938. * @param mixed $value The array, object, or scalar.
  3939. * @param callable $callback The function to map onto $value.
  3940. * @return mixed The value with the callback applied to all non-arrays and non-objects inside it.
  3941. */
  3942. function map_deep( $value, $callback ) {
  3943. if ( is_array( $value ) ) {
  3944. foreach ( $value as $index => $item ) {
  3945. $value[ $index ] = map_deep( $item, $callback );
  3946. }
  3947. } elseif ( is_object( $value ) ) {
  3948. $object_vars = get_object_vars( $value );
  3949. foreach ( $object_vars as $property_name => $property_value ) {
  3950. $value->$property_name = map_deep( $property_value, $callback );
  3951. }
  3952. } else {
  3953. $value = call_user_func( $callback, $value );
  3954. }
  3955. return $value;
  3956. }
  3957. /**
  3958. * Parses a string into variables to be stored in an array.
  3959. *
  3960. * Uses {@link https://secure.php.net/parse_str parse_str()} and stripslashes if
  3961. * {@link https://secure.php.net/magic_quotes magic_quotes_gpc} is on.
  3962. *
  3963. * @since 2.2.1
  3964. *
  3965. * @param string $string The string to be parsed.
  3966. * @param array $array Variables will be stored in this array.
  3967. */
  3968. function wp_parse_str( $string, &$array ) {
  3969. parse_str( $string, $array );
  3970. if ( get_magic_quotes_gpc() )
  3971. $array = stripslashes_deep( $array );
  3972. /**
  3973. * Filters the array of variables derived from a parsed string.
  3974. *
  3975. * @since 2.3.0
  3976. *
  3977. * @param array $array The array populated with variables.
  3978. */
  3979. $array = apply_filters( 'wp_parse_str', $array );
  3980. }
  3981. /**
  3982. * Convert lone less than signs.
  3983. *
  3984. * KSES already converts lone greater than signs.
  3985. *
  3986. * @since 2.3.0
  3987. *
  3988. * @param string $text Text to be converted.
  3989. * @return string Converted text.
  3990. */
  3991. function wp_pre_kses_less_than( $text ) {
  3992. return preg_replace_callback('%<[^>]*?((?=<)|>|$)%', 'wp_pre_kses_less_than_callback', $text);
  3993. }
  3994. /**
  3995. * Callback function used by preg_replace.
  3996. *
  3997. * @since 2.3.0
  3998. *
  3999. * @param array $matches Populated by matches to preg_replace.
  4000. * @return string The text returned after esc_html if needed.
  4001. */
  4002. function wp_pre_kses_less_than_callback( $matches ) {
  4003. if ( false === strpos($matches[0], '>') )
  4004. return esc_html($matches[0]);
  4005. return $matches[0];
  4006. }
  4007. /**
  4008. * WordPress implementation of PHP sprintf() with filters.
  4009. *
  4010. * @since 2.5.0
  4011. * @link https://secure.php.net/sprintf
  4012. *
  4013. * @param string $pattern The string which formatted args are inserted.
  4014. * @param mixed $args ,... Arguments to be formatted into the $pattern string.
  4015. * @return string The formatted string.
  4016. */
  4017. function wp_sprintf( $pattern ) {
  4018. $args = func_get_args();
  4019. $len = strlen($pattern);
  4020. $start = 0;
  4021. $result = '';
  4022. $arg_index = 0;
  4023. while ( $len > $start ) {
  4024. // Last character: append and break
  4025. if ( strlen($pattern) - 1 == $start ) {
  4026. $result .= substr($pattern, -1);
  4027. break;
  4028. }
  4029. // Literal %: append and continue
  4030. if ( substr($pattern, $start, 2) == '%%' ) {
  4031. $start += 2;
  4032. $result .= '%';
  4033. continue;
  4034. }
  4035. // Get fragment before next %
  4036. $end = strpos($pattern, '%', $start + 1);
  4037. if ( false === $end )
  4038. $end = $len;
  4039. $fragment = substr($pattern, $start, $end - $start);
  4040. // Fragment has a specifier
  4041. if ( $pattern[$start] == '%' ) {
  4042. // Find numbered arguments or take the next one in order
  4043. if ( preg_match('/^%(\d+)\$/', $fragment, $matches) ) {
  4044. $arg = isset($args[$matches[1]]) ? $args[$matches[1]] : '';
  4045. $fragment = str_replace("%{$matches[1]}$", '%', $fragment);
  4046. } else {
  4047. ++$arg_index;
  4048. $arg = isset($args[$arg_index]) ? $args[$arg_index] : '';
  4049. }
  4050. /**
  4051. * Filters a fragment from the pattern passed to wp_sprintf().
  4052. *
  4053. * If the fragment is unchanged, then sprintf() will be run on the fragment.
  4054. *
  4055. * @since 2.5.0
  4056. *
  4057. * @param string $fragment A fragment from the pattern.
  4058. * @param string $arg The argument.
  4059. */
  4060. $_fragment = apply_filters( 'wp_sprintf', $fragment, $arg );
  4061. if ( $_fragment != $fragment )
  4062. $fragment = $_fragment;
  4063. else
  4064. $fragment = sprintf($fragment, strval($arg) );
  4065. }
  4066. // Append to result and move to next fragment
  4067. $result .= $fragment;
  4068. $start = $end;
  4069. }
  4070. return $result;
  4071. }
  4072. /**
  4073. * Localize list items before the rest of the content.
  4074. *
  4075. * The '%l' must be at the first characters can then contain the rest of the
  4076. * content. The list items will have ', ', ', and', and ' and ' added depending
  4077. * on the amount of list items in the $args parameter.
  4078. *
  4079. * @since 2.5.0
  4080. *
  4081. * @param string $pattern Content containing '%l' at the beginning.
  4082. * @param array $args List items to prepend to the content and replace '%l'.
  4083. * @return string Localized list items and rest of the content.
  4084. */
  4085. function wp_sprintf_l( $pattern, $args ) {
  4086. // Not a match
  4087. if ( substr($pattern, 0, 2) != '%l' )
  4088. return $pattern;
  4089. // Nothing to work with
  4090. if ( empty($args) )
  4091. return '';
  4092. /**
  4093. * Filters the translated delimiters used by wp_sprintf_l().
  4094. * Placeholders (%s) are included to assist translators and then
  4095. * removed before the array of strings reaches the filter.
  4096. *
  4097. * Please note: Ampersands and entities should be avoided here.
  4098. *
  4099. * @since 2.5.0
  4100. *
  4101. * @param array $delimiters An array of translated delimiters.
  4102. */
  4103. $l = apply_filters( 'wp_sprintf_l', array(
  4104. /* translators: used to join items in a list with more than 2 items */
  4105. 'between' => sprintf( __('%s, %s'), '', '' ),
  4106. /* translators: used to join last two items in a list with more than 2 times */
  4107. 'between_last_two' => sprintf( __('%s, and %s'), '', '' ),
  4108. /* translators: used to join items in a list with only 2 items */
  4109. 'between_only_two' => sprintf( __('%s and %s'), '', '' ),
  4110. ) );
  4111. $args = (array) $args;
  4112. $result = array_shift($args);
  4113. if ( count($args) == 1 )
  4114. $result .= $l['between_only_two'] . array_shift($args);
  4115. // Loop when more than two args
  4116. $i = count($args);
  4117. while ( $i ) {
  4118. $arg = array_shift($args);
  4119. $i--;
  4120. if ( 0 == $i )
  4121. $result .= $l['between_last_two'] . $arg;
  4122. else
  4123. $result .= $l['between'] . $arg;
  4124. }
  4125. return $result . substr($pattern, 2);
  4126. }
  4127. /**
  4128. * Safely extracts not more than the first $count characters from html string.
  4129. *
  4130. * UTF-8, tags and entities safe prefix extraction. Entities inside will *NOT*
  4131. * be counted as one character. For example &amp; will be counted as 4, &lt; as
  4132. * 3, etc.
  4133. *
  4134. * @since 2.5.0
  4135. *
  4136. * @param string $str String to get the excerpt from.
  4137. * @param int $count Maximum number of characters to take.
  4138. * @param string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string.
  4139. * @return string The excerpt.
  4140. */
  4141. function wp_html_excerpt( $str, $count, $more = null ) {
  4142. if ( null === $more )
  4143. $more = '';
  4144. $str = wp_strip_all_tags( $str, true );
  4145. $excerpt = mb_substr( $str, 0, $count );
  4146. // remove part of an entity at the end
  4147. $excerpt = preg_replace( '/&[^;\s]{0,6}$/', '', $excerpt );
  4148. if ( $str != $excerpt )
  4149. $excerpt = trim( $excerpt ) . $more;
  4150. return $excerpt;
  4151. }
  4152. /**
  4153. * Add a Base url to relative links in passed content.
  4154. *
  4155. * By default it supports the 'src' and 'href' attributes. However this can be
  4156. * changed via the 3rd param.
  4157. *
  4158. * @since 2.7.0
  4159. *
  4160. * @global string $_links_add_base
  4161. *
  4162. * @param string $content String to search for links in.
  4163. * @param string $base The base URL to prefix to links.
  4164. * @param array $attrs The attributes which should be processed.
  4165. * @return string The processed content.
  4166. */
  4167. function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {
  4168. global $_links_add_base;
  4169. $_links_add_base = $base;
  4170. $attrs = implode('|', (array)$attrs);
  4171. return preg_replace_callback( "!($attrs)=(['\"])(.+?)\\2!i", '_links_add_base', $content );
  4172. }
  4173. /**
  4174. * Callback to add a base url to relative links in passed content.
  4175. *
  4176. * @since 2.7.0
  4177. * @access private
  4178. *
  4179. * @global string $_links_add_base
  4180. *
  4181. * @param string $m The matched link.
  4182. * @return string The processed link.
  4183. */
  4184. function _links_add_base( $m ) {
  4185. global $_links_add_base;
  4186. //1 = attribute name 2 = quotation mark 3 = URL
  4187. return $m[1] . '=' . $m[2] .
  4188. ( preg_match( '#^(\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols() ) ?
  4189. $m[3] :
  4190. WP_Http::make_absolute_url( $m[3], $_links_add_base )
  4191. )
  4192. . $m[2];
  4193. }
  4194. /**
  4195. * Adds a Target attribute to all links in passed content.
  4196. *
  4197. * This function by default only applies to `<a>` tags, however this can be
  4198. * modified by the 3rd param.
  4199. *
  4200. * *NOTE:* Any current target attributed will be stripped and replaced.
  4201. *
  4202. * @since 2.7.0
  4203. *
  4204. * @global string $_links_add_target
  4205. *
  4206. * @param string $content String to search for links in.
  4207. * @param string $target The Target to add to the links.
  4208. * @param array $tags An array of tags to apply to.
  4209. * @return string The processed content.
  4210. */
  4211. function links_add_target( $content, $target = '_blank', $tags = array('a') ) {
  4212. global $_links_add_target;
  4213. $_links_add_target = $target;
  4214. $tags = implode('|', (array)$tags);
  4215. return preg_replace_callback( "!<($tags)([^>]*)>!i", '_links_add_target', $content );
  4216. }
  4217. /**
  4218. * Callback to add a target attribute to all links in passed content.
  4219. *
  4220. * @since 2.7.0
  4221. * @access private
  4222. *
  4223. * @global string $_links_add_target
  4224. *
  4225. * @param string $m The matched link.
  4226. * @return string The processed link.
  4227. */
  4228. function _links_add_target( $m ) {
  4229. global $_links_add_target;
  4230. $tag = $m[1];
  4231. $link = preg_replace('|( target=([\'"])(.*?)\2)|i', '', $m[2]);
  4232. return '<' . $tag . $link . ' target="' . esc_attr( $_links_add_target ) . '">';
  4233. }
  4234. /**
  4235. * Normalize EOL characters and strip duplicate whitespace.
  4236. *
  4237. * @since 2.7.0
  4238. *
  4239. * @param string $str The string to normalize.
  4240. * @return string The normalized string.
  4241. */
  4242. function normalize_whitespace( $str ) {
  4243. $str = trim( $str );
  4244. $str = str_replace( "\r", "\n", $str );
  4245. $str = preg_replace( array( '/\n+/', '/[ \t]+/' ), array( "\n", ' ' ), $str );
  4246. return $str;
  4247. }
  4248. /**
  4249. * Properly strip all HTML tags including script and style
  4250. *
  4251. * This differs from strip_tags() because it removes the contents of
  4252. * the `<script>` and `<style>` tags. E.g. `strip_tags( '<script>something</script>' )`
  4253. * will return 'something'. wp_strip_all_tags will return ''
  4254. *
  4255. * @since 2.9.0
  4256. *
  4257. * @param string $string String containing HTML tags
  4258. * @param bool $remove_breaks Optional. Whether to remove left over line breaks and white space chars
  4259. * @return string The processed string.
  4260. */
  4261. function wp_strip_all_tags($string, $remove_breaks = false) {
  4262. $string = preg_replace( '@<(script|style)[^>]*?>.*?</\\1>@si', '', $string );
  4263. $string = strip_tags($string);
  4264. if ( $remove_breaks )
  4265. $string = preg_replace('/[\r\n\t ]+/', ' ', $string);
  4266. return trim( $string );
  4267. }
  4268. /**
  4269. * Sanitizes a string from user input or from the database.
  4270. *
  4271. * - Checks for invalid UTF-8,
  4272. * - Converts single `<` characters to entities
  4273. * - Strips all tags
  4274. * - Removes line breaks, tabs, and extra whitespace
  4275. * - Strips octets
  4276. *
  4277. * @since 2.9.0
  4278. *
  4279. * @see sanitize_textarea_field()
  4280. * @see wp_check_invalid_utf8()
  4281. * @see wp_strip_all_tags()
  4282. *
  4283. * @param string $str String to sanitize.
  4284. * @return string Sanitized string.
  4285. */
  4286. function sanitize_text_field( $str ) {
  4287. $filtered = _sanitize_text_fields( $str, false );
  4288. /**
  4289. * Filters a sanitized text field string.
  4290. *
  4291. * @since 2.9.0
  4292. *
  4293. * @param string $filtered The sanitized string.
  4294. * @param string $str The string prior to being sanitized.
  4295. */
  4296. return apply_filters( 'sanitize_text_field', $filtered, $str );
  4297. }
  4298. /**
  4299. * Sanitizes a multiline string from user input or from the database.
  4300. *
  4301. * The function is like sanitize_text_field(), but preserves
  4302. * new lines (\n) and other whitespace, which are legitimate
  4303. * input in textarea elements.
  4304. *
  4305. * @see sanitize_text_field()
  4306. *
  4307. * @since 4.7.0
  4308. *
  4309. * @param string $str String to sanitize.
  4310. * @return string Sanitized string.
  4311. */
  4312. function sanitize_textarea_field( $str ) {
  4313. $filtered = _sanitize_text_fields( $str, true );
  4314. /**
  4315. * Filters a sanitized textarea field string.
  4316. *
  4317. * @since 4.7.0
  4318. *
  4319. * @param string $filtered The sanitized string.
  4320. * @param string $str The string prior to being sanitized.
  4321. */
  4322. return apply_filters( 'sanitize_textarea_field', $filtered, $str );
  4323. }
  4324. /**
  4325. * Internal helper function to sanitize a string from user input or from the db
  4326. *
  4327. * @since 4.7.0
  4328. * @access private
  4329. *
  4330. * @param string $str String to sanitize.
  4331. * @param bool $keep_newlines optional Whether to keep newlines. Default: false.
  4332. * @return string Sanitized string.
  4333. */
  4334. function _sanitize_text_fields( $str, $keep_newlines = false ) {
  4335. $filtered = wp_check_invalid_utf8( $str );
  4336. if ( strpos($filtered, '<') !== false ) {
  4337. $filtered = wp_pre_kses_less_than( $filtered );
  4338. // This will strip extra whitespace for us.
  4339. $filtered = wp_strip_all_tags( $filtered, false );
  4340. // Use html entities in a special case to make sure no later
  4341. // newline stripping stage could lead to a functional tag
  4342. $filtered = str_replace("<\n", "&lt;\n", $filtered);
  4343. }
  4344. if ( ! $keep_newlines ) {
  4345. $filtered = preg_replace( '/[\r\n\t ]+/', ' ', $filtered );
  4346. }
  4347. $filtered = trim( $filtered );
  4348. $found = false;
  4349. while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
  4350. $filtered = str_replace($match[0], '', $filtered);
  4351. $found = true;
  4352. }
  4353. if ( $found ) {
  4354. // Strip out the whitespace that may now exist after removing the octets.
  4355. $filtered = trim( preg_replace('/ +/', ' ', $filtered) );
  4356. }
  4357. return $filtered;
  4358. }
  4359. /**
  4360. * i18n friendly version of basename()
  4361. *
  4362. * @since 3.1.0
  4363. *
  4364. * @param string $path A path.
  4365. * @param string $suffix If the filename ends in suffix this will also be cut off.
  4366. * @return string
  4367. */
  4368. function wp_basename( $path, $suffix = '' ) {
  4369. return urldecode( basename( str_replace( array( '%2F', '%5C' ), '/', urlencode( $path ) ), $suffix ) );
  4370. }
  4371. /**
  4372. * Forever eliminate "Wordpress" from the planet (or at least the little bit we can influence).
  4373. *
  4374. * Violating our coding standards for a good function name.
  4375. *
  4376. * @since 3.0.0
  4377. *
  4378. * @staticvar string|false $dblq
  4379. *
  4380. * @param string $text The text to be modified.
  4381. * @return string The modified text.
  4382. */
  4383. function capital_P_dangit( $text ) {
  4384. // Simple replacement for titles
  4385. $current_filter = current_filter();
  4386. if ( 'the_title' === $current_filter || 'wp_title' === $current_filter )
  4387. return str_replace( 'Wordpress', 'WordPress', $text );
  4388. // Still here? Use the more judicious replacement
  4389. static $dblq = false;
  4390. if ( false === $dblq ) {
  4391. $dblq = _x( '&#8220;', 'opening curly double quote' );
  4392. }
  4393. return str_replace(
  4394. array( ' Wordpress', '&#8216;Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ),
  4395. array( ' WordPress', '&#8216;WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),
  4396. $text );
  4397. }
  4398. /**
  4399. * Sanitize a mime type
  4400. *
  4401. * @since 3.1.3
  4402. *
  4403. * @param string $mime_type Mime type
  4404. * @return string Sanitized mime type
  4405. */
  4406. function sanitize_mime_type( $mime_type ) {
  4407. $sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
  4408. /**
  4409. * Filters a mime type following sanitization.
  4410. *
  4411. * @since 3.1.3
  4412. *
  4413. * @param string $sani_mime_type The sanitized mime type.
  4414. * @param string $mime_type The mime type prior to sanitization.
  4415. */
  4416. return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
  4417. }
  4418. /**
  4419. * Sanitize space or carriage return separated URLs that are used to send trackbacks.
  4420. *
  4421. * @since 3.4.0
  4422. *
  4423. * @param string $to_ping Space or carriage return separated URLs
  4424. * @return string URLs starting with the http or https protocol, separated by a carriage return.
  4425. */
  4426. function sanitize_trackback_urls( $to_ping ) {
  4427. $urls_to_ping = preg_split( '/[\r\n\t ]/', trim( $to_ping ), -1, PREG_SPLIT_NO_EMPTY );
  4428. foreach ( $urls_to_ping as $k => $url ) {
  4429. if ( !preg_match( '#^https?://.#i', $url ) )
  4430. unset( $urls_to_ping[$k] );
  4431. }
  4432. $urls_to_ping = array_map( 'esc_url_raw', $urls_to_ping );
  4433. $urls_to_ping = implode( "\n", $urls_to_ping );
  4434. /**
  4435. * Filters a list of trackback URLs following sanitization.
  4436. *
  4437. * The string returned here consists of a space or carriage return-delimited list
  4438. * of trackback URLs.
  4439. *
  4440. * @since 3.4.0
  4441. *
  4442. * @param string $urls_to_ping Sanitized space or carriage return separated URLs.
  4443. * @param string $to_ping Space or carriage return separated URLs before sanitization.
  4444. */
  4445. return apply_filters( 'sanitize_trackback_urls', $urls_to_ping, $to_ping );
  4446. }
  4447. /**
  4448. * Add slashes to a string or array of strings.
  4449. *
  4450. * This should be used when preparing data for core API that expects slashed data.
  4451. * This should not be used to escape data going directly into an SQL query.
  4452. *
  4453. * @since 3.6.0
  4454. *
  4455. * @param string|array $value String or array of strings to slash.
  4456. * @return string|array Slashed $value
  4457. */
  4458. function wp_slash( $value ) {
  4459. if ( is_array( $value ) ) {
  4460. foreach ( $value as $k => $v ) {
  4461. if ( is_array( $v ) ) {
  4462. $value[$k] = wp_slash( $v );
  4463. } else {
  4464. $value[$k] = addslashes( $v );
  4465. }
  4466. }
  4467. } else {
  4468. $value = addslashes( $value );
  4469. }
  4470. return $value;
  4471. }
  4472. /**
  4473. * Remove slashes from a string or array of strings.
  4474. *
  4475. * This should be used to remove slashes from data passed to core API that
  4476. * expects data to be unslashed.
  4477. *
  4478. * @since 3.6.0
  4479. *
  4480. * @param string|array $value String or array of strings to unslash.
  4481. * @return string|array Unslashed $value
  4482. */
  4483. function wp_unslash( $value ) {
  4484. return stripslashes_deep( $value );
  4485. }
  4486. /**
  4487. * Extract and return the first URL from passed content.
  4488. *
  4489. * @since 3.6.0
  4490. *
  4491. * @param string $content A string which might contain a URL.
  4492. * @return string|false The found URL.
  4493. */
  4494. function get_url_in_content( $content ) {
  4495. if ( empty( $content ) ) {
  4496. return false;
  4497. }
  4498. if ( preg_match( '/<a\s[^>]*?href=([\'"])(.+?)\1/is', $content, $matches ) ) {
  4499. return esc_url_raw( $matches[2] );
  4500. }
  4501. return false;
  4502. }
  4503. /**
  4504. * Returns the regexp for common whitespace characters.
  4505. *
  4506. * By default, spaces include new lines, tabs, nbsp entities, and the UTF-8 nbsp.
  4507. * This is designed to replace the PCRE \s sequence. In ticket #22692, that
  4508. * sequence was found to be unreliable due to random inclusion of the A0 byte.
  4509. *
  4510. * @since 4.0.0
  4511. *
  4512. * @staticvar string $spaces
  4513. *
  4514. * @return string The spaces regexp.
  4515. */
  4516. function wp_spaces_regexp() {
  4517. static $spaces = '';
  4518. if ( empty( $spaces ) ) {
  4519. /**
  4520. * Filters the regexp for common whitespace characters.
  4521. *
  4522. * This string is substituted for the \s sequence as needed in regular
  4523. * expressions. For websites not written in English, different characters
  4524. * may represent whitespace. For websites not encoded in UTF-8, the 0xC2 0xA0
  4525. * sequence may not be in use.
  4526. *
  4527. * @since 4.0.0
  4528. *
  4529. * @param string $spaces Regexp pattern for matching common whitespace characters.
  4530. */
  4531. $spaces = apply_filters( 'wp_spaces_regexp', '[\r\n\t ]|\xC2\xA0|&nbsp;' );
  4532. }
  4533. return $spaces;
  4534. }
  4535. /**
  4536. * Print the important emoji-related styles.
  4537. *
  4538. * @since 4.2.0
  4539. *
  4540. * @staticvar bool $printed
  4541. */
  4542. function print_emoji_styles() {
  4543. static $printed = false;
  4544. if ( $printed ) {
  4545. return;
  4546. }
  4547. $printed = true;
  4548. ?>
  4549. <style type="text/css">
  4550. img.wp-smiley,
  4551. img.emoji {
  4552. display: inline !important;
  4553. border: none !important;
  4554. box-shadow: none !important;
  4555. height: 1em !important;
  4556. width: 1em !important;
  4557. margin: 0 .07em !important;
  4558. vertical-align: -0.1em !important;
  4559. background: none !important;
  4560. padding: 0 !important;
  4561. }
  4562. </style>
  4563. <?php
  4564. }
  4565. /**
  4566. * Print the inline Emoji detection script if it is not already printed.
  4567. *
  4568. * @since 4.2.0
  4569. * @staticvar bool $printed
  4570. */
  4571. function print_emoji_detection_script() {
  4572. static $printed = false;
  4573. if ( $printed ) {
  4574. return;
  4575. }
  4576. $printed = true;
  4577. _print_emoji_detection_script();
  4578. }
  4579. /**
  4580. * Prints inline Emoji dection script
  4581. *
  4582. * @ignore
  4583. * @since 4.6.0
  4584. * @access private
  4585. */
  4586. function _print_emoji_detection_script() {
  4587. $settings = array(
  4588. /**
  4589. * Filters the URL where emoji png images are hosted.
  4590. *
  4591. * @since 4.2.0
  4592. *
  4593. * @param string The emoji base URL for png images.
  4594. */
  4595. 'baseUrl' => apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/11/72x72/' ),
  4596. /**
  4597. * Filters the extension of the emoji png files.
  4598. *
  4599. * @since 4.2.0
  4600. *
  4601. * @param string The emoji extension for png files. Default .png.
  4602. */
  4603. 'ext' => apply_filters( 'emoji_ext', '.png' ),
  4604. /**
  4605. * Filters the URL where emoji SVG images are hosted.
  4606. *
  4607. * @since 4.6.0
  4608. *
  4609. * @param string The emoji base URL for svg images.
  4610. */
  4611. 'svgUrl' => apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/11/svg/' ),
  4612. /**
  4613. * Filters the extension of the emoji SVG files.
  4614. *
  4615. * @since 4.6.0
  4616. *
  4617. * @param string The emoji extension for svg files. Default .svg.
  4618. */
  4619. 'svgExt' => apply_filters( 'emoji_svg_ext', '.svg' ),
  4620. );
  4621. $version = 'ver=' . get_bloginfo( 'version' );
  4622. if ( SCRIPT_DEBUG ) {
  4623. $settings['source'] = array(
  4624. /** This filter is documented in wp-includes/class.wp-scripts.php */
  4625. 'wpemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji.js?$version" ), 'wpemoji' ),
  4626. /** This filter is documented in wp-includes/class.wp-scripts.php */
  4627. 'twemoji' => apply_filters( 'script_loader_src', includes_url( "js/twemoji.js?$version" ), 'twemoji' ),
  4628. );
  4629. ?>
  4630. <script type="text/javascript">
  4631. window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
  4632. <?php readfile( ABSPATH . WPINC . "/js/wp-emoji-loader.js" ); ?>
  4633. </script>
  4634. <?php
  4635. } else {
  4636. $settings['source'] = array(
  4637. /** This filter is documented in wp-includes/class.wp-scripts.php */
  4638. 'concatemoji' => apply_filters( 'script_loader_src', includes_url( "js/wp-emoji-release.min.js?$version" ), 'concatemoji' ),
  4639. );
  4640. /*
  4641. * If you're looking at a src version of this file, you'll see an "include"
  4642. * statement below. This is used by the `grunt build` process to directly
  4643. * include a minified version of wp-emoji-loader.js, instead of using the
  4644. * readfile() method from above.
  4645. *
  4646. * If you're looking at a build version of this file, you'll see a string of
  4647. * minified JavaScript. If you need to debug it, please turn on SCRIPT_DEBUG
  4648. * and edit wp-emoji-loader.js directly.
  4649. */
  4650. ?>
  4651. <script type="text/javascript">
  4652. window._wpemojiSettings = <?php echo wp_json_encode( $settings ); ?>;
  4653. !function(a,b,c){function d(a,b){var c=String.fromCharCode;l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,a),0,0);var d=k.toDataURL();l.clearRect(0,0,k.width,k.height),l.fillText(c.apply(this,b),0,0);var e=k.toDataURL();return d===e}function e(a){var b;if(!l||!l.fillText)return!1;switch(l.textBaseline="top",l.font="600 32px Arial",a){case"flag":return!(b=d([55356,56826,55356,56819],[55356,56826,8203,55356,56819]))&&(b=d([55356,57332,56128,56423,56128,56418,56128,56421,56128,56430,56128,56423,56128,56447],[55356,57332,8203,56128,56423,8203,56128,56418,8203,56128,56421,8203,56128,56430,8203,56128,56423,8203,56128,56447]),!b);case"emoji":return b=d([55358,56760,9792,65039],[55358,56760,8203,9792,65039]),!b}return!1}function f(a){var c=b.createElement("script");c.src=a,c.defer=c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var g,h,i,j,k=b.createElement("canvas"),l=k.getContext&&k.getContext("2d");for(j=Array("flag","emoji"),c.supports={everything:!0,everythingExceptFlag:!0},i=0;i<j.length;i++)c.supports[j[i]]=e(j[i]),c.supports.everything=c.supports.everything&&c.supports[j[i]],"flag"!==j[i]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[j[i]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(h=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",h,!1),a.addEventListener("load",h,!1)):(a.attachEvent("onload",h),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),g=c.source||{},g.concatemoji?f(g.concatemoji):g.wpemoji&&g.twemoji&&(f(g.twemoji),f(g.wpemoji)))}(window,document,window._wpemojiSettings);
  4654. </script>
  4655. <?php
  4656. }
  4657. }
  4658. /**
  4659. * Convert emoji characters to their equivalent HTML entity.
  4660. *
  4661. * This allows us to store emoji in a DB using the utf8 character set.
  4662. *
  4663. * @since 4.2.0
  4664. *
  4665. * @param string $content The content to encode.
  4666. * @return string The encoded content.
  4667. */
  4668. function wp_encode_emoji( $content ) {
  4669. $emoji = _wp_emoji_list( 'partials' );
  4670. foreach ( $emoji as $emojum ) {
  4671. if ( version_compare( phpversion(), '5.4', '<' ) ) {
  4672. $emoji_char = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
  4673. } else {
  4674. $emoji_char = html_entity_decode( $emojum );
  4675. }
  4676. if ( false !== strpos( $content, $emoji_char ) ) {
  4677. $content = preg_replace( "/$emoji_char/", $emojum, $content );
  4678. }
  4679. }
  4680. return $content;
  4681. }
  4682. /**
  4683. * Convert emoji to a static img element.
  4684. *
  4685. * @since 4.2.0
  4686. *
  4687. * @param string $text The content to encode.
  4688. * @return string The encoded content.
  4689. */
  4690. function wp_staticize_emoji( $text ) {
  4691. if ( false === strpos( $text, '&#x' ) ) {
  4692. if ( ( function_exists( 'mb_check_encoding' ) && mb_check_encoding( $text, 'ASCII' ) ) || ! preg_match( '/[^\x00-\x7F]/', $text ) ) {
  4693. // The text doesn't contain anything that might be emoji, so we can return early.
  4694. return $text;
  4695. } else {
  4696. $encoded_text = wp_encode_emoji( $text );
  4697. if ( $encoded_text === $text ) {
  4698. return $encoded_text;
  4699. }
  4700. $text = $encoded_text;
  4701. }
  4702. }
  4703. $emoji = _wp_emoji_list( 'entities' );
  4704. // Quickly narrow down the list of emoji that might be in the text and need replacing.
  4705. $possible_emoji = array();
  4706. foreach( $emoji as $emojum ) {
  4707. if ( false !== strpos( $text, $emojum ) ) {
  4708. if ( version_compare( phpversion(), '5.4', '<' ) ) {
  4709. $possible_emoji[ $emojum ] = html_entity_decode( $emojum, ENT_COMPAT, 'UTF-8' );
  4710. } else {
  4711. $possible_emoji[ $emojum ] = html_entity_decode( $emojum );
  4712. }
  4713. }
  4714. }
  4715. if ( ! $possible_emoji ) {
  4716. return $text;
  4717. }
  4718. /** This filter is documented in wp-includes/formatting.php */
  4719. $cdn_url = apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/11/72x72/' );
  4720. /** This filter is documented in wp-includes/formatting.php */
  4721. $ext = apply_filters( 'emoji_ext', '.png' );
  4722. $output = '';
  4723. /*
  4724. * HTML loop taken from smiley function, which was taken from texturize function.
  4725. * It'll never be consolidated.
  4726. *
  4727. * First, capture the tags as well as in between.
  4728. */
  4729. $textarr = preg_split( '/(<.*>)/U', $text, -1, PREG_SPLIT_DELIM_CAPTURE );
  4730. $stop = count( $textarr );
  4731. // Ignore processing of specific tags.
  4732. $tags_to_ignore = 'code|pre|style|script|textarea';
  4733. $ignore_block_element = '';
  4734. for ( $i = 0; $i < $stop; $i++ ) {
  4735. $content = $textarr[$i];
  4736. // If we're in an ignore block, wait until we find its closing tag.
  4737. if ( '' == $ignore_block_element && preg_match( '/^<(' . $tags_to_ignore . ')>/', $content, $matches ) ) {
  4738. $ignore_block_element = $matches[1];
  4739. }
  4740. // If it's not a tag and not in ignore block.
  4741. if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] && false !== strpos( $content, '&#x' ) ) {
  4742. foreach ( $possible_emoji as $emojum => $emoji_char ) {
  4743. if ( false === strpos( $content, $emojum ) ) {
  4744. continue;
  4745. }
  4746. $file = str_replace( ';&#x', '-', $emojum );
  4747. $file = str_replace( array( '&#x', ';'), '', $file );
  4748. $entity = sprintf( '<img src="%s" alt="%s" class="wp-smiley" style="height: 1em; max-height: 1em;" />', $cdn_url . $file . $ext, $emoji_char );
  4749. $content = str_replace( $emojum, $entity, $content );
  4750. }
  4751. }
  4752. // Did we exit ignore block.
  4753. if ( '' != $ignore_block_element && '</' . $ignore_block_element . '>' == $content ) {
  4754. $ignore_block_element = '';
  4755. }
  4756. $output .= $content;
  4757. }
  4758. // Finally, remove any stray U+FE0F characters
  4759. $output = str_replace( '&#xfe0f;', '', $output );
  4760. return $output;
  4761. }
  4762. /**
  4763. * Convert emoji in emails into static images.
  4764. *
  4765. * @since 4.2.0
  4766. *
  4767. * @param array $mail The email data array.
  4768. * @return array The email data array, with emoji in the message staticized.
  4769. */
  4770. function wp_staticize_emoji_for_email( $mail ) {
  4771. if ( ! isset( $mail['message'] ) ) {
  4772. return $mail;
  4773. }
  4774. /*
  4775. * We can only transform the emoji into images if it's a text/html email.
  4776. * To do that, here's a cut down version of the same process that happens
  4777. * in wp_mail() - get the Content-Type from the headers, if there is one,
  4778. * then pass it through the wp_mail_content_type filter, in case a plugin
  4779. * is handling changing the Content-Type.
  4780. */
  4781. $headers = array();
  4782. if ( isset( $mail['headers'] ) ) {
  4783. if ( is_array( $mail['headers'] ) ) {
  4784. $headers = $mail['headers'];
  4785. } else {
  4786. $headers = explode( "\n", str_replace( "\r\n", "\n", $mail['headers'] ) );
  4787. }
  4788. }
  4789. foreach ( $headers as $header ) {
  4790. if ( strpos($header, ':') === false ) {
  4791. continue;
  4792. }
  4793. // Explode them out.
  4794. list( $name, $content ) = explode( ':', trim( $header ), 2 );
  4795. // Cleanup crew.
  4796. $name = trim( $name );
  4797. $content = trim( $content );
  4798. if ( 'content-type' === strtolower( $name ) ) {
  4799. if ( strpos( $content, ';' ) !== false ) {
  4800. list( $type, $charset ) = explode( ';', $content );
  4801. $content_type = trim( $type );
  4802. } else {
  4803. $content_type = trim( $content );
  4804. }
  4805. break;
  4806. }
  4807. }
  4808. // Set Content-Type if we don't have a content-type from the input headers.
  4809. if ( ! isset( $content_type ) ) {
  4810. $content_type = 'text/plain';
  4811. }
  4812. /** This filter is documented in wp-includes/pluggable.php */
  4813. $content_type = apply_filters( 'wp_mail_content_type', $content_type );
  4814. if ( 'text/html' === $content_type ) {
  4815. $mail['message'] = wp_staticize_emoji( $mail['message'] );
  4816. }
  4817. return $mail;
  4818. }
  4819. /**
  4820. * Returns a arrays of emoji data.
  4821. *
  4822. * These arrays automatically built from the regex in twemoji.js - if they need to be updated,
  4823. * you should update the regex there, then run the `grunt precommit:emoji` job.
  4824. *
  4825. * @since 4.9.0
  4826. * @access private
  4827. *
  4828. * @param string $type Optional. Which array type to return. Accepts 'partials' or 'entities', default 'entities'.
  4829. * @return array An array to match all emoji that WordPress recognises.
  4830. */
  4831. function _wp_emoji_list( $type = 'entities' ) {
  4832. // Do not remove the START/END comments - they're used to find where to insert the arrays.
  4833. // START: emoji arrays
  4834. $entities = array('&#x1f469;&#x200d;&#x2764;&#xfe0f;&#x200d;&#x1f48b;&#x200d;&#x1f469;','&#x1f469;&#x200d;&#x2764;&#xfe0f;&#x200d;&#x1f48b;&#x200d;&#x1f468;','&#x1f468;&#x200d;&#x2764;&#xfe0f;&#x200d;&#x1f48b;&#x200d;&#x1f468;','&#x1f3f4;&#xe0067;&#xe0062;&#xe0073;&#xe0063;&#xe0074;&#xe007f;','&#x1f3f4;&#xe0067;&#xe0062;&#xe0077;&#xe006c;&#xe0073;&#xe007f;','&#x1f3f4;&#xe0067;&#xe0062;&#xe0065;&#xe006e;&#xe0067;&#xe007f;','&#x1f469;&#x200d;&#x1f469;&#x200d;&#x1f467;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x1f468;&#x200d;&#x1f466;&#x200d;&#x1f466;','&#x1f469;&#x200d;&#x1f469;&#x200d;&#x1f466;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x1f468;&#x200d;&#x1f467;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x1f468;&#x200d;&#x1f467;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f469;&#x200d;&#x1f467;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f469;&#x200d;&#x1f466;&#x200d;&#x1f466;','&#x1f469;&#x200d;&#x1f469;&#x200d;&#x1f467;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f469;&#x200d;&#x1f467;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x2764;&#xfe0f;&#x200d;&#x1f468;','&#x1f469;&#x200d;&#x2764;&#xfe0f;&#x200d;&#x1f468;','&#x1f469;&#x200d;&#x2764;&#xfe0f;&#x200d;&#x1f469;','&#x1f469;&#x200d;&#x1f469;&#x200d;&#x1f466;','&#x1f469;&#x200d;&#x1f466;&#x200d;&#x1f466;','&#x1f469;&#x200d;&#x1f467;&#x200d;&#x1f466;','&#x1f469;&#x200d;&#x1f467;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f468;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x1f469;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f467;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f467;&#x200d;&#x1f466;','&#x1f469;&#x200d;&#x1f469;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f469;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x1f468;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f466;&#x200d;&#x1f466;','&#x1f935;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f3cb;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f3cb;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f3cb;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f3cb;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f3cb;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f3cb;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f3cb;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f3cb;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f3cb;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f3cc;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f3cc;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f3cc;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f3cc;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f3cc;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f3cc;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f3cc;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f3cc;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f3cc;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f3cc;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f482;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f3c3;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f3c3;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9dd;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9dd;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9dd;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9dd;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9dd;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9dd;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9dd;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9dd;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9dd;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9dd;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9dc;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9dc;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9dc;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9dc;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9dc;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9dc;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9dc;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9dc;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f468;&#x1f3fb;&#x200d;&#x2695;&#xfe0f;','&#x1f468;&#x1f3fb;&#x200d;&#x2696;&#xfe0f;','&#x1f468;&#x1f3fb;&#x200d;&#x2708;&#xfe0f;','&#x1f9dc;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9dc;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9db;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9db;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9db;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9db;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9db;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9db;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9db;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9db;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9db;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9db;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9da;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9da;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9da;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9da;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9da;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f468;&#x1f3fc;&#x200d;&#x2695;&#xfe0f;','&#x1f468;&#x1f3fc;&#x200d;&#x2696;&#xfe0f;','&#x1f468;&#x1f3fc;&#x200d;&#x2708;&#xfe0f;','&#x1f9da;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9da;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9da;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9da;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9da;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9d9;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9d9;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9d9;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9d9;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9d9;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9d9;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9d9;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9d9;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9d9;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9d9;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9d8;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9d8;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f468;&#x1f3fd;&#x200d;&#x2695;&#xfe0f;','&#x1f468;&#x1f3fd;&#x200d;&#x2696;&#xfe0f;','&#x1f468;&#x1f3fd;&#x200d;&#x2708;&#xfe0f;','&#x1f9d8;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9d8;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9d8;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9d8;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9d8;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9d8;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9d8;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9d8;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9d7;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9d7;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9d7;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9d7;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9d7;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9d7;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9d7;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9d7;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9d7;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f468;&#x1f3fe;&#x200d;&#x2695;&#xfe0f;','&#x1f468;&#x1f3fe;&#x200d;&#x2696;&#xfe0f;','&#x1f468;&#x1f3fe;&#x200d;&#x2708;&#xfe0f;','&#x1f9d7;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9d6;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9d6;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9d6;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9d6;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9d6;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9d6;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9d6;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9d6;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9d6;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9d6;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9b9;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9b9;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9b9;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f9b9;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9b9;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f9b9;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f468;&#x1f3ff;&#x200d;&#x2695;&#xfe0f;','&#x1f468;&#x1f3ff;&#x200d;&#x2696;&#xfe0f;','&#x1f468;&#x1f3ff;&#x200d;&#x2708;&#xfe0f;','&#x1f9b9;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9b9;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9b9;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9b9;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f9b8;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f9b8;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f9b8;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f3c3;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9b8;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f3c3;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f3c3;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9b8;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f3c3;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f3c3;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f3c3;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f3c4;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f3c4;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f3c4;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f3c4;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f3c4;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f3c4;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f3c4;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f9b8;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f9b8;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f9b8;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f9b8;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f9b8;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f93e;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f93e;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f93e;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f93e;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f93e;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f93e;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f93e;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f93e;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f3c4;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f3c4;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f93e;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f93e;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f93d;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f93d;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f93d;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f93d;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f93d;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f93d;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f93d;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f93d;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f93d;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f93d;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f939;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f939;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f939;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f939;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f939;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f469;&#x1f3fb;&#x200d;&#x2695;&#xfe0f;','&#x1f469;&#x1f3fb;&#x200d;&#x2696;&#xfe0f;','&#x1f469;&#x1f3fb;&#x200d;&#x2708;&#xfe0f;','&#x1f939;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f939;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f939;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f939;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f939;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f938;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f938;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f938;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f938;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f938;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f938;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f938;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f938;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f938;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f938;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f937;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f937;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f469;&#x1f3fc;&#x200d;&#x2695;&#xfe0f;','&#x1f469;&#x1f3fc;&#x200d;&#x2696;&#xfe0f;','&#x1f469;&#x1f3fc;&#x200d;&#x2708;&#xfe0f;','&#x1f937;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f937;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f937;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f937;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f937;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f937;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f937;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f937;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f935;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f3c3;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f935;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f935;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f935;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f935;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f935;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f935;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f935;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f469;&#x1f3fd;&#x200d;&#x2695;&#xfe0f;','&#x1f469;&#x1f3fd;&#x200d;&#x2696;&#xfe0f;','&#x1f469;&#x1f3fd;&#x200d;&#x2708;&#xfe0f;','&#x1f935;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f926;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f926;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f926;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f926;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f926;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f926;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f926;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f926;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f926;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f926;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f6b6;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f6b6;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f6b6;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f6b6;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f6b6;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f6b6;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f469;&#x1f3fe;&#x200d;&#x2695;&#xfe0f;','&#x1f469;&#x1f3fe;&#x200d;&#x2696;&#xfe0f;','&#x1f469;&#x1f3fe;&#x200d;&#x2708;&#xfe0f;','&#x1f6b6;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f6b6;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f6b6;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f6b6;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f6b5;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f6b5;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f6b5;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f6b5;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f6b5;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f6b5;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f6b5;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f6b5;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f6b5;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f6b5;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f6b4;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f6b4;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f6b4;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f469;&#x1f3ff;&#x200d;&#x2695;&#xfe0f;','&#x1f469;&#x1f3ff;&#x200d;&#x2696;&#xfe0f;','&#x1f469;&#x1f3ff;&#x200d;&#x2708;&#xfe0f;','&#x1f6b4;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f6b4;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f6b4;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f6b4;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f6b4;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f6b4;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f6b4;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f3c4;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f3ca;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f3ca;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f3ca;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f3ca;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f3ca;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f3ca;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f3ca;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f6a3;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f6a3;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f6a3;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f6a3;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f64e;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64e;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f64e;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f64e;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f64e;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f3ca;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f3ca;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f3ca;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f3cb;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f46e;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f46e;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f46e;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f46e;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f46e;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f46e;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f46e;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f46e;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f46e;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f46e;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64e;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f64e;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f64e;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f64e;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f471;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f471;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f471;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f471;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f471;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f471;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f471;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f471;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f471;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f471;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64e;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f64d;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f473;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f473;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f473;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f473;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f473;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f473;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f473;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f473;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f473;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f473;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64d;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f64d;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f477;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f477;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f477;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f477;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f477;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f477;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f477;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f477;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f477;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f477;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64d;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f64d;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f481;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f481;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f481;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f481;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f481;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f481;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f481;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f481;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f481;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f481;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64d;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f64d;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f3c3;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f482;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f482;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f482;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f482;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f482;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f482;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f482;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f482;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f482;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64d;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f64d;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f486;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f486;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f486;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f486;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f486;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f486;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f486;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f486;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f486;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f486;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64d;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f64b;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f487;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f487;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f487;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f487;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f487;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f487;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f487;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f487;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f487;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f487;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64b;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f64b;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f574;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f574;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f574;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f574;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f574;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f574;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f574;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f574;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f574;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f574;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f575;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f575;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f575;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f575;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f575;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f575;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f575;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f575;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f575;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f575;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f645;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f645;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f645;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f645;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f645;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f645;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f645;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f645;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f645;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f645;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64b;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f64b;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f646;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f646;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f646;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f646;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f646;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f646;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f646;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f646;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f646;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f646;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64b;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f64b;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f647;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f647;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f647;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f647;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x1f647;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x1f647;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x1f647;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f647;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x1f647;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x1f647;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f64b;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x1f64b;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x1f64b;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x1f574;&#xfe0f;&#x200d;&#x2640;&#xfe0f;','&#x1f574;&#xfe0f;&#x200d;&#x2642;&#xfe0f;','&#x1f3cb;&#xfe0f;&#x200d;&#x2640;&#xfe0f;','&#x1f3cb;&#xfe0f;&#x200d;&#x2642;&#xfe0f;','&#x26f9;&#x1f3fe;&#x200d;&#x2640;&#xfe0f;','&#x1f3cc;&#xfe0f;&#x200d;&#x2640;&#xfe0f;','&#x1f3cc;&#xfe0f;&#x200d;&#x2642;&#xfe0f;','&#x26f9;&#x1f3fb;&#x200d;&#x2642;&#xfe0f;','&#x26f9;&#x1f3fb;&#x200d;&#x2640;&#xfe0f;','&#x26f9;&#x1f3fe;&#x200d;&#x2642;&#xfe0f;','&#x26f9;&#x1f3ff;&#x200d;&#x2640;&#xfe0f;','&#x26f9;&#x1f3ff;&#x200d;&#x2642;&#xfe0f;','&#x1f575;&#xfe0f;&#x200d;&#x2640;&#xfe0f;','&#x1f575;&#xfe0f;&#x200d;&#x2642;&#xfe0f;','&#x26f9;&#x1f3fd;&#x200d;&#x2640;&#xfe0f;','&#x26f9;&#x1f3fd;&#x200d;&#x2642;&#xfe0f;','&#x26f9;&#x1f3fc;&#x200d;&#x2640;&#xfe0f;','&#x26f9;&#x1f3fc;&#x200d;&#x2642;&#xfe0f;','&#x26f9;&#xfe0f;&#x200d;&#x2640;&#xfe0f;','&#x26f9;&#xfe0f;&#x200d;&#x2642;&#xfe0f;','&#x1f469;&#x1f3fb;&#x200d;&#x1f3a8;','&#x1f468;&#x1f3fb;&#x200d;&#x1f33e;','&#x1f468;&#x1f3fb;&#x200d;&#x1f373;','&#x1f468;&#x1f3fb;&#x200d;&#x1f393;','&#x1f468;&#x1f3fb;&#x200d;&#x1f3a4;','&#x1f468;&#x1f3fb;&#x200d;&#x1f3a8;','&#x1f468;&#x1f3fb;&#x200d;&#x1f3eb;','&#x1f468;&#x1f3fb;&#x200d;&#x1f3ed;','&#x1f468;&#x1f3fb;&#x200d;&#x1f4bb;','&#x1f468;&#x1f3fb;&#x200d;&#x1f4bc;','&#x1f468;&#x1f3fb;&#x200d;&#x1f527;','&#x1f468;&#x1f3fb;&#x200d;&#x1f52c;','&#x1f468;&#x1f3fb;&#x200d;&#x1f680;','&#x1f468;&#x1f3fb;&#x200d;&#x1f692;','&#x1f468;&#x1f3fb;&#x200d;&#x1f9b0;','&#x1f468;&#x1f3fb;&#x200d;&#x1f9b1;','&#x1f468;&#x1f3fb;&#x200d;&#x1f9b2;','&#x1f468;&#x1f3fb;&#x200d;&#x1f9b3;','&#x1f468;&#x1f3fc;&#x200d;&#x1f33e;','&#x1f468;&#x1f3fc;&#x200d;&#x1f373;','&#x1f468;&#x1f3fc;&#x200d;&#x1f393;','&#x1f468;&#x1f3fc;&#x200d;&#x1f3a4;','&#x1f468;&#x1f3fc;&#x200d;&#x1f3a8;','&#x1f468;&#x1f3fc;&#x200d;&#x1f3eb;','&#x1f468;&#x1f3fc;&#x200d;&#x1f3ed;','&#x1f468;&#x1f3fc;&#x200d;&#x1f4bb;','&#x1f468;&#x1f3fc;&#x200d;&#x1f4bc;','&#x1f468;&#x1f3fc;&#x200d;&#x1f527;','&#x1f468;&#x1f3fc;&#x200d;&#x1f52c;','&#x1f468;&#x1f3fc;&#x200d;&#x1f680;','&#x1f468;&#x1f3fc;&#x200d;&#x1f692;','&#x1f468;&#x1f3fc;&#x200d;&#x1f9b0;','&#x1f468;&#x1f3fc;&#x200d;&#x1f9b1;','&#x1f468;&#x1f3fc;&#x200d;&#x1f9b2;','&#x1f468;&#x1f3fc;&#x200d;&#x1f9b3;','&#x1f468;&#x1f3fd;&#x200d;&#x1f33e;','&#x1f468;&#x1f3fd;&#x200d;&#x1f373;','&#x1f468;&#x1f3fd;&#x200d;&#x1f393;','&#x1f468;&#x1f3fd;&#x200d;&#x1f3a4;','&#x1f468;&#x1f3fd;&#x200d;&#x1f3a8;','&#x1f468;&#x1f3fd;&#x200d;&#x1f3eb;','&#x1f468;&#x1f3fd;&#x200d;&#x1f3ed;','&#x1f468;&#x1f3fd;&#x200d;&#x1f4bb;','&#x1f468;&#x1f3fd;&#x200d;&#x1f4bc;','&#x1f468;&#x1f3fd;&#x200d;&#x1f527;','&#x1f468;&#x1f3fd;&#x200d;&#x1f52c;','&#x1f468;&#x1f3fd;&#x200d;&#x1f680;','&#x1f468;&#x1f3fd;&#x200d;&#x1f692;','&#x1f468;&#x1f3fd;&#x200d;&#x1f9b0;','&#x1f468;&#x1f3fd;&#x200d;&#x1f9b1;','&#x1f468;&#x1f3fd;&#x200d;&#x1f9b2;','&#x1f469;&#x1f3ff;&#x200d;&#x1f9b3;','&#x1f469;&#x1f3ff;&#x200d;&#x1f9b2;','&#x1f469;&#x1f3ff;&#x200d;&#x1f9b1;','&#x1f468;&#x1f3fd;&#x200d;&#x1f9b3;','&#x1f468;&#x1f3fe;&#x200d;&#x1f33e;','&#x1f469;&#x1f3ff;&#x200d;&#x1f9b0;','&#x1f469;&#x1f3ff;&#x200d;&#x1f692;','&#x1f469;&#x1f3ff;&#x200d;&#x1f680;','&#x1f469;&#x1f3ff;&#x200d;&#x1f52c;','&#x1f469;&#x1f3ff;&#x200d;&#x1f527;','&#x1f469;&#x1f3ff;&#x200d;&#x1f4bc;','&#x1f469;&#x1f3ff;&#x200d;&#x1f4bb;','&#x1f469;&#x1f3ff;&#x200d;&#x1f3ed;','&#x1f469;&#x1f3ff;&#x200d;&#x1f3eb;','&#x1f469;&#x1f3ff;&#x200d;&#x1f3a8;','&#x1f468;&#x1f3fe;&#x200d;&#x1f373;','&#x1f468;&#x1f3fe;&#x200d;&#x1f393;','&#x1f469;&#x1f3ff;&#x200d;&#x1f3a4;','&#x1f469;&#x1f3ff;&#x200d;&#x1f393;','&#x1f469;&#x1f3ff;&#x200d;&#x1f373;','&#x1f469;&#x1f3ff;&#x200d;&#x1f33e;','&#x1f469;&#x1f3fe;&#x200d;&#x1f9b3;','&#x1f469;&#x1f3fe;&#x200d;&#x1f9b2;','&#x1f469;&#x1f3fe;&#x200d;&#x1f9b1;','&#x1f469;&#x1f3fe;&#x200d;&#x1f9b0;','&#x1f469;&#x1f3fe;&#x200d;&#x1f692;','&#x1f469;&#x1f3fe;&#x200d;&#x1f680;','&#x1f468;&#x1f3fe;&#x200d;&#x1f3a4;','&#x1f468;&#x1f3fe;&#x200d;&#x1f3a8;','&#x1f469;&#x1f3fe;&#x200d;&#x1f52c;','&#x1f469;&#x1f3fe;&#x200d;&#x1f527;','&#x1f469;&#x1f3fe;&#x200d;&#x1f4bc;','&#x1f469;&#x1f3fe;&#x200d;&#x1f4bb;','&#x1f469;&#x1f3fe;&#x200d;&#x1f3ed;','&#x1f469;&#x1f3fe;&#x200d;&#x1f3eb;','&#x1f469;&#x1f3fe;&#x200d;&#x1f3a8;','&#x1f469;&#x1f3fe;&#x200d;&#x1f3a4;','&#x1f469;&#x1f3fe;&#x200d;&#x1f393;','&#x1f469;&#x1f3fe;&#x200d;&#x1f373;','&#x1f468;&#x1f3fe;&#x200d;&#x1f3eb;','&#x1f468;&#x1f3fe;&#x200d;&#x1f3ed;','&#x1f469;&#x1f3fe;&#x200d;&#x1f33e;','&#x1f469;&#x1f3fd;&#x200d;&#x1f9b3;','&#x1f469;&#x1f3fd;&#x200d;&#x1f9b2;','&#x1f469;&#x1f3fd;&#x200d;&#x1f9b1;','&#x1f469;&#x1f3fd;&#x200d;&#x1f9b0;','&#x1f469;&#x1f3fd;&#x200d;&#x1f692;','&#x1f469;&#x1f3fd;&#x200d;&#x1f680;','&#x1f469;&#x1f3fd;&#x200d;&#x1f52c;','&#x1f469;&#x1f3fd;&#x200d;&#x1f527;','&#x1f469;&#x1f3fd;&#x200d;&#x1f4bc;','&#x1f468;&#x1f3fe;&#x200d;&#x1f4bb;','&#x1f468;&#x1f3fe;&#x200d;&#x1f4bc;','&#x1f469;&#x1f3fd;&#x200d;&#x1f4bb;','&#x1f469;&#x1f3fd;&#x200d;&#x1f3ed;','&#x1f469;&#x1f3fd;&#x200d;&#x1f3eb;','&#x1f469;&#x1f3fd;&#x200d;&#x1f3a8;','&#x1f469;&#x1f3fd;&#x200d;&#x1f3a4;','&#x1f469;&#x1f3fd;&#x200d;&#x1f393;','&#x1f469;&#x1f3fd;&#x200d;&#x1f373;','&#x1f469;&#x1f3fd;&#x200d;&#x1f33e;','&#x1f469;&#x1f3fc;&#x200d;&#x1f9b3;','&#x1f469;&#x1f3fc;&#x200d;&#x1f9b2;','&#x1f468;&#x1f3fe;&#x200d;&#x1f527;','&#x1f468;&#x1f3fe;&#x200d;&#x1f52c;','&#x1f469;&#x1f3fc;&#x200d;&#x1f9b1;','&#x1f469;&#x1f3fc;&#x200d;&#x1f9b0;','&#x1f469;&#x1f3fc;&#x200d;&#x1f692;','&#x1f469;&#x1f3fc;&#x200d;&#x1f680;','&#x1f469;&#x1f3fc;&#x200d;&#x1f52c;','&#x1f469;&#x1f3fc;&#x200d;&#x1f527;','&#x1f469;&#x1f3fc;&#x200d;&#x1f4bc;','&#x1f469;&#x1f3fc;&#x200d;&#x1f4bb;','&#x1f469;&#x1f3fc;&#x200d;&#x1f3ed;','&#x1f469;&#x1f3fc;&#x200d;&#x1f3eb;','&#x1f468;&#x1f3fe;&#x200d;&#x1f680;','&#x1f468;&#x1f3fe;&#x200d;&#x1f692;','&#x1f469;&#x1f3fc;&#x200d;&#x1f3a8;','&#x1f469;&#x1f3fc;&#x200d;&#x1f3a4;','&#x1f469;&#x1f3fc;&#x200d;&#x1f393;','&#x1f469;&#x1f3fc;&#x200d;&#x1f373;','&#x1f469;&#x1f3fc;&#x200d;&#x1f33e;','&#x1f469;&#x1f3fb;&#x200d;&#x1f9b3;','&#x1f469;&#x1f3fb;&#x200d;&#x1f9b2;','&#x1f469;&#x1f3fb;&#x200d;&#x1f9b1;','&#x1f469;&#x1f3fb;&#x200d;&#x1f9b0;','&#x1f469;&#x1f3fb;&#x200d;&#x1f692;','&#x1f468;&#x1f3fe;&#x200d;&#x1f9b0;','&#x1f468;&#x1f3fe;&#x200d;&#x1f9b1;','&#x1f468;&#x1f3fe;&#x200d;&#x1f9b2;','&#x1f468;&#x1f3fe;&#x200d;&#x1f9b3;','&#x1f469;&#x1f3fb;&#x200d;&#x1f680;','&#x1f469;&#x1f3fb;&#x200d;&#x1f52c;','&#x1f469;&#x1f3fb;&#x200d;&#x1f527;','&#x1f469;&#x1f3fb;&#x200d;&#x1f4bc;','&#x1f469;&#x1f3fb;&#x200d;&#x1f4bb;','&#x1f469;&#x1f3fb;&#x200d;&#x1f3ed;','&#x1f469;&#x1f3fb;&#x200d;&#x1f3eb;','&#x1f468;&#x1f3ff;&#x200d;&#x1f33e;','&#x1f469;&#x1f3fb;&#x200d;&#x1f3a4;','&#x1f469;&#x1f3fb;&#x200d;&#x1f393;','&#x1f468;&#x1f3ff;&#x200d;&#x1f373;','&#x1f468;&#x1f3ff;&#x200d;&#x1f393;','&#x1f469;&#x1f3fb;&#x200d;&#x1f373;','&#x1f469;&#x1f3fb;&#x200d;&#x1f33e;','&#x1f468;&#x1f3ff;&#x200d;&#x1f3a4;','&#x1f468;&#x1f3ff;&#x200d;&#x1f3a8;','&#x1f468;&#x1f3ff;&#x200d;&#x1f3eb;','&#x1f468;&#x1f3ff;&#x200d;&#x1f3ed;','&#x1f468;&#x1f3ff;&#x200d;&#x1f4bb;','&#x1f468;&#x1f3ff;&#x200d;&#x1f4bc;','&#x1f468;&#x1f3ff;&#x200d;&#x1f527;','&#x1f468;&#x1f3ff;&#x200d;&#x1f52c;','&#x1f468;&#x1f3ff;&#x200d;&#x1f680;','&#x1f468;&#x1f3ff;&#x200d;&#x1f692;','&#x1f468;&#x1f3ff;&#x200d;&#x1f9b0;','&#x1f468;&#x1f3ff;&#x200d;&#x1f9b1;','&#x1f468;&#x1f3ff;&#x200d;&#x1f9b2;','&#x1f468;&#x1f3ff;&#x200d;&#x1f9b3;','&#x1f3f3;&#xfe0f;&#x200d;&#x1f308;','&#x1f469;&#x200d;&#x2696;&#xfe0f;','&#x1f9b8;&#x200d;&#x2642;&#xfe0f;','&#x1f93e;&#x200d;&#x2642;&#xfe0f;','&#x1f93e;&#x200d;&#x2640;&#xfe0f;','&#x1f9b9;&#x200d;&#x2640;&#xfe0f;','&#x1f9b9;&#x200d;&#x2642;&#xfe0f;','&#x1f468;&#x200d;&#x2695;&#xfe0f;','&#x1f468;&#x200d;&#x2696;&#xfe0f;','&#x1f468;&#x200d;&#x2708;&#xfe0f;','&#x1f93d;&#x200d;&#x2642;&#xfe0f;','&#x1f93d;&#x200d;&#x2640;&#xfe0f;','&#x1f9d6;&#x200d;&#x2640;&#xfe0f;','&#x1f9d6;&#x200d;&#x2642;&#xfe0f;','&#x1f647;&#x200d;&#x2640;&#xfe0f;','&#x1f93c;&#x200d;&#x2642;&#xfe0f;','&#x1f93c;&#x200d;&#x2640;&#xfe0f;','&#x1f939;&#x200d;&#x2642;&#xfe0f;','&#x1f939;&#x200d;&#x2640;&#xfe0f;','&#x1f938;&#x200d;&#x2642;&#xfe0f;','&#x1f938;&#x200d;&#x2640;&#xfe0f;','&#x1f937;&#x200d;&#x2642;&#xfe0f;','&#x1f937;&#x200d;&#x2640;&#xfe0f;','&#x1f935;&#x200d;&#x2642;&#xfe0f;','&#x1f9d7;&#x200d;&#x2640;&#xfe0f;','&#x1f9d7;&#x200d;&#x2642;&#xfe0f;','&#x1f935;&#x200d;&#x2640;&#xfe0f;','&#x1f926;&#x200d;&#x2642;&#xfe0f;','&#x1f926;&#x200d;&#x2640;&#xfe0f;','&#x1f6b6;&#x200d;&#x2642;&#xfe0f;','&#x1f6b6;&#x200d;&#x2640;&#xfe0f;','&#x1f6b5;&#x200d;&#x2642;&#xfe0f;','&#x1f6b5;&#x200d;&#x2640;&#xfe0f;','&#x1f6b4;&#x200d;&#x2642;&#xfe0f;','&#x1f6b4;&#x200d;&#x2640;&#xfe0f;','&#x1f9d8;&#x200d;&#x2640;&#xfe0f;','&#x1f9d8;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x200d;&#x2642;&#xfe0f;','&#x1f6a3;&#x200d;&#x2640;&#xfe0f;','&#x1f9d9;&#x200d;&#x2640;&#xfe0f;','&#x1f9d9;&#x200d;&#x2642;&#xfe0f;','&#x1f64e;&#x200d;&#x2642;&#xfe0f;','&#x1f64e;&#x200d;&#x2640;&#xfe0f;','&#x1f9da;&#x200d;&#x2640;&#xfe0f;','&#x1f9da;&#x200d;&#x2642;&#xfe0f;','&#x1f469;&#x200d;&#x2695;&#xfe0f;','&#x1f9b8;&#x200d;&#x2640;&#xfe0f;','&#x1f469;&#x200d;&#x2708;&#xfe0f;','&#x1f46e;&#x200d;&#x2640;&#xfe0f;','&#x1f46e;&#x200d;&#x2642;&#xfe0f;','&#x1f46f;&#x200d;&#x2640;&#xfe0f;','&#x1f46f;&#x200d;&#x2642;&#xfe0f;','&#x1f471;&#x200d;&#x2640;&#xfe0f;','&#x1f9db;&#x200d;&#x2640;&#xfe0f;','&#x1f9db;&#x200d;&#x2642;&#xfe0f;','&#x1f64d;&#x200d;&#x2642;&#xfe0f;','&#x1f64d;&#x200d;&#x2640;&#xfe0f;','&#x1f471;&#x200d;&#x2642;&#xfe0f;','&#x1f473;&#x200d;&#x2640;&#xfe0f;','&#x1f473;&#x200d;&#x2642;&#xfe0f;','&#x1f477;&#x200d;&#x2640;&#xfe0f;','&#x1f477;&#x200d;&#x2642;&#xfe0f;','&#x1f481;&#x200d;&#x2640;&#xfe0f;','&#x1f481;&#x200d;&#x2642;&#xfe0f;','&#x1f482;&#x200d;&#x2640;&#xfe0f;','&#x1f9dc;&#x200d;&#x2640;&#xfe0f;','&#x1f9dc;&#x200d;&#x2642;&#xfe0f;','&#x1f482;&#x200d;&#x2642;&#xfe0f;','&#x1f486;&#x200d;&#x2640;&#xfe0f;','&#x1f64b;&#x200d;&#x2642;&#xfe0f;','&#x1f64b;&#x200d;&#x2640;&#xfe0f;','&#x1f486;&#x200d;&#x2642;&#xfe0f;','&#x1f487;&#x200d;&#x2640;&#xfe0f;','&#x1f487;&#x200d;&#x2642;&#xfe0f;','&#x1f645;&#x200d;&#x2640;&#xfe0f;','&#x1f645;&#x200d;&#x2642;&#xfe0f;','&#x1f9dd;&#x200d;&#x2640;&#xfe0f;','&#x1f9dd;&#x200d;&#x2642;&#xfe0f;','&#x1f9de;&#x200d;&#x2640;&#xfe0f;','&#x1f9de;&#x200d;&#x2642;&#xfe0f;','&#x1f9df;&#x200d;&#x2640;&#xfe0f;','&#x1f9df;&#x200d;&#x2642;&#xfe0f;','&#x1f3f4;&#x200d;&#x2620;&#xfe0f;','&#x1f647;&#x200d;&#x2642;&#xfe0f;','&#x1f646;&#x200d;&#x2640;&#xfe0f;','&#x1f646;&#x200d;&#x2642;&#xfe0f;','&#x1f3ca;&#x200d;&#x2642;&#xfe0f;','&#x1f3ca;&#x200d;&#x2640;&#xfe0f;','&#x1f3c4;&#x200d;&#x2642;&#xfe0f;','&#x1f3c4;&#x200d;&#x2640;&#xfe0f;','&#x1f3c3;&#x200d;&#x2642;&#xfe0f;','&#x1f3c3;&#x200d;&#x2640;&#xfe0f;','&#x1f468;&#x200d;&#x1f3a8;','&#x1f469;&#x200d;&#x1f373;','&#x1f469;&#x200d;&#x1f393;','&#x1f469;&#x200d;&#x1f3a4;','&#x1f469;&#x200d;&#x1f3a8;','&#x1f469;&#x200d;&#x1f3eb;','&#x1f469;&#x200d;&#x1f3ed;','&#x1f468;&#x200d;&#x1f4bb;','&#x1f468;&#x200d;&#x1f692;','&#x1f469;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x1f467;','&#x1f468;&#x200d;&#x1f9b0;','&#x1f468;&#x200d;&#x1f9b1;','&#x1f469;&#x200d;&#x1f4bb;','&#x1f469;&#x200d;&#x1f4bc;','&#x1f469;&#x200d;&#x1f527;','&#x1f469;&#x200d;&#x1f52c;','&#x1f469;&#x200d;&#x1f680;','&#x1f469;&#x200d;&#x1f692;','&#x1f469;&#x200d;&#x1f9b0;','&#x1f469;&#x200d;&#x1f9b1;','&#x1f441;&#x200d;&#x1f5e8;','&#x1f468;&#x200d;&#x1f9b2;','&#x1f468;&#x200d;&#x1f9b3;','&#x1f468;&#x200d;&#x1f466;','&#x1f468;&#x200d;&#x1f3a4;','&#x1f469;&#x200d;&#x1f9b2;','&#x1f469;&#x200d;&#x1f9b3;','&#x1f468;&#x200d;&#x1f393;','&#x1f468;&#x200d;&#x1f373;','&#x1f468;&#x200d;&#x1f33e;','&#x1f468;&#x200d;&#x1f4bc;','&#x1f468;&#x200d;&#x1f527;','&#x1f468;&#x200d;&#x1f52c;','&#x1f468;&#x200d;&#x1f680;','&#x1f468;&#x200d;&#x1f3ed;','&#x1f469;&#x200d;&#x1f33e;','&#x1f468;&#x200d;&#x1f3eb;','&#x1f469;&#x200d;&#x1f467;','&#x1f446;&#x1f3ff;','&#x1f447;&#x1f3fb;','&#x1f477;&#x1f3fc;','&#x1f447;&#x1f3fc;','&#x1f447;&#x1f3fd;','&#x1f477;&#x1f3fd;','&#x1f447;&#x1f3fe;','&#x1f447;&#x1f3ff;','&#x1f477;&#x1f3fe;','&#x1f448;&#x1f3fb;','&#x1f448;&#x1f3fc;','&#x1f477;&#x1f3ff;','&#x1f448;&#x1f3fd;','&#x1f448;&#x1f3fe;','&#x1f478;&#x1f3fb;','&#x1f478;&#x1f3fc;','&#x1f478;&#x1f3fd;','&#x1f478;&#x1f3fe;','&#x1f478;&#x1f3ff;','&#x1f47c;&#x1f3fb;','&#x1f47c;&#x1f3fc;','&#x1f47c;&#x1f3fd;','&#x1f47c;&#x1f3fe;','&#x1f47c;&#x1f3ff;','&#x1f448;&#x1f3ff;','&#x1f449;&#x1f3fb;','&#x1f481;&#x1f3fb;','&#x1f449;&#x1f3fc;','&#x1f449;&#x1f3fd;','&#x1f481;&#x1f3fc;','&#x1f449;&#x1f3fe;','&#x1f449;&#x1f3ff;','&#x1f481;&#x1f3fd;','&#x1f44a;&#x1f3fb;','&#x1f44a;&#x1f3fc;','&#x1f481;&#x1f3fe;','&#x1f44a;&#x1f3fd;','&#x1f44a;&#x1f3fe;','&#x1f481;&#x1f3ff;','&#x1f44a;&#x1f3ff;','&#x1f44b;&#x1f3fb;','&#x1f44b;&#x1f3fc;','&#x1f44b;&#x1f3fd;','&#x1f482;&#x1f3fb;','&#x1f44b;&#x1f3fe;','&#x1f44b;&#x1f3ff;','&#x1f482;&#x1f3fc;','&#x1f44c;&#x1f3fb;','&#x1f44c;&#x1f3fc;','&#x1f482;&#x1f3fd;','&#x1f44c;&#x1f3fd;','&#x1f44c;&#x1f3fe;','&#x1f482;&#x1f3fe;','&#x1f44c;&#x1f3ff;','&#x1f44d;&#x1f3fb;','&#x1f482;&#x1f3ff;','&#x1f44d;&#x1f3fc;','&#x1f44d;&#x1f3fd;','&#x1f483;&#x1f3fb;','&#x1f483;&#x1f3fc;','&#x1f483;&#x1f3fd;','&#x1f483;&#x1f3fe;','&#x1f483;&#x1f3ff;','&#x1f485;&#x1f3fb;','&#x1f485;&#x1f3fc;','&#x1f485;&#x1f3fd;','&#x1f485;&#x1f3fe;','&#x1f485;&#x1f3ff;','&#x1f44d;&#x1f3fe;','&#x1f44d;&#x1f3ff;','&#x1f486;&#x1f3fb;','&#x1f44e;&#x1f3fb;','&#x1f44e;&#x1f3fc;','&#x1f486;&#x1f3fc;','&#x1f44e;&#x1f3fd;','&#x1f44e;&#x1f3fe;','&#x1f486;&#x1f3fd;','&#x1f44e;&#x1f3ff;','&#x1f44f;&#x1f3fb;','&#x1f486;&#x1f3fe;','&#x1f44f;&#x1f3fc;','&#x1f44f;&#x1f3fd;','&#x1f486;&#x1f3ff;','&#x1f44f;&#x1f3fe;','&#x1f44f;&#x1f3ff;','&#x1f450;&#x1f3fb;','&#x1f450;&#x1f3fc;','&#x1f487;&#x1f3fb;','&#x1f450;&#x1f3fd;','&#x1f450;&#x1f3fe;','&#x1f487;&#x1f3fc;','&#x1f450;&#x1f3ff;','&#x1f466;&#x1f3fb;','&#x1f487;&#x1f3fd;','&#x1f466;&#x1f3fc;','&#x1f466;&#x1f3fd;','&#x1f487;&#x1f3fe;','&#x1f466;&#x1f3fe;','&#x1f466;&#x1f3ff;','&#x1f487;&#x1f3ff;','&#x1f467;&#x1f3fb;','&#x1f467;&#x1f3fc;','&#x1f4aa;&#x1f3fb;','&#x1f4aa;&#x1f3fc;','&#x1f4aa;&#x1f3fd;','&#x1f4aa;&#x1f3fe;','&#x1f4aa;&#x1f3ff;','&#x1f467;&#x1f3fd;','&#x1f467;&#x1f3fe;','&#x1f574;&#x1f3fb;','&#x1f467;&#x1f3ff;','&#x1f1ea;&#x1f1ea;','&#x1f574;&#x1f3fc;','&#x1f1ea;&#x1f1ec;','&#x1f1ea;&#x1f1ed;','&#x1f574;&#x1f3fd;','&#x1f1ea;&#x1f1f7;','&#x1f1ea;&#x1f1f8;','&#x1f574;&#x1f3fe;','&#x1f1ea;&#x1f1f9;','&#x1f1ea;&#x1f1fa;','&#x1f574;&#x1f3ff;','&#x1f1eb;&#x1f1ee;','&#x1f1eb;&#x1f1ef;','&#x1f1eb;&#x1f1f0;','&#x1f1eb;&#x1f1f2;','&#x1f575;&#x1f3fb;','&#x1f1eb;&#x1f1f4;','&#x1f1eb;&#x1f1f7;','&#x1f575;&#x1f3fc;','&#x1f1ec;&#x1f1e6;','&#x1f1ec;&#x1f1e7;','&#x1f575;&#x1f3fd;','&#x1f1ec;&#x1f1e9;','&#x1f1ec;&#x1f1ea;','&#x1f575;&#x1f3fe;','&#x1f1ec;&#x1f1eb;','&#x1f1ec;&#x1f1ec;','&#x1f575;&#x1f3ff;','&#x1f1ec;&#x1f1ed;','&#x1f468;&#x1f3fb;','&#x1f57a;&#x1f3fb;','&#x1f57a;&#x1f3fc;','&#x1f57a;&#x1f3fd;','&#x1f57a;&#x1f3fe;','&#x1f57a;&#x1f3ff;','&#x1f590;&#x1f3fb;','&#x1f590;&#x1f3fc;','&#x1f590;&#x1f3fd;','&#x1f590;&#x1f3fe;','&#x1f590;&#x1f3ff;','&#x1f595;&#x1f3fb;','&#x1f595;&#x1f3fc;','&#x1f595;&#x1f3fd;','&#x1f595;&#x1f3fe;','&#x1f595;&#x1f3ff;','&#x1f596;&#x1f3fb;','&#x1f596;&#x1f3fc;','&#x1f596;&#x1f3fd;','&#x1f596;&#x1f3fe;','&#x1f596;&#x1f3ff;','&#x1f1ec;&#x1f1ee;','&#x1f1ec;&#x1f1f1;','&#x1f645;&#x1f3fb;','&#x1f1ec;&#x1f1f2;','&#x1f1ec;&#x1f1f3;','&#x1f645;&#x1f3fc;','&#x1f1ec;&#x1f1f5;','&#x1f1ec;&#x1f1f6;','&#x1f645;&#x1f3fd;','&#x1f1ec;&#x1f1f7;','&#x1f1ec;&#x1f1f8;','&#x1f645;&#x1f3fe;','&#x1f1ec;&#x1f1f9;','&#x1f1ec;&#x1f1fa;','&#x1f645;&#x1f3ff;','&#x1f1ec;&#x1f1fc;','&#x1f1ec;&#x1f1fe;','&#x1f1ed;&#x1f1f0;','&#x1f1ed;&#x1f1f2;','&#x1f646;&#x1f3fb;','&#x1f1ed;&#x1f1f3;','&#x1f1ed;&#x1f1f7;','&#x1f646;&#x1f3fc;','&#x1f1ed;&#x1f1f9;','&#x1f1ed;&#x1f1fa;','&#x1f646;&#x1f3fd;','&#x1f1ee;&#x1f1e8;','&#x1f1ee;&#x1f1e9;','&#x1f646;&#x1f3fe;','&#x1f468;&#x1f3fc;','&#x1f1ee;&#x1f1ea;','&#x1f646;&#x1f3ff;','&#x1f1ee;&#x1f1f1;','&#x1f1ee;&#x1f1f2;','&#x1f1ee;&#x1f1f3;','&#x1f1ee;&#x1f1f4;','&#x1f647;&#x1f3fb;','&#x1f1ee;&#x1f1f6;','&#x1f1ee;&#x1f1f7;','&#x1f647;&#x1f3fc;','&#x1f1ee;&#x1f1f8;','&#x1f1ee;&#x1f1f9;','&#x1f647;&#x1f3fd;','&#x1f1ef;&#x1f1ea;','&#x1f1ef;&#x1f1f2;','&#x1f647;&#x1f3fe;','&#x1f1ef;&#x1f1f4;','&#x1f1ef;&#x1f1f5;','&#x1f647;&#x1f3ff;','&#x1f1f0;&#x1f1ea;','&#x1f1f0;&#x1f1ec;','&#x1f1f0;&#x1f1ed;','&#x1f1f0;&#x1f1ee;','&#x1f64b;&#x1f3fb;','&#x1f1f0;&#x1f1f2;','&#x1f1f0;&#x1f1f3;','&#x1f64b;&#x1f3fc;','&#x1f1f0;&#x1f1f5;','&#x1f468;&#x1f3fd;','&#x1f64b;&#x1f3fd;','&#x1f1f0;&#x1f1f7;','&#x1f1f0;&#x1f1fc;','&#x1f64b;&#x1f3fe;','&#x1f1f0;&#x1f1fe;','&#x1f1f0;&#x1f1ff;','&#x1f64b;&#x1f3ff;','&#x1f1f1;&#x1f1e6;','&#x1f1f1;&#x1f1e7;','&#x1f64c;&#x1f3fb;','&#x1f64c;&#x1f3fc;','&#x1f64c;&#x1f3fd;','&#x1f64c;&#x1f3fe;','&#x1f64c;&#x1f3ff;','&#x1f1f1;&#x1f1e8;','&#x1f1f1;&#x1f1ee;','&#x1f64d;&#x1f3fb;','&#x1f1f1;&#x1f1f0;','&#x1f1f1;&#x1f1f7;','&#x1f64d;&#x1f3fc;','&#x1f1f1;&#x1f1f8;','&#x1f1f1;&#x1f1f9;','&#x1f64d;&#x1f3fd;','&#x1f1f1;&#x1f1fa;','&#x1f1f1;&#x1f1fb;','&#x1f64d;&#x1f3fe;','&#x1f1f1;&#x1f1fe;','&#x1f1f2;&#x1f1e6;','&#x1f64d;&#x1f3ff;','&#x1f1f2;&#x1f1e8;','&#x1f1f2;&#x1f1e9;','&#x1f1f2;&#x1f1ea;','&#x1f1f2;&#x1f1eb;','&#x1f64e;&#x1f3fb;','&#x1f468;&#x1f3fe;','&#x1f1f2;&#x1f1ec;','&#x1f64e;&#x1f3fc;','&#x1f1f2;&#x1f1ed;','&#x1f1f2;&#x1f1f0;','&#x1f64e;&#x1f3fd;','&#x1f1f2;&#x1f1f1;','&#x1f1f2;&#x1f1f2;','&#x1f64e;&#x1f3fe;','&#x1f1f2;&#x1f1f3;','&#x1f1f2;&#x1f1f4;','&#x1f64e;&#x1f3ff;','&#x1f1f2;&#x1f1f5;','&#x1f1f2;&#x1f1f6;','&#x1f64f;&#x1f3fb;','&#x1f64f;&#x1f3fc;','&#x1f64f;&#x1f3fd;','&#x1f64f;&#x1f3fe;','&#x1f64f;&#x1f3ff;','&#x1f1f2;&#x1f1f7;','&#x1f1f2;&#x1f1f8;','&#x1f6a3;&#x1f3fb;','&#x1f1f2;&#x1f1f9;','&#x1f1f2;&#x1f1fa;','&#x1f6a3;&#x1f3fc;','&#x1f1f2;&#x1f1fb;','&#x1f1f2;&#x1f1fc;','&#x1f6a3;&#x1f3fd;','&#x1f1f2;&#x1f1fd;','&#x1f1f2;&#x1f1fe;','&#x1f6a3;&#x1f3fe;','&#x1f1f2;&#x1f1ff;','&#x1f1f3;&#x1f1e6;','&#x1f6a3;&#x1f3ff;','&#x1f1f3;&#x1f1e8;','&#x1f468;&#x1f3ff;','&#x1f1f3;&#x1f1ea;','&#x1f1f3;&#x1f1eb;','&#x1f6b4;&#x1f3fb;','&#x1f1f3;&#x1f1ec;','&#x1f1f3;&#x1f1ee;','&#x1f6b4;&#x1f3fc;','&#x1f1f3;&#x1f1f1;','&#x1f1f3;&#x1f1f4;','&#x1f6b4;&#x1f3fd;','&#x1f1f3;&#x1f1f5;','&#x1f1f3;&#x1f1f7;','&#x1f6b4;&#x1f3fe;','&#x1f1f3;&#x1f1fa;','&#x1f1f3;&#x1f1ff;','&#x1f6b4;&#x1f3ff;','&#x1f1f4;&#x1f1f2;','&#x1f1f5;&#x1f1e6;','&#x1f1f5;&#x1f1ea;','&#x1f1f5;&#x1f1eb;','&#x1f6b5;&#x1f3fb;','&#x1f1f5;&#x1f1ec;','&#x1f1f5;&#x1f1ed;','&#x1f6b5;&#x1f3fc;','&#x1f1f5;&#x1f1f0;','&#x1f1f5;&#x1f1f1;','&#x1f6b5;&#x1f3fd;','&#x1f1f5;&#x1f1f2;','&#x1f1f5;&#x1f1f3;','&#x1f6b5;&#x1f3fe;','&#x1f1f5;&#x1f1f7;','&#x1f1f5;&#x1f1f8;','&#x1f6b5;&#x1f3ff;','&#x1f1f5;&#x1f1f9;','&#x1f1f5;&#x1f1fc;','&#x1f1f5;&#x1f1fe;','&#x1f1f6;&#x1f1e6;','&#x1f6b6;&#x1f3fb;','&#x1f1f7;&#x1f1ea;','&#x1f1f7;&#x1f1f4;','&#x1f6b6;&#x1f3fc;','&#x1f1f7;&#x1f1f8;','&#x1f1f7;&#x1f1fa;','&#x1f6b6;&#x1f3fd;','&#x1f1f7;&#x1f1fc;','&#x1f1f8;&#x1f1e6;','&#x1f6b6;&#x1f3fe;','&#x1f1f8;&#x1f1e7;','&#x1f1f8;&#x1f1e8;','&#x1f6b6;&#x1f3ff;','&#x1f1f8;&#x1f1e9;','&#x1f1f8;&#x1f1ea;','&#x1f6c0;&#x1f3fb;','&#x1f6c0;&#x1f3fc;','&#x1f6c0;&#x1f3fd;','&#x1f6c0;&#x1f3fe;','&#x1f6c0;&#x1f3ff;','&#x1f6cc;&#x1f3fb;','&#x1f6cc;&#x1f3fc;','&#x1f6cc;&#x1f3fd;','&#x1f6cc;&#x1f3fe;','&#x1f6cc;&#x1f3ff;','&#x1f918;&#x1f3fb;','&#x1f918;&#x1f3fc;','&#x1f918;&#x1f3fd;','&#x1f918;&#x1f3fe;','&#x1f918;&#x1f3ff;','&#x1f919;&#x1f3fb;','&#x1f919;&#x1f3fc;','&#x1f919;&#x1f3fd;','&#x1f919;&#x1f3fe;','&#x1f919;&#x1f3ff;','&#x1f91a;&#x1f3fb;','&#x1f91a;&#x1f3fc;','&#x1f91a;&#x1f3fd;','&#x1f91a;&#x1f3fe;','&#x1f91a;&#x1f3ff;','&#x1f91b;&#x1f3fb;','&#x1f91b;&#x1f3fc;','&#x1f91b;&#x1f3fd;','&#x1f91b;&#x1f3fe;','&#x1f91b;&#x1f3ff;','&#x1f91c;&#x1f3fb;','&#x1f91c;&#x1f3fc;','&#x1f91c;&#x1f3fd;','&#x1f91c;&#x1f3fe;','&#x1f91c;&#x1f3ff;','&#x1f91e;&#x1f3fb;','&#x1f91e;&#x1f3fc;','&#x1f91e;&#x1f3fd;','&#x1f91e;&#x1f3fe;','&#x1f91e;&#x1f3ff;','&#x1f91f;&#x1f3fb;','&#x1f91f;&#x1f3fc;','&#x1f91f;&#x1f3fd;','&#x1f91f;&#x1f3fe;','&#x1f91f;&#x1f3ff;','&#x1f1f8;&#x1f1ec;','&#x1f1f8;&#x1f1ed;','&#x1f926;&#x1f3fb;','&#x1f1f8;&#x1f1ee;','&#x1f1f8;&#x1f1ef;','&#x1f926;&#x1f3fc;','&#x1f1f8;&#x1f1f0;','&#x1f1e6;&#x1f1e9;','&#x1f926;&#x1f3fd;','&#x1f1f8;&#x1f1f2;','&#x1f1f8;&#x1f1f3;','&#x1f926;&#x1f3fe;','&#x1f1f8;&#x1f1f4;','&#x1f1f8;&#x1f1f7;','&#x1f926;&#x1f3ff;','&#x1f1f8;&#x1f1f8;','&#x1f1f8;&#x1f1f9;','&#x1f930;&#x1f3fb;','&#x1f930;&#x1f3fc;','&#x1f930;&#x1f3fd;','&#x1f930;&#x1f3fe;','&#x1f930;&#x1f3ff;','&#x1f931;&#x1f3fb;','&#x1f931;&#x1f3fc;','&#x1f931;&#x1f3fd;','&#x1f931;&#x1f3fe;','&#x1f931;&#x1f3ff;','&#x1f932;&#x1f3fb;','&#x1f932;&#x1f3fc;','&#x1f932;&#x1f3fd;','&#x1f932;&#x1f3fe;','&#x1f932;&#x1f3ff;','&#x1f933;&#x1f3fb;','&#x1f933;&#x1f3fc;','&#x1f933;&#x1f3fd;','&#x1f933;&#x1f3fe;','&#x1f933;&#x1f3ff;','&#x1f934;&#x1f3fb;','&#x1f934;&#x1f3fc;','&#x1f934;&#x1f3fd;','&#x1f934;&#x1f3fe;','&#x1f934;&#x1f3ff;','&#x1f1f8;&#x1f1fb;','&#x1f1f8;&#x1f1fd;','&#x1f935;&#x1f3fb;','&#x1f1f8;&#x1f1fe;','&#x1f1f8;&#x1f1ff;','&#x1f935;&#x1f3fc;','&#x1f1f9;&#x1f1e6;','&#x1f1f9;&#x1f1e8;','&#x1f935;&#x1f3fd;','&#x1f1f9;&#x1f1e9;','&#x1f1f9;&#x1f1eb;','&#x1f935;&#x1f3fe;','&#x1f1f9;&#x1f1ec;','&#x1f469;&#x1f3fb;','&#x1f935;&#x1f3ff;','&#x1f1f9;&#x1f1ed;','&#x1f1f9;&#x1f1ef;','&#x1f936;&#x1f3fb;','&#x1f936;&#x1f3fc;','&#x1f936;&#x1f3fd;','&#x1f936;&#x1f3fe;','&#x1f936;&#x1f3ff;','&#x1f1f9;&#x1f1f0;','&#x1f1f9;&#x1f1f1;','&#x1f937;&#x1f3fb;','&#x1f1f9;&#x1f1f2;','&#x1f1f9;&#x1f1f3;','&#x1f937;&#x1f3fc;','&#x1f1f9;&#x1f1f4;','&#x1f1f9;&#x1f1f7;','&#x1f937;&#x1f3fd;','&#x1f1f9;&#x1f1f9;','&#x1f1f9;&#x1f1fb;','&#x1f937;&#x1f3fe;','&#x1f1f9;&#x1f1fc;','&#x1f1f9;&#x1f1ff;','&#x1f937;&#x1f3ff;','&#x1f1fa;&#x1f1e6;','&#x1f1fa;&#x1f1ec;','&#x1f1fa;&#x1f1f2;','&#x1f1fa;&#x1f1f3;','&#x1f938;&#x1f3fb;','&#x1f1fa;&#x1f1f8;','&#x1f1fa;&#x1f1fe;','&#x1f938;&#x1f3fc;','&#x1f1fa;&#x1f1ff;','&#x1f1fb;&#x1f1e6;','&#x1f938;&#x1f3fd;','&#x1f469;&#x1f3fc;','&#x1f1fb;&#x1f1e8;','&#x1f938;&#x1f3fe;','&#x1f1fb;&#x1f1ea;','&#x1f1fb;&#x1f1ec;','&#x1f938;&#x1f3ff;','&#x1f1fb;&#x1f1ee;','&#x1f1fb;&#x1f1f3;','&#x1f1fb;&#x1f1fa;','&#x1f1fc;&#x1f1eb;','&#x1f939;&#x1f3fb;','&#x1f1fc;&#x1f1f8;','&#x1f1fd;&#x1f1f0;','&#x1f939;&#x1f3fc;','&#x1f1fe;&#x1f1ea;','&#x1f1fe;&#x1f1f9;','&#x1f939;&#x1f3fd;','&#x1f1ff;&#x1f1e6;','&#x1f1ff;&#x1f1f2;','&#x1f939;&#x1f3fe;','&#x1f1ff;&#x1f1fc;','&#x1f385;&#x1f3fb;','&#x1f939;&#x1f3ff;','&#x1f385;&#x1f3fc;','&#x1f385;&#x1f3fd;','&#x1f385;&#x1f3fe;','&#x1f385;&#x1f3ff;','&#x1f3c2;&#x1f3fb;','&#x1f469;&#x1f3fd;','&#x1f93d;&#x1f3fb;','&#x1f3c2;&#x1f3fc;','&#x1f3c2;&#x1f3fd;','&#x1f93d;&#x1f3fc;','&#x1f3c2;&#x1f3fe;','&#x1f3c2;&#x1f3ff;','&#x1f93d;&#x1f3fd;','&#x1f1e6;&#x1f1e8;','&#x1f1e6;&#x1f1ea;','&#x1f93d;&#x1f3fe;','&#x1f3c3;&#x1f3fb;','&#x1f1e6;&#x1f1eb;','&#x1f93d;&#x1f3ff;','&#x1f1e6;&#x1f1ec;','&#x1f3c3;&#x1f3fc;','&#x1f1e6;&#x1f1ee;','&#x1f1e6;&#x1f1f1;','&#x1f93e;&#x1f3fb;','&#x1f3c3;&#x1f3fd;','&#x1f1e6;&#x1f1f2;','&#x1f93e;&#x1f3fc;','&#x1f1e6;&#x1f1f4;','&#x1f3c3;&#x1f3fe;','&#x1f93e;&#x1f3fd;','&#x1f1e6;&#x1f1f6;','&#x1f1e6;&#x1f1f7;','&#x1f93e;&#x1f3fe;','&#x1f3c3;&#x1f3ff;','&#x1f1e6;&#x1f1f8;','&#x1f93e;&#x1f3ff;','&#x1f469;&#x1f3fe;','&#x1f1e6;&#x1f1f9;','&#x1f9b5;&#x1f3fb;','&#x1f9b5;&#x1f3fc;','&#x1f9b5;&#x1f3fd;','&#x1f9b5;&#x1f3fe;','&#x1f9b5;&#x1f3ff;','&#x1f9b6;&#x1f3fb;','&#x1f9b6;&#x1f3fc;','&#x1f9b6;&#x1f3fd;','&#x1f9b6;&#x1f3fe;','&#x1f9b6;&#x1f3ff;','&#x1f1e6;&#x1f1fa;','&#x1f1e6;&#x1f1fc;','&#x1f9b8;&#x1f3fb;','&#x1f3c4;&#x1f3fb;','&#x1f1e6;&#x1f1fd;','&#x1f9b8;&#x1f3fc;','&#x1f1e6;&#x1f1ff;','&#x1f3c4;&#x1f3fc;','&#x1f9b8;&#x1f3fd;','&#x1f1e7;&#x1f1e6;','&#x1f1e7;&#x1f1e7;','&#x1f9b8;&#x1f3fe;','&#x1f3c4;&#x1f3fd;','&#x1f1e7;&#x1f1e9;','&#x1f9b8;&#x1f3ff;','&#x1f1e7;&#x1f1ea;','&#x1f3c4;&#x1f3fe;','&#x1f1e7;&#x1f1eb;','&#x1f1e7;&#x1f1ec;','&#x1f9b9;&#x1f3fb;','&#x1f3c4;&#x1f3ff;','&#x1f1e7;&#x1f1ed;','&#x1f9b9;&#x1f3fc;','&#x1f1e7;&#x1f1ee;','&#x1f3c7;&#x1f3fb;','&#x1f9b9;&#x1f3fd;','&#x1f3c7;&#x1f3fc;','&#x1f469;&#x1f3ff;','&#x1f9b9;&#x1f3fe;','&#x1f3c7;&#x1f3fd;','&#x1f3c7;&#x1f3fe;','&#x1f9b9;&#x1f3ff;','&#x1f3c7;&#x1f3ff;','&#x1f1e7;&#x1f1ef;','&#x1f9d1;&#x1f3fb;','&#x1f9d1;&#x1f3fc;','&#x1f9d1;&#x1f3fd;','&#x1f9d1;&#x1f3fe;','&#x1f9d1;&#x1f3ff;','&#x1f9d2;&#x1f3fb;','&#x1f9d2;&#x1f3fc;','&#x1f9d2;&#x1f3fd;','&#x1f9d2;&#x1f3fe;','&#x1f9d2;&#x1f3ff;','&#x1f9d3;&#x1f3fb;','&#x1f9d3;&#x1f3fc;','&#x1f9d3;&#x1f3fd;','&#x1f9d3;&#x1f3fe;','&#x1f9d3;&#x1f3ff;','&#x1f9d4;&#x1f3fb;','&#x1f9d4;&#x1f3fc;','&#x1f9d4;&#x1f3fd;','&#x1f9d4;&#x1f3fe;','&#x1f9d4;&#x1f3ff;','&#x1f9d5;&#x1f3fb;','&#x1f9d5;&#x1f3fc;','&#x1f9d5;&#x1f3fd;','&#x1f9d5;&#x1f3fe;','&#x1f9d5;&#x1f3ff;','&#x1f1e7;&#x1f1f1;','&#x1f3ca;&#x1f3fb;','&#x1f9d6;&#x1f3fb;','&#x1f1e7;&#x1f1f2;','&#x1f1e7;&#x1f1f3;','&#x1f9d6;&#x1f3fc;','&#x1f3ca;&#x1f3fc;','&#x1f1e7;&#x1f1f4;','&#x1f9d6;&#x1f3fd;','&#x1f1e7;&#x1f1f6;','&#x1f3ca;&#x1f3fd;','&#x1f9d6;&#x1f3fe;','&#x1f1e7;&#x1f1f7;','&#x1f1e7;&#x1f1f8;','&#x1f9d6;&#x1f3ff;','&#x1f3ca;&#x1f3fe;','&#x1f1e7;&#x1f1f9;','&#x1f1e7;&#x1f1fb;','&#x1f3ca;&#x1f3ff;','&#x1f9d7;&#x1f3fb;','&#x1f1e7;&#x1f1fc;','&#x1f1e7;&#x1f1fe;','&#x1f9d7;&#x1f3fc;','&#x1f1e7;&#x1f1ff;','&#x1f1e8;&#x1f1e6;','&#x1f9d7;&#x1f3fd;','&#x1f3cb;&#x1f3fb;','&#x1f1e8;&#x1f1e8;','&#x1f9d7;&#x1f3fe;','&#x1f1e8;&#x1f1e9;','&#x1f3cb;&#x1f3fc;','&#x1f9d7;&#x1f3ff;','&#x1f1e8;&#x1f1eb;','&#x1f1e8;&#x1f1ec;','&#x1f3cb;&#x1f3fd;','&#x1f1e8;&#x1f1ed;','&#x1f9d8;&#x1f3fb;','&#x1f1e8;&#x1f1ee;','&#x1f3cb;&#x1f3fe;','&#x1f9d8;&#x1f3fc;','&#x1f1e8;&#x1f1f0;','&#x1f1e8;&#x1f1f1;','&#x1f9d8;&#x1f3fd;','&#x1f3cb;&#x1f3ff;','&#x1f1e8;&#x1f1f2;','&#x1f9d8;&#x1f3fe;','&#x1f46e;&#x1f3fb;','&#x1f1e8;&#x1f1f3;','&#x1f9d8;&#x1f3ff;','&#x1f1e8;&#x1f1f4;','&#x1f46e;&#x1f3fc;','&#x1f1e8;&#x1f1f5;','&#x1f3cc;&#x1f3fb;','&#x1f9d9;&#x1f3fb;','&#x1f46e;&#x1f3fd;','&#x1f1e8;&#x1f1f7;','&#x1f9d9;&#x1f3fc;','&#x1f1e8;&#x1f1fa;','&#x1f46e;&#x1f3fe;','&#x1f9d9;&#x1f3fd;','&#x1f3cc;&#x1f3fc;','&#x1f1e8;&#x1f1fb;','&#x1f9d9;&#x1f3fe;','&#x1f46e;&#x1f3ff;','&#x1f1e8;&#x1f1fc;','&#x1f9d9;&#x1f3ff;','&#x1f3cc;&#x1f3fd;','&#x1f1e8;&#x1f1fd;','&#x1f1e8;&#x1f1fe;','&#x1f470;&#x1f3fb;','&#x1f9da;&#x1f3fb;','&#x1f470;&#x1f3fc;','&#x1f470;&#x1f3fd;','&#x1f9da;&#x1f3fc;','&#x1f470;&#x1f3fe;','&#x1f470;&#x1f3ff;','&#x1f9da;&#x1f3fd;','&#x1f3cc;&#x1f3fe;','&#x1f1e8;&#x1f1ff;','&#x1f9da;&#x1f3fe;','&#x1f471;&#x1f3fb;','&#x1f1e9;&#x1f1ea;','&#x1f9da;&#x1f3ff;','&#x1f3cc;&#x1f3ff;','&#x1f471;&#x1f3fc;','&#x1f1e9;&#x1f1ec;','&#x1f1e9;&#x1f1ef;','&#x1f9db;&#x1f3fb;','&#x1f471;&#x1f3fd;','&#x1f1e9;&#x1f1f0;','&#x1f9db;&#x1f3fc;','&#x1f1e9;&#x1f1f2;','&#x1f471;&#x1f3fe;','&#x1f9db;&#x1f3fd;','&#x1f1e9;&#x1f1f4;','&#x1f1e9;&#x1f1ff;','&#x1f9db;&#x1f3fe;','&#x1f471;&#x1f3ff;','&#x1f1ea;&#x1f1e6;','&#x1f9db;&#x1f3ff;','&#x1f1ea;&#x1f1e8;','&#x1f472;&#x1f3fb;','&#x1f472;&#x1f3fc;','&#x1f472;&#x1f3fd;','&#x1f9dc;&#x1f3fb;','&#x1f472;&#x1f3fe;','&#x1f472;&#x1f3ff;','&#x1f9dc;&#x1f3fc;','&#x1f442;&#x1f3fb;','&#x1f442;&#x1f3fc;','&#x1f9dc;&#x1f3fd;','&#x1f473;&#x1f3fb;','&#x1f442;&#x1f3fd;','&#x1f9dc;&#x1f3fe;','&#x1f442;&#x1f3fe;','&#x1f473;&#x1f3fc;','&#x1f9dc;&#x1f3ff;','&#x1f442;&#x1f3ff;','&#x1f443;&#x1f3fb;','&#x1f473;&#x1f3fd;','&#x1f443;&#x1f3fc;','&#x1f9dd;&#x1f3fb;','&#x1f443;&#x1f3fd;','&#x1f473;&#x1f3fe;','&#x1f9dd;&#x1f3fc;','&#x1f443;&#x1f3fe;','&#x1f443;&#x1f3ff;','&#x1f9dd;&#x1f3fd;','&#x1f473;&#x1f3ff;','&#x1f446;&#x1f3fb;','&#x1f9dd;&#x1f3fe;','&#x1f446;&#x1f3fc;','&#x1f474;&#x1f3fb;','&#x1f9dd;&#x1f3ff;','&#x1f474;&#x1f3fc;','&#x1f474;&#x1f3fd;','&#x1f474;&#x1f3fe;','&#x1f474;&#x1f3ff;','&#x1f475;&#x1f3fb;','&#x1f475;&#x1f3fc;','&#x1f475;&#x1f3fd;','&#x1f475;&#x1f3fe;','&#x1f475;&#x1f3ff;','&#x1f476;&#x1f3fb;','&#x1f476;&#x1f3fc;','&#x1f476;&#x1f3fd;','&#x1f476;&#x1f3fe;','&#x1f476;&#x1f3ff;','&#x1f446;&#x1f3fd;','&#x1f446;&#x1f3fe;','&#x1f477;&#x1f3fb;','&#x1f1f8;&#x1f1f1;','&#x270d;&#x1f3ff;','&#x26f9;&#x1f3fb;','&#x270d;&#x1f3fe;','&#x270d;&#x1f3fd;','&#x270d;&#x1f3fc;','&#x270d;&#x1f3fb;','&#x270c;&#x1f3ff;','&#x270c;&#x1f3fe;','&#x270c;&#x1f3fd;','&#x270c;&#x1f3fc;','&#x270c;&#x1f3fb;','&#x270b;&#x1f3ff;','&#x270b;&#x1f3fe;','&#x270b;&#x1f3fd;','&#x270b;&#x1f3fc;','&#x270b;&#x1f3fb;','&#x270a;&#x1f3ff;','&#x270a;&#x1f3fe;','&#x270a;&#x1f3fd;','&#x270a;&#x1f3fc;','&#x270a;&#x1f3fb;','&#x26f7;&#x1f3fd;','&#x26f7;&#x1f3fe;','&#x26f9;&#x1f3ff;','&#x261d;&#x1f3ff;','&#x261d;&#x1f3fe;','&#x26f9;&#x1f3fe;','&#x261d;&#x1f3fd;','&#x261d;&#x1f3fc;','&#x26f9;&#x1f3fd;','&#x261d;&#x1f3fb;','&#x26f7;&#x1f3ff;','&#x26f9;&#x1f3fc;','&#x26f7;&#x1f3fb;','&#x26f7;&#x1f3fc;','&#x34;&#x20e3;','&#x23;&#x20e3;','&#x30;&#x20e3;','&#x31;&#x20e3;','&#x32;&#x20e3;','&#x33;&#x20e3;','&#x2a;&#x20e3;','&#x35;&#x20e3;','&#x36;&#x20e3;','&#x37;&#x20e3;','&#x38;&#x20e3;','&#x39;&#x20e3;','&#x1f0cf;','&#x1f57a;','&#x1f587;','&#x1f58a;','&#x1f58b;','&#x1f58c;','&#x1f58d;','&#x1f004;','&#x1f1fe;','&#x1f1e6;','&#x1f170;','&#x1f171;','&#x1f590;','&#x1f1ff;','&#x1f201;','&#x1f202;','&#x1f3c4;','&#x1f3c5;','&#x1f595;','&#x1f3c6;','&#x1f21a;','&#x1f22f;','&#x1f232;','&#x1f233;','&#x1f596;','&#x1f5a4;','&#x1f5a5;','&#x1f5a8;','&#x1f5b1;','&#x1f5b2;','&#x1f5bc;','&#x1f5c2;','&#x1f5c3;','&#x1f5c4;','&#x1f5d1;','&#x1f5d2;','&#x1f5d3;','&#x1f5dc;','&#x1f5dd;','&#x1f5de;','&#x1f5e1;','&#x1f5e3;','&#x1f5e8;','&#x1f5ef;','&#x1f5f3;','&#x1f5fa;','&#x1f5fb;','&#x1f5fc;','&#x1f5fd;','&#x1f5fe;','&#x1f5ff;','&#x1f600;','&#x1f601;','&#x1f602;','&#x1f603;','&#x1f604;','&#x1f605;','&#x1f606;','&#x1f607;','&#x1f608;','&#x1f609;','&#x1f60a;','&#x1f60b;','&#x1f60c;','&#x1f60d;','&#x1f60e;','&#x1f60f;','&#x1f610;','&#x1f611;','&#x1f612;','&#x1f613;','&#x1f614;','&#x1f615;','&#x1f616;','&#x1f617;','&#x1f618;','&#x1f619;','&#x1f61a;','&#x1f61b;','&#x1f61c;','&#x1f61d;','&#x1f61e;','&#x1f61f;','&#x1f620;','&#x1f621;','&#x1f622;','&#x1f623;','&#x1f624;','&#x1f625;','&#x1f626;','&#x1f627;','&#x1f628;','&#x1f629;','&#x1f62a;','&#x1f62b;','&#x1f62c;','&#x1f62d;','&#x1f62e;','&#x1f62f;','&#x1f630;','&#x1f631;','&#x1f632;','&#x1f633;','&#x1f634;','&#x1f635;','&#x1f636;','&#x1f637;','&#x1f638;','&#x1f639;','&#x1f63a;','&#x1f63b;','&#x1f63c;','&#x1f63d;','&#x1f63e;','&#x1f63f;','&#x1f640;','&#x1f641;','&#x1f642;','&#x1f643;','&#x1f644;','&#x1f234;','&#x1f3c7;','&#x1f3c8;','&#x1f3c9;','&#x1f235;','&#x1f236;','&#x1f237;','&#x1f238;','&#x1f239;','&#x1f23a;','&#x1f250;','&#x1f251;','&#x1f300;','&#x1f301;','&#x1f302;','&#x1f303;','&#x1f304;','&#x1f645;','&#x1f305;','&#x1f306;','&#x1f307;','&#x1f308;','&#x1f3ca;','&#x1f309;','&#x1f30a;','&#x1f30b;','&#x1f30c;','&#x1f468;','&#x1f30d;','&#x1f30e;','&#x1f30f;','&#x1f310;','&#x1f311;','&#x1f312;','&#x1f313;','&#x1f646;','&#x1f314;','&#x1f315;','&#x1f316;','&#x1f317;','&#x1f318;','&#x1f319;','&#x1f3cb;','&#x1f31a;','&#x1f31b;','&#x1f31c;','&#x1f31d;','&#x1f31e;','&#x1f31f;','&#x1f320;','&#x1f321;','&#x1f324;','&#x1f325;','&#x1f647;','&#x1f648;','&#x1f649;','&#x1f64a;','&#x1f326;','&#x1f327;','&#x1f328;','&#x1f329;','&#x1f32a;','&#x1f32b;','&#x1f32c;','&#x1f3cc;','&#x1f3cd;','&#x1f3ce;','&#x1f3cf;','&#x1f3d0;','&#x1f3d1;','&#x1f3d2;','&#x1f3d3;','&#x1f3d4;','&#x1f3d5;','&#x1f64b;','&#x1f3d6;','&#x1f3d7;','&#x1f3d8;','&#x1f3d9;','&#x1f3da;','&#x1f64c;','&#x1f3db;','&#x1f3dc;','&#x1f3dd;','&#x1f3de;','&#x1f3df;','&#x1f3e0;','&#x1f3e1;','&#x1f3e2;','&#x1f3e3;','&#x1f3e4;','&#x1f3e5;','&#x1f3e6;','&#x1f3e7;','&#x1f3e8;','&#x1f3e9;','&#x1f3ea;','&#x1f3eb;','&#x1f64d;','&#x1f3ec;','&#x1f3ed;','&#x1f3ee;','&#x1f3ef;','&#x1f3f0;','&#x1f32d;','&#x1f3f3;','&#x1f32e;','&#x1f32f;','&#x1f330;','&#x1f331;','&#x1f3f4;','&#x1f3f5;','&#x1f3f7;','&#x1f3f8;','&#x1f3f9;','&#x1f3fa;','&#x1f64e;','&#x1f3fb;','&#x1f3fc;','&#x1f3fd;','&#x1f3fe;','&#x1f3ff;','&#x1f64f;','&#x1f680;','&#x1f681;','&#x1f682;','&#x1f683;','&#x1f684;','&#x1f685;','&#x1f686;','&#x1f687;','&#x1f688;','&#x1f689;','&#x1f68a;','&#x1f68b;','&#x1f68c;','&#x1f68d;','&#x1f68e;','&#x1f68f;','&#x1f690;','&#x1f691;','&#x1f692;','&#x1f693;','&#x1f694;','&#x1f695;','&#x1f696;','&#x1f697;','&#x1f698;','&#x1f699;','&#x1f69a;','&#x1f69b;','&#x1f69c;','&#x1f69d;','&#x1f69e;','&#x1f69f;','&#x1f6a0;','&#x1f6a1;','&#x1f6a2;','&#x1f400;','&#x1f401;','&#x1f402;','&#x1f403;','&#x1f404;','&#x1f405;','&#x1f406;','&#x1f407;','&#x1f408;','&#x1f409;','&#x1f40a;','&#x1f40b;','&#x1f40c;','&#x1f40d;','&#x1f40e;','&#x1f40f;','&#x1f410;','&#x1f6a3;','&#x1f6a4;','&#x1f6a5;','&#x1f6a6;','&#x1f6a7;','&#x1f6a8;','&#x1f6a9;','&#x1f6aa;','&#x1f6ab;','&#x1f6ac;','&#x1f6ad;','&#x1f6ae;','&#x1f6af;','&#x1f6b0;','&#x1f6b1;','&#x1f6b2;','&#x1f6b3;','&#x1f411;','&#x1f412;','&#x1f413;','&#x1f414;','&#x1f415;','&#x1f416;','&#x1f417;','&#x1f418;','&#x1f419;','&#x1f41a;','&#x1f41b;','&#x1f41c;','&#x1f41d;','&#x1f41e;','&#x1f41f;','&#x1f420;','&#x1f421;','&#x1f6b4;','&#x1f422;','&#x1f423;','&#x1f424;','&#x1f425;','&#x1f426;','&#x1f427;','&#x1f428;','&#x1f429;','&#x1f42a;','&#x1f42b;','&#x1f42c;','&#x1f42d;','&#x1f42e;','&#x1f42f;','&#x1f430;','&#x1f431;','&#x1f432;','&#x1f6b5;','&#x1f433;','&#x1f434;','&#x1f435;','&#x1f469;','&#x1f46a;','&#x1f46b;','&#x1f46c;','&#x1f46d;','&#x1f436;','&#x1f437;','&#x1f438;','&#x1f439;','&#x1f43a;','&#x1f43b;','&#x1f43c;','&#x1f43d;','&#x1f43e;','&#x1f6b6;','&#x1f6b7;','&#x1f6b8;','&#x1f6b9;','&#x1f6ba;','&#x1f6bb;','&#x1f6bc;','&#x1f6bd;','&#x1f6be;','&#x1f6bf;','&#x1f43f;','&#x1f440;','&#x1f332;','&#x1f441;','&#x1f333;','&#x1f6c0;','&#x1f6c1;','&#x1f6c2;','&#x1f6c3;','&#x1f6c4;','&#x1f6c5;','&#x1f6cb;','&#x1f334;','&#x1f335;','&#x1f336;','&#x1f46e;','&#x1f337;','&#x1f6cc;','&#x1f6cd;','&#x1f6ce;','&#x1f6cf;','&#x1f6d0;','&#x1f6d1;','&#x1f6d2;','&#x1f6e0;','&#x1f6e1;','&#x1f6e2;','&#x1f6e3;','&#x1f6e4;','&#x1f6e5;','&#x1f6e9;','&#x1f6eb;','&#x1f6ec;','&#x1f6f0;','&#x1f6f3;','&#x1f6f4;','&#x1f6f5;','&#x1f6f6;','&#x1f6f7;','&#x1f6f8;','&#x1f6f9;','&#x1f910;','&#x1f911;','&#x1f912;','&#x1f913;','&#x1f914;','&#x1f915;','&#x1f916;','&#x1f917;','&#x1f442;','&#x1f46f;','&#x1f338;','&#x1f339;','&#x1f33a;','&#x1f918;','&#x1f33b;','&#x1f33c;','&#x1f470;','&#x1f443;','&#x1f444;','&#x1f919;','&#x1f445;','&#x1f33d;','&#x1f33e;','&#x1f33f;','&#x1f340;','&#x1f91a;','&#x1f341;','&#x1f446;','&#x1f342;','&#x1f343;','&#x1f344;','&#x1f91b;','&#x1f345;','&#x1f346;','&#x1f447;','&#x1f347;','&#x1f348;','&#x1f91c;','&#x1f91d;','&#x1f471;','&#x1f349;','&#x1f34a;','&#x1f34b;','&#x1f448;','&#x1f91e;','&#x1f34c;','&#x1f472;','&#x1f34d;','&#x1f34e;','&#x1f34f;','&#x1f91f;','&#x1f920;','&#x1f921;','&#x1f922;','&#x1f923;','&#x1f924;','&#x1f925;','&#x1f350;','&#x1f449;','&#x1f351;','&#x1f352;','&#x1f353;','&#x1f354;','&#x1f355;','&#x1f44a;','&#x1f356;','&#x1f357;','&#x1f358;','&#x1f359;','&#x1f35a;','&#x1f44b;','&#x1f473;','&#x1f35b;','&#x1f35c;','&#x1f926;','&#x1f927;','&#x1f928;','&#x1f929;','&#x1f92a;','&#x1f92b;','&#x1f92c;','&#x1f92d;','&#x1f92e;','&#x1f92f;','&#x1f35d;','&#x1f35e;','&#x1f35f;','&#x1f474;','&#x1f44c;','&#x1f930;','&#x1f360;','&#x1f361;','&#x1f362;','&#x1f363;','&#x1f475;','&#x1f931;','&#x1f364;','&#x1f44d;','&#x1f365;','&#x1f366;','&#x1f367;','&#x1f932;','&#x1f476;','&#x1f368;','&#x1f369;','&#x1f44e;','&#x1f36a;','&#x1f933;','&#x1f36b;','&#x1f36c;','&#x1f36d;','&#x1f36e;','&#x1f44f;','&#x1f934;','&#x1f36f;','&#x1f370;','&#x1f371;','&#x1f372;','&#x1f373;','&#x1f450;','&#x1f451;','&#x1f452;','&#x1f477;','&#x1f453;','&#x1f454;','&#x1f455;','&#x1f456;','&#x1f457;','&#x1f478;','&#x1f479;','&#x1f47a;','&#x1f935;','&#x1f47b;','&#x1f458;','&#x1f459;','&#x1f45a;','&#x1f45b;','&#x1f936;','&#x1f45c;','&#x1f47c;','&#x1f47d;','&#x1f47e;','&#x1f47f;','&#x1f480;','&#x1f45d;','&#x1f45e;','&#x1f45f;','&#x1f460;','&#x1f461;','&#x1f462;','&#x1f463;','&#x1f464;','&#x1f465;','&#x1f374;','&#x1f375;','&#x1f937;','&#x1f376;','&#x1f377;','&#x1f378;','&#x1f466;','&#x1f379;','&#x1f37a;','&#x1f481;','&#x1f37b;','&#x1f37c;','&#x1f37d;','&#x1f467;','&#x1f37e;','&#x1f37f;','&#x1f380;','&#x1f381;','&#x1f382;','&#x1f383;','&#x1f938;','&#x1f384;','&#x1f1f5;','&#x1f17e;','&#x1f1f6;','&#x1f1f2;','&#x1f17f;','&#x1f385;','&#x1f482;','&#x1f386;','&#x1f387;','&#x1f388;','&#x1f389;','&#x1f38a;','&#x1f483;','&#x1f484;','&#x1f38b;','&#x1f38c;','&#x1f939;','&#x1f93a;','&#x1f38d;','&#x1f38e;','&#x1f93c;','&#x1f38f;','&#x1f485;','&#x1f390;','&#x1f391;','&#x1f392;','&#x1f393;','&#x1f396;','&#x1f397;','&#x1f399;','&#x1f39a;','&#x1f39b;','&#x1f39e;','&#x1f39f;','&#x1f3a0;','&#x1f3a1;','&#x1f3a2;','&#x1f3a3;','&#x1f93d;','&#x1f3a4;','&#x1f3a5;','&#x1f486;','&#x1f3a6;','&#x1f3a7;','&#x1f3a8;','&#x1f3a9;','&#x1f3aa;','&#x1f3ab;','&#x1f3ac;','&#x1f3ad;','&#x1f3ae;','&#x1f3af;','&#x1f3b0;','&#x1f3b1;','&#x1f3b2;','&#x1f3b3;','&#x1f93e;','&#x1f940;','&#x1f941;','&#x1f942;','&#x1f943;','&#x1f944;','&#x1f945;','&#x1f947;','&#x1f948;','&#x1f949;','&#x1f94a;','&#x1f94b;','&#x1f94c;','&#x1f94d;','&#x1f94e;','&#x1f94f;','&#x1f950;','&#x1f951;','&#x1f952;','&#x1f953;','&#x1f954;','&#x1f955;','&#x1f956;','&#x1f957;','&#x1f958;','&#x1f959;','&#x1f95a;','&#x1f95b;','&#x1f95c;','&#x1f95d;','&#x1f95e;','&#x1f95f;','&#x1f960;','&#x1f961;','&#x1f962;','&#x1f963;','&#x1f964;','&#x1f965;','&#x1f966;','&#x1f967;','&#x1f968;','&#x1f969;','&#x1f96a;','&#x1f96b;','&#x1f96c;','&#x1f96d;','&#x1f96e;','&#x1f96f;','&#x1f970;','&#x1f973;','&#x1f974;','&#x1f975;','&#x1f976;','&#x1f97a;','&#x1f97c;','&#x1f97d;','&#x1f97e;','&#x1f97f;','&#x1f980;','&#x1f981;','&#x1f982;','&#x1f983;','&#x1f984;','&#x1f985;','&#x1f986;','&#x1f987;','&#x1f988;','&#x1f989;','&#x1f98a;','&#x1f98b;','&#x1f98c;','&#x1f98d;','&#x1f98e;','&#x1f98f;','&#x1f990;','&#x1f991;','&#x1f992;','&#x1f993;','&#x1f994;','&#x1f995;','&#x1f996;','&#x1f997;','&#x1f998;','&#x1f999;','&#x1f99a;','&#x1f99b;','&#x1f99c;','&#x1f99d;','&#x1f99e;','&#x1f99f;','&#x1f9a0;','&#x1f9a1;','&#x1f9a2;','&#x1f9b4;','&#x1f3b4;','&#x1f3b5;','&#x1f3b6;','&#x1f487;','&#x1f488;','&#x1f9b5;','&#x1f489;','&#x1f48a;','&#x1f48b;','&#x1f48c;','&#x1f48d;','&#x1f9b6;','&#x1f9b7;','&#x1f48e;','&#x1f48f;','&#x1f490;','&#x1f491;','&#x1f492;','&#x1f493;','&#x1f494;','&#x1f495;','&#x1f496;','&#x1f497;','&#x1f498;','&#x1f499;','&#x1f49a;','&#x1f49b;','&#x1f49c;','&#x1f49d;','&#x1f49e;','&#x1f9b8;','&#x1f49f;','&#x1f4a0;','&#x1f4a1;','&#x1f4a2;','&#x1f4a3;','&#x1f4a4;','&#x1f4a5;','&#x1f4a6;','&#x1f4a7;','&#x1f4a8;','&#x1f4a9;','&#x1f3b7;','&#x1f3b8;','&#x1f3b9;','&#x1f3ba;','&#x1f3bb;','&#x1f4aa;','&#x1f9b9;','&#x1f9c0;','&#x1f9c1;','&#x1f9c2;','&#x1f9d0;','&#x1f4ab;','&#x1f4ac;','&#x1f4ad;','&#x1f4ae;','&#x1f4af;','&#x1f9d1;','&#x1f4b0;','&#x1f4b1;','&#x1f4b2;','&#x1f4b3;','&#x1f4b4;','&#x1f9d2;','&#x1f4b5;','&#x1f4b6;','&#x1f4b7;','&#x1f4b8;','&#x1f4b9;','&#x1f9d3;','&#x1f4ba;','&#x1f4bb;','&#x1f4bc;','&#x1f4bd;','&#x1f4be;','&#x1f9d4;','&#x1f4bf;','&#x1f4c0;','&#x1f4c1;','&#x1f4c2;','&#x1f4c3;','&#x1f9d5;','&#x1f4c4;','&#x1f4c5;','&#x1f4c6;','&#x1f4c7;','&#x1f4c8;','&#x1f4c9;','&#x1f4ca;','&#x1f4cb;','&#x1f4cc;','&#x1f4cd;','&#x1f4ce;','&#x1f4cf;','&#x1f4d0;','&#x1f4d1;','&#x1f4d2;','&#x1f4d3;','&#x1f4d4;','&#x1f9d6;','&#x1f4d5;','&#x1f4d6;','&#x1f4d7;','&#x1f4d8;','&#x1f4d9;','&#x1f4da;','&#x1f4db;','&#x1f4dc;','&#x1f4dd;','&#x1f4de;','&#x1f4df;','&#x1f4e0;','&#x1f4e1;','&#x1f4e2;','&#x1f4e3;','&#x1f4e4;','&#x1f4e5;','&#x1f9d7;','&#x1f4e6;','&#x1f4e7;','&#x1f4e8;','&#x1f4e9;','&#x1f4ea;','&#x1f4eb;','&#x1f4ec;','&#x1f4ed;','&#x1f4ee;','&#x1f4ef;','&#x1f4f0;','&#x1f4f1;','&#x1f4f2;','&#x1f4f3;','&#x1f4f4;','&#x1f4f5;','&#x1f4f6;','&#x1f9d8;','&#x1f4f7;','&#x1f4f8;','&#x1f4f9;','&#x1f4fa;','&#x1f4fb;','&#x1f4fc;','&#x1f4fd;','&#x1f4ff;','&#x1f500;','&#x1f501;','&#x1f502;','&#x1f503;','&#x1f504;','&#x1f505;','&#x1f506;','&#x1f507;','&#x1f508;','&#x1f9d9;','&#x1f509;','&#x1f50a;','&#x1f50b;','&#x1f50c;','&#x1f50d;','&#x1f50e;','&#x1f50f;','&#x1f510;','&#x1f511;','&#x1f512;','&#x1f513;','&#x1f514;','&#x1f515;','&#x1f516;','&#x1f517;','&#x1f518;','&#x1f519;','&#x1f9da;','&#x1f51a;','&#x1f51b;','&#x1f51c;','&#x1f51d;','&#x1f51e;','&#x1f51f;','&#x1f520;','&#x1f521;','&#x1f522;','&#x1f523;','&#x1f524;','&#x1f525;','&#x1f526;','&#x1f527;','&#x1f528;','&#x1f529;','&#x1f52a;','&#x1f9db;','&#x1f52b;','&#x1f52c;','&#x1f52d;','&#x1f52e;','&#x1f52f;','&#x1f530;','&#x1f531;','&#x1f532;','&#x1f533;','&#x1f534;','&#x1f535;','&#x1f536;','&#x1f537;','&#x1f538;','&#x1f539;','&#x1f53a;','&#x1f53b;','&#x1f9dc;','&#x1f53c;','&#x1f53d;','&#x1f549;','&#x1f54a;','&#x1f54b;','&#x1f54c;','&#x1f54d;','&#x1f54e;','&#x1f550;','&#x1f551;','&#x1f552;','&#x1f553;','&#x1f554;','&#x1f555;','&#x1f556;','&#x1f557;','&#x1f558;','&#x1f9dd;','&#x1f559;','&#x1f55a;','&#x1f9de;','&#x1f55b;','&#x1f55c;','&#x1f9df;','&#x1f9e0;','&#x1f9e1;','&#x1f9e2;','&#x1f9e3;','&#x1f9e4;','&#x1f9e5;','&#x1f9e6;','&#x1f9e7;','&#x1f9e8;','&#x1f9e9;','&#x1f9ea;','&#x1f9eb;','&#x1f9ec;','&#x1f9ed;','&#x1f9ee;','&#x1f9ef;','&#x1f9f0;','&#x1f9f1;','&#x1f9f2;','&#x1f9f3;','&#x1f9f4;','&#x1f9f5;','&#x1f9f6;','&#x1f9f7;','&#x1f9f8;','&#x1f9f9;','&#x1f9fa;','&#x1f9fb;','&#x1f9fc;','&#x1f9fd;','&#x1f9fe;','&#x1f9ff;','&#x1f55d;','&#x1f55e;','&#x1f55f;','&#x1f560;','&#x1f561;','&#x1f562;','&#x1f563;','&#x1f564;','&#x1f565;','&#x1f566;','&#x1f567;','&#x1f56f;','&#x1f570;','&#x1f573;','&#x1f3bc;','&#x1f3bd;','&#x1f3be;','&#x1f3bf;','&#x1f3c0;','&#x1f3c1;','&#x1f1e7;','&#x1f1ee;','&#x1f1ea;','&#x1f1f7;','&#x1f1f1;','&#x1f3c2;','&#x1f18e;','&#x1f191;','&#x1f1e8;','&#x1f1f9;','&#x1f1ef;','&#x1f574;','&#x1f192;','&#x1f1ec;','&#x1f193;','&#x1f1f3;','&#x1f194;','&#x1f1f4;','&#x1f1fa;','&#x1f1eb;','&#x1f195;','&#x1f196;','&#x1f197;','&#x1f1ed;','&#x1f3c3;','&#x1f198;','&#x1f1e9;','&#x1f1fb;','&#x1f1f0;','&#x1f575;','&#x1f576;','&#x1f577;','&#x1f578;','&#x1f579;','&#x1f199;','&#x1f1fc;','&#x1f19a;','&#x1f1fd;','&#x1f1f8;','&#x25ab;','&#x2626;','&#x262e;','&#x262f;','&#x2638;','&#x2639;','&#x263a;','&#x2640;','&#x2642;','&#x2648;','&#x2649;','&#x264a;','&#x264b;','&#x264c;','&#x264d;','&#x264e;','&#x264f;','&#x2650;','&#x2651;','&#x2652;','&#x2653;','&#x265f;','&#x2660;','&#x2663;','&#x2665;','&#x2666;','&#x2668;','&#x267b;','&#x267e;','&#x267f;','&#x2692;','&#x2693;','&#x2694;','&#x2695;','&#x2696;','&#x2697;','&#x2699;','&#x269b;','&#x269c;','&#x26a0;','&#x26a1;','&#x26aa;','&#x26ab;','&#x26b0;','&#x26b1;','&#x26bd;','&#x26be;','&#x26c4;','&#x26c5;','&#x26c8;','&#x26ce;','&#x26cf;','&#x26d1;','&#x26d3;','&#x26d4;','&#x26e9;','&#x26ea;','&#x26f0;','&#x26f1;','&#x26f2;','&#x26f3;','&#x26f4;','&#x26f5;','&#x2623;','&#x2622;','&#x2620;','&#x261d;','&#x2618;','&#x26f7;','&#x26f8;','&#x2615;','&#x2614;','&#x2611;','&#x260e;','&#x2604;','&#x2603;','&#x2602;','&#x2601;','&#x2600;','&#x25fe;','&#x25fd;','&#x25fc;','&#x25fb;','&#x25c0;','&#x25b6;','&#x262a;','&#x25aa;','&#x26f9;','&#x26fa;','&#x26fd;','&#x2702;','&#x2705;','&#x2708;','&#x2709;','&#x24c2;','&#x23fa;','&#x23f9;','&#x23f8;','&#x23f3;','&#x270a;','&#x23f2;','&#x23f1;','&#x23f0;','&#x23ef;','&#x23ee;','&#x270b;','&#x23ed;','&#x23ec;','&#x23eb;','&#x23ea;','&#x23e9;','&#x270c;','&#x23cf;','&#x2328;','&#x231b;','&#x231a;','&#x21aa;','&#x270d;','&#x270f;','&#x2712;','&#x2714;','&#x2716;','&#x271d;','&#x2721;','&#x2728;','&#x2733;','&#x2734;','&#x2744;','&#x2747;','&#x274c;','&#x274e;','&#x2753;','&#x2754;','&#x2755;','&#x2757;','&#x2763;','&#x2764;','&#x2795;','&#x2796;','&#x2797;','&#x27a1;','&#x27b0;','&#x27bf;','&#x2934;','&#x2935;','&#x21a9;','&#x2b05;','&#x2b06;','&#x2b07;','&#x2b1b;','&#x2b1c;','&#x2b50;','&#x2b55;','&#x2199;','&#x3030;','&#x303d;','&#x2198;','&#x2197;','&#x3297;','&#x3299;','&#x2196;','&#x2195;','&#x2194;','&#x2139;','&#x2122;','&#x2049;','&#x203c;','&#xe50a;');
  4835. $partials = array('&#x1f004;','&#x1f0cf;','&#x1f170;','&#x1f171;','&#x1f17e;','&#x1f17f;','&#x1f18e;','&#x1f191;','&#x1f192;','&#x1f193;','&#x1f194;','&#x1f195;','&#x1f196;','&#x1f197;','&#x1f198;','&#x1f199;','&#x1f19a;','&#x1f1e6;','&#x1f1e8;','&#x1f1e9;','&#x1f1ea;','&#x1f1eb;','&#x1f1ec;','&#x1f1ee;','&#x1f1f1;','&#x1f1f2;','&#x1f1f4;','&#x1f1f6;','&#x1f1f7;','&#x1f1f8;','&#x1f1f9;','&#x1f1fa;','&#x1f1fc;','&#x1f1fd;','&#x1f1ff;','&#x1f1e7;','&#x1f1ed;','&#x1f1ef;','&#x1f1f3;','&#x1f1fb;','&#x1f1fe;','&#x1f1f0;','&#x1f1f5;','&#x1f201;','&#x1f202;','&#x1f21a;','&#x1f22f;','&#x1f232;','&#x1f233;','&#x1f234;','&#x1f235;','&#x1f236;','&#x1f237;','&#x1f238;','&#x1f239;','&#x1f23a;','&#x1f250;','&#x1f251;','&#x1f300;','&#x1f301;','&#x1f302;','&#x1f303;','&#x1f304;','&#x1f305;','&#x1f306;','&#x1f307;','&#x1f308;','&#x1f309;','&#x1f30a;','&#x1f30b;','&#x1f30c;','&#x1f30d;','&#x1f30e;','&#x1f30f;','&#x1f310;','&#x1f311;','&#x1f312;','&#x1f313;','&#x1f314;','&#x1f315;','&#x1f316;','&#x1f317;','&#x1f318;','&#x1f319;','&#x1f31a;','&#x1f31b;','&#x1f31c;','&#x1f31d;','&#x1f31e;','&#x1f31f;','&#x1f320;','&#x1f321;','&#x1f324;','&#x1f325;','&#x1f326;','&#x1f327;','&#x1f328;','&#x1f329;','&#x1f32a;','&#x1f32b;','&#x1f32c;','&#x1f32d;','&#x1f32e;','&#x1f32f;','&#x1f330;','&#x1f331;','&#x1f332;','&#x1f333;','&#x1f334;','&#x1f335;','&#x1f336;','&#x1f337;','&#x1f338;','&#x1f339;','&#x1f33a;','&#x1f33b;','&#x1f33c;','&#x1f33d;','&#x1f33e;','&#x1f33f;','&#x1f340;','&#x1f341;','&#x1f342;','&#x1f343;','&#x1f344;','&#x1f345;','&#x1f346;','&#x1f347;','&#x1f348;','&#x1f349;','&#x1f34a;','&#x1f34b;','&#x1f34c;','&#x1f34d;','&#x1f34e;','&#x1f34f;','&#x1f350;','&#x1f351;','&#x1f352;','&#x1f353;','&#x1f354;','&#x1f355;','&#x1f356;','&#x1f357;','&#x1f358;','&#x1f359;','&#x1f35a;','&#x1f35b;','&#x1f35c;','&#x1f35d;','&#x1f35e;','&#x1f35f;','&#x1f360;','&#x1f361;','&#x1f362;','&#x1f363;','&#x1f364;','&#x1f365;','&#x1f366;','&#x1f367;','&#x1f368;','&#x1f369;','&#x1f36a;','&#x1f36b;','&#x1f36c;','&#x1f36d;','&#x1f36e;','&#x1f36f;','&#x1f370;','&#x1f371;','&#x1f372;','&#x1f373;','&#x1f374;','&#x1f375;','&#x1f376;','&#x1f377;','&#x1f378;','&#x1f379;','&#x1f37a;','&#x1f37b;','&#x1f37c;','&#x1f37d;','&#x1f37e;','&#x1f37f;','&#x1f380;','&#x1f381;','&#x1f382;','&#x1f383;','&#x1f384;','&#x1f385;','&#x1f3fb;','&#x1f3fc;','&#x1f3fd;','&#x1f3fe;','&#x1f3ff;','&#x1f386;','&#x1f387;','&#x1f388;','&#x1f389;','&#x1f38a;','&#x1f38b;','&#x1f38c;','&#x1f38d;','&#x1f38e;','&#x1f38f;','&#x1f390;','&#x1f391;','&#x1f392;','&#x1f393;','&#x1f396;','&#x1f397;','&#x1f399;','&#x1f39a;','&#x1f39b;','&#x1f39e;','&#x1f39f;','&#x1f3a0;','&#x1f3a1;','&#x1f3a2;','&#x1f3a3;','&#x1f3a4;','&#x1f3a5;','&#x1f3a6;','&#x1f3a7;','&#x1f3a8;','&#x1f3a9;','&#x1f3aa;','&#x1f3ab;','&#x1f3ac;','&#x1f3ad;','&#x1f3ae;','&#x1f3af;','&#x1f3b0;','&#x1f3b1;','&#x1f3b2;','&#x1f3b3;','&#x1f3b4;','&#x1f3b5;','&#x1f3b6;','&#x1f3b7;','&#x1f3b8;','&#x1f3b9;','&#x1f3ba;','&#x1f3bb;','&#x1f3bc;','&#x1f3bd;','&#x1f3be;','&#x1f3bf;','&#x1f3c0;','&#x1f3c1;','&#x1f3c2;','&#x1f3c3;','&#x200d;','&#x2640;','&#xfe0f;','&#x2642;','&#x1f3c4;','&#x1f3c5;','&#x1f3c6;','&#x1f3c7;','&#x1f3c8;','&#x1f3c9;','&#x1f3ca;','&#x1f3cb;','&#x1f3cc;','&#x1f3cd;','&#x1f3ce;','&#x1f3cf;','&#x1f3d0;','&#x1f3d1;','&#x1f3d2;','&#x1f3d3;','&#x1f3d4;','&#x1f3d5;','&#x1f3d6;','&#x1f3d7;','&#x1f3d8;','&#x1f3d9;','&#x1f3da;','&#x1f3db;','&#x1f3dc;','&#x1f3dd;','&#x1f3de;','&#x1f3df;','&#x1f3e0;','&#x1f3e1;','&#x1f3e2;','&#x1f3e3;','&#x1f3e4;','&#x1f3e5;','&#x1f3e6;','&#x1f3e7;','&#x1f3e8;','&#x1f3e9;','&#x1f3ea;','&#x1f3eb;','&#x1f3ec;','&#x1f3ed;','&#x1f3ee;','&#x1f3ef;','&#x1f3f0;','&#x1f3f3;','&#x1f3f4;','&#x2620;','&#xe0067;','&#xe0062;','&#xe0065;','&#xe006e;','&#xe007f;','&#xe0073;','&#xe0063;','&#xe0074;','&#xe0077;','&#xe006c;','&#x1f3f5;','&#x1f3f7;','&#x1f3f8;','&#x1f3f9;','&#x1f3fa;','&#x1f400;','&#x1f401;','&#x1f402;','&#x1f403;','&#x1f404;','&#x1f405;','&#x1f406;','&#x1f407;','&#x1f408;','&#x1f409;','&#x1f40a;','&#x1f40b;','&#x1f40c;','&#x1f40d;','&#x1f40e;','&#x1f40f;','&#x1f410;','&#x1f411;','&#x1f412;','&#x1f413;','&#x1f414;','&#x1f415;','&#x1f416;','&#x1f417;','&#x1f418;','&#x1f419;','&#x1f41a;','&#x1f41b;','&#x1f41c;','&#x1f41d;','&#x1f41e;','&#x1f41f;','&#x1f420;','&#x1f421;','&#x1f422;','&#x1f423;','&#x1f424;','&#x1f425;','&#x1f426;','&#x1f427;','&#x1f428;','&#x1f429;','&#x1f42a;','&#x1f42b;','&#x1f42c;','&#x1f42d;','&#x1f42e;','&#x1f42f;','&#x1f430;','&#x1f431;','&#x1f432;','&#x1f433;','&#x1f434;','&#x1f435;','&#x1f436;','&#x1f437;','&#x1f438;','&#x1f439;','&#x1f43a;','&#x1f43b;','&#x1f43c;','&#x1f43d;','&#x1f43e;','&#x1f43f;','&#x1f440;','&#x1f441;','&#x1f5e8;','&#x1f442;','&#x1f443;','&#x1f444;','&#x1f445;','&#x1f446;','&#x1f447;','&#x1f448;','&#x1f449;','&#x1f44a;','&#x1f44b;','&#x1f44c;','&#x1f44d;','&#x1f44e;','&#x1f44f;','&#x1f450;','&#x1f451;','&#x1f452;','&#x1f453;','&#x1f454;','&#x1f455;','&#x1f456;','&#x1f457;','&#x1f458;','&#x1f459;','&#x1f45a;','&#x1f45b;','&#x1f45c;','&#x1f45d;','&#x1f45e;','&#x1f45f;','&#x1f460;','&#x1f461;','&#x1f462;','&#x1f463;','&#x1f464;','&#x1f465;','&#x1f466;','&#x1f467;','&#x1f468;','&#x1f4bb;','&#x1f4bc;','&#x1f527;','&#x1f52c;','&#x1f680;','&#x1f692;','&#x1f9b0;','&#x1f9b1;','&#x1f9b2;','&#x1f9b3;','&#x2695;','&#x2696;','&#x2708;','&#x1f469;','&#x2764;','&#x1f48b;','&#x1f46a;','&#x1f46b;','&#x1f46c;','&#x1f46d;','&#x1f46e;','&#x1f46f;','&#x1f470;','&#x1f471;','&#x1f472;','&#x1f473;','&#x1f474;','&#x1f475;','&#x1f476;','&#x1f477;','&#x1f478;','&#x1f479;','&#x1f47a;','&#x1f47b;','&#x1f47c;','&#x1f47d;','&#x1f47e;','&#x1f47f;','&#x1f480;','&#x1f481;','&#x1f482;','&#x1f483;','&#x1f484;','&#x1f485;','&#x1f486;','&#x1f487;','&#x1f488;','&#x1f489;','&#x1f48a;','&#x1f48c;','&#x1f48d;','&#x1f48e;','&#x1f48f;','&#x1f490;','&#x1f491;','&#x1f492;','&#x1f493;','&#x1f494;','&#x1f495;','&#x1f496;','&#x1f497;','&#x1f498;','&#x1f499;','&#x1f49a;','&#x1f49b;','&#x1f49c;','&#x1f49d;','&#x1f49e;','&#x1f49f;','&#x1f4a0;','&#x1f4a1;','&#x1f4a2;','&#x1f4a3;','&#x1f4a4;','&#x1f4a5;','&#x1f4a6;','&#x1f4a7;','&#x1f4a8;','&#x1f4a9;','&#x1f4aa;','&#x1f4ab;','&#x1f4ac;','&#x1f4ad;','&#x1f4ae;','&#x1f4af;','&#x1f4b0;','&#x1f4b1;','&#x1f4b2;','&#x1f4b3;','&#x1f4b4;','&#x1f4b5;','&#x1f4b6;','&#x1f4b7;','&#x1f4b8;','&#x1f4b9;','&#x1f4ba;','&#x1f4bd;','&#x1f4be;','&#x1f4bf;','&#x1f4c0;','&#x1f4c1;','&#x1f4c2;','&#x1f4c3;','&#x1f4c4;','&#x1f4c5;','&#x1f4c6;','&#x1f4c7;','&#x1f4c8;','&#x1f4c9;','&#x1f4ca;','&#x1f4cb;','&#x1f4cc;','&#x1f4cd;','&#x1f4ce;','&#x1f4cf;','&#x1f4d0;','&#x1f4d1;','&#x1f4d2;','&#x1f4d3;','&#x1f4d4;','&#x1f4d5;','&#x1f4d6;','&#x1f4d7;','&#x1f4d8;','&#x1f4d9;','&#x1f4da;','&#x1f4db;','&#x1f4dc;','&#x1f4dd;','&#x1f4de;','&#x1f4df;','&#x1f4e0;','&#x1f4e1;','&#x1f4e2;','&#x1f4e3;','&#x1f4e4;','&#x1f4e5;','&#x1f4e6;','&#x1f4e7;','&#x1f4e8;','&#x1f4e9;','&#x1f4ea;','&#x1f4eb;','&#x1f4ec;','&#x1f4ed;','&#x1f4ee;','&#x1f4ef;','&#x1f4f0;','&#x1f4f1;','&#x1f4f2;','&#x1f4f3;','&#x1f4f4;','&#x1f4f5;','&#x1f4f6;','&#x1f4f7;','&#x1f4f8;','&#x1f4f9;','&#x1f4fa;','&#x1f4fb;','&#x1f4fc;','&#x1f4fd;','&#x1f4ff;','&#x1f500;','&#x1f501;','&#x1f502;','&#x1f503;','&#x1f504;','&#x1f505;','&#x1f506;','&#x1f507;','&#x1f508;','&#x1f509;','&#x1f50a;','&#x1f50b;','&#x1f50c;','&#x1f50d;','&#x1f50e;','&#x1f50f;','&#x1f510;','&#x1f511;','&#x1f512;','&#x1f513;','&#x1f514;','&#x1f515;','&#x1f516;','&#x1f517;','&#x1f518;','&#x1f519;','&#x1f51a;','&#x1f51b;','&#x1f51c;','&#x1f51d;','&#x1f51e;','&#x1f51f;','&#x1f520;','&#x1f521;','&#x1f522;','&#x1f523;','&#x1f524;','&#x1f525;','&#x1f526;','&#x1f528;','&#x1f529;','&#x1f52a;','&#x1f52b;','&#x1f52d;','&#x1f52e;','&#x1f52f;','&#x1f530;','&#x1f531;','&#x1f532;','&#x1f533;','&#x1f534;','&#x1f535;','&#x1f536;','&#x1f537;','&#x1f538;','&#x1f539;','&#x1f53a;','&#x1f53b;','&#x1f53c;','&#x1f53d;','&#x1f549;','&#x1f54a;','&#x1f54b;','&#x1f54c;','&#x1f54d;','&#x1f54e;','&#x1f550;','&#x1f551;','&#x1f552;','&#x1f553;','&#x1f554;','&#x1f555;','&#x1f556;','&#x1f557;','&#x1f558;','&#x1f559;','&#x1f55a;','&#x1f55b;','&#x1f55c;','&#x1f55d;','&#x1f55e;','&#x1f55f;','&#x1f560;','&#x1f561;','&#x1f562;','&#x1f563;','&#x1f564;','&#x1f565;','&#x1f566;','&#x1f567;','&#x1f56f;','&#x1f570;','&#x1f573;','&#x1f574;','&#x1f575;','&#x1f576;','&#x1f577;','&#x1f578;','&#x1f579;','&#x1f57a;','&#x1f587;','&#x1f58a;','&#x1f58b;','&#x1f58c;','&#x1f58d;','&#x1f590;','&#x1f595;','&#x1f596;','&#x1f5a4;','&#x1f5a5;','&#x1f5a8;','&#x1f5b1;','&#x1f5b2;','&#x1f5bc;','&#x1f5c2;','&#x1f5c3;','&#x1f5c4;','&#x1f5d1;','&#x1f5d2;','&#x1f5d3;','&#x1f5dc;','&#x1f5dd;','&#x1f5de;','&#x1f5e1;','&#x1f5e3;','&#x1f5ef;','&#x1f5f3;','&#x1f5fa;','&#x1f5fb;','&#x1f5fc;','&#x1f5fd;','&#x1f5fe;','&#x1f5ff;','&#x1f600;','&#x1f601;','&#x1f602;','&#x1f603;','&#x1f604;','&#x1f605;','&#x1f606;','&#x1f607;','&#x1f608;','&#x1f609;','&#x1f60a;','&#x1f60b;','&#x1f60c;','&#x1f60d;','&#x1f60e;','&#x1f60f;','&#x1f610;','&#x1f611;','&#x1f612;','&#x1f613;','&#x1f614;','&#x1f615;','&#x1f616;','&#x1f617;','&#x1f618;','&#x1f619;','&#x1f61a;','&#x1f61b;','&#x1f61c;','&#x1f61d;','&#x1f61e;','&#x1f61f;','&#x1f620;','&#x1f621;','&#x1f622;','&#x1f623;','&#x1f624;','&#x1f625;','&#x1f626;','&#x1f627;','&#x1f628;','&#x1f629;','&#x1f62a;','&#x1f62b;','&#x1f62c;','&#x1f62d;','&#x1f62e;','&#x1f62f;','&#x1f630;','&#x1f631;','&#x1f632;','&#x1f633;','&#x1f634;','&#x1f635;','&#x1f636;','&#x1f637;','&#x1f638;','&#x1f639;','&#x1f63a;','&#x1f63b;','&#x1f63c;','&#x1f63d;','&#x1f63e;','&#x1f63f;','&#x1f640;','&#x1f641;','&#x1f642;','&#x1f643;','&#x1f644;','&#x1f645;','&#x1f646;','&#x1f647;','&#x1f648;','&#x1f649;','&#x1f64a;','&#x1f64b;','&#x1f64c;','&#x1f64d;','&#x1f64e;','&#x1f64f;','&#x1f681;','&#x1f682;','&#x1f683;','&#x1f684;','&#x1f685;','&#x1f686;','&#x1f687;','&#x1f688;','&#x1f689;','&#x1f68a;','&#x1f68b;','&#x1f68c;','&#x1f68d;','&#x1f68e;','&#x1f68f;','&#x1f690;','&#x1f691;','&#x1f693;','&#x1f694;','&#x1f695;','&#x1f696;','&#x1f697;','&#x1f698;','&#x1f699;','&#x1f69a;','&#x1f69b;','&#x1f69c;','&#x1f69d;','&#x1f69e;','&#x1f69f;','&#x1f6a0;','&#x1f6a1;','&#x1f6a2;','&#x1f6a3;','&#x1f6a4;','&#x1f6a5;','&#x1f6a6;','&#x1f6a7;','&#x1f6a8;','&#x1f6a9;','&#x1f6aa;','&#x1f6ab;','&#x1f6ac;','&#x1f6ad;','&#x1f6ae;','&#x1f6af;','&#x1f6b0;','&#x1f6b1;','&#x1f6b2;','&#x1f6b3;','&#x1f6b4;','&#x1f6b5;','&#x1f6b6;','&#x1f6b7;','&#x1f6b8;','&#x1f6b9;','&#x1f6ba;','&#x1f6bb;','&#x1f6bc;','&#x1f6bd;','&#x1f6be;','&#x1f6bf;','&#x1f6c0;','&#x1f6c1;','&#x1f6c2;','&#x1f6c3;','&#x1f6c4;','&#x1f6c5;','&#x1f6cb;','&#x1f6cc;','&#x1f6cd;','&#x1f6ce;','&#x1f6cf;','&#x1f6d0;','&#x1f6d1;','&#x1f6d2;','&#x1f6e0;','&#x1f6e1;','&#x1f6e2;','&#x1f6e3;','&#x1f6e4;','&#x1f6e5;','&#x1f6e9;','&#x1f6eb;','&#x1f6ec;','&#x1f6f0;','&#x1f6f3;','&#x1f6f4;','&#x1f6f5;','&#x1f6f6;','&#x1f6f7;','&#x1f6f8;','&#x1f6f9;','&#x1f910;','&#x1f911;','&#x1f912;','&#x1f913;','&#x1f914;','&#x1f915;','&#x1f916;','&#x1f917;','&#x1f918;','&#x1f919;','&#x1f91a;','&#x1f91b;','&#x1f91c;','&#x1f91d;','&#x1f91e;','&#x1f91f;','&#x1f920;','&#x1f921;','&#x1f922;','&#x1f923;','&#x1f924;','&#x1f925;','&#x1f926;','&#x1f927;','&#x1f928;','&#x1f929;','&#x1f92a;','&#x1f92b;','&#x1f92c;','&#x1f92d;','&#x1f92e;','&#x1f92f;','&#x1f930;','&#x1f931;','&#x1f932;','&#x1f933;','&#x1f934;','&#x1f935;','&#x1f936;','&#x1f937;','&#x1f938;','&#x1f939;','&#x1f93a;','&#x1f93c;','&#x1f93d;','&#x1f93e;','&#x1f940;','&#x1f941;','&#x1f942;','&#x1f943;','&#x1f944;','&#x1f945;','&#x1f947;','&#x1f948;','&#x1f949;','&#x1f94a;','&#x1f94b;','&#x1f94c;','&#x1f94d;','&#x1f94e;','&#x1f94f;','&#x1f950;','&#x1f951;','&#x1f952;','&#x1f953;','&#x1f954;','&#x1f955;','&#x1f956;','&#x1f957;','&#x1f958;','&#x1f959;','&#x1f95a;','&#x1f95b;','&#x1f95c;','&#x1f95d;','&#x1f95e;','&#x1f95f;','&#x1f960;','&#x1f961;','&#x1f962;','&#x1f963;','&#x1f964;','&#x1f965;','&#x1f966;','&#x1f967;','&#x1f968;','&#x1f969;','&#x1f96a;','&#x1f96b;','&#x1f96c;','&#x1f96d;','&#x1f96e;','&#x1f96f;','&#x1f970;','&#x1f973;','&#x1f974;','&#x1f975;','&#x1f976;','&#x1f97a;','&#x1f97c;','&#x1f97d;','&#x1f97e;','&#x1f97f;','&#x1f980;','&#x1f981;','&#x1f982;','&#x1f983;','&#x1f984;','&#x1f985;','&#x1f986;','&#x1f987;','&#x1f988;','&#x1f989;','&#x1f98a;','&#x1f98b;','&#x1f98c;','&#x1f98d;','&#x1f98e;','&#x1f98f;','&#x1f990;','&#x1f991;','&#x1f992;','&#x1f993;','&#x1f994;','&#x1f995;','&#x1f996;','&#x1f997;','&#x1f998;','&#x1f999;','&#x1f99a;','&#x1f99b;','&#x1f99c;','&#x1f99d;','&#x1f99e;','&#x1f99f;','&#x1f9a0;','&#x1f9a1;','&#x1f9a2;','&#x1f9b4;','&#x1f9b5;','&#x1f9b6;','&#x1f9b7;','&#x1f9b8;','&#x1f9b9;','&#x1f9c0;','&#x1f9c1;','&#x1f9c2;','&#x1f9d0;','&#x1f9d1;','&#x1f9d2;','&#x1f9d3;','&#x1f9d4;','&#x1f9d5;','&#x1f9d6;','&#x1f9d7;','&#x1f9d8;','&#x1f9d9;','&#x1f9da;','&#x1f9db;','&#x1f9dc;','&#x1f9dd;','&#x1f9de;','&#x1f9df;','&#x1f9e0;','&#x1f9e1;','&#x1f9e2;','&#x1f9e3;','&#x1f9e4;','&#x1f9e5;','&#x1f9e6;','&#x1f9e7;','&#x1f9e8;','&#x1f9e9;','&#x1f9ea;','&#x1f9eb;','&#x1f9ec;','&#x1f9ed;','&#x1f9ee;','&#x1f9ef;','&#x1f9f0;','&#x1f9f1;','&#x1f9f2;','&#x1f9f3;','&#x1f9f4;','&#x1f9f5;','&#x1f9f6;','&#x1f9f7;','&#x1f9f8;','&#x1f9f9;','&#x1f9fa;','&#x1f9fb;','&#x1f9fc;','&#x1f9fd;','&#x1f9fe;','&#x1f9ff;','&#x203c;','&#x2049;','&#x2122;','&#x2139;','&#x2194;','&#x2195;','&#x2196;','&#x2197;','&#x2198;','&#x2199;','&#x21a9;','&#x21aa;','&#x20e3;','&#x231a;','&#x231b;','&#x2328;','&#x23cf;','&#x23e9;','&#x23ea;','&#x23eb;','&#x23ec;','&#x23ed;','&#x23ee;','&#x23ef;','&#x23f0;','&#x23f1;','&#x23f2;','&#x23f3;','&#x23f8;','&#x23f9;','&#x23fa;','&#x24c2;','&#x25aa;','&#x25ab;','&#x25b6;','&#x25c0;','&#x25fb;','&#x25fc;','&#x25fd;','&#x25fe;','&#x2600;','&#x2601;','&#x2602;','&#x2603;','&#x2604;','&#x260e;','&#x2611;','&#x2614;','&#x2615;','&#x2618;','&#x261d;','&#x2622;','&#x2623;','&#x2626;','&#x262a;','&#x262e;','&#x262f;','&#x2638;','&#x2639;','&#x263a;','&#x2648;','&#x2649;','&#x264a;','&#x264b;','&#x264c;','&#x264d;','&#x264e;','&#x264f;','&#x2650;','&#x2651;','&#x2652;','&#x2653;','&#x265f;','&#x2660;','&#x2663;','&#x2665;','&#x2666;','&#x2668;','&#x267b;','&#x267e;','&#x267f;','&#x2692;','&#x2693;','&#x2694;','&#x2697;','&#x2699;','&#x269b;','&#x269c;','&#x26a0;','&#x26a1;','&#x26aa;','&#x26ab;','&#x26b0;','&#x26b1;','&#x26bd;','&#x26be;','&#x26c4;','&#x26c5;','&#x26c8;','&#x26ce;','&#x26cf;','&#x26d1;','&#x26d3;','&#x26d4;','&#x26e9;','&#x26ea;','&#x26f0;','&#x26f1;','&#x26f2;','&#x26f3;','&#x26f4;','&#x26f5;','&#x26f7;','&#x26f8;','&#x26f9;','&#x26fa;','&#x26fd;','&#x2702;','&#x2705;','&#x2709;','&#x270a;','&#x270b;','&#x270c;','&#x270d;','&#x270f;','&#x2712;','&#x2714;','&#x2716;','&#x271d;','&#x2721;','&#x2728;','&#x2733;','&#x2734;','&#x2744;','&#x2747;','&#x274c;','&#x274e;','&#x2753;','&#x2754;','&#x2755;','&#x2757;','&#x2763;','&#x2795;','&#x2796;','&#x2797;','&#x27a1;','&#x27b0;','&#x27bf;','&#x2934;','&#x2935;','&#x2b05;','&#x2b06;','&#x2b07;','&#x2b1b;','&#x2b1c;','&#x2b50;','&#x2b55;','&#x3030;','&#x303d;','&#x3297;','&#x3299;','&#xe50a;');
  4836. // END: emoji arrays
  4837. if ( 'entities' === $type ) {
  4838. return $entities;
  4839. }
  4840. return $partials;
  4841. }
  4842. /**
  4843. * Shorten a URL, to be used as link text.
  4844. *
  4845. * @since 1.2.0
  4846. * @since 4.4.0 Moved to wp-includes/formatting.php from wp-admin/includes/misc.php and added $length param.
  4847. *
  4848. * @param string $url URL to shorten.
  4849. * @param int $length Optional. Maximum length of the shortened URL. Default 35 characters.
  4850. * @return string Shortened URL.
  4851. */
  4852. function url_shorten( $url, $length = 35 ) {
  4853. $stripped = str_replace( array( 'https://', 'http://', 'www.' ), '', $url );
  4854. $short_url = untrailingslashit( $stripped );
  4855. if ( strlen( $short_url ) > $length ) {
  4856. $short_url = substr( $short_url, 0, $length - 3 ) . '&hellip;';
  4857. }
  4858. return $short_url;
  4859. }
  4860. /**
  4861. * Sanitizes a hex color.
  4862. *
  4863. * Returns either '', a 3 or 6 digit hex color (with #), or nothing.
  4864. * For sanitizing values without a #, see sanitize_hex_color_no_hash().
  4865. *
  4866. * @since 3.4.0
  4867. *
  4868. * @param string $color
  4869. * @return string|void
  4870. */
  4871. function sanitize_hex_color( $color ) {
  4872. if ( '' === $color ) {
  4873. return '';
  4874. }
  4875. // 3 or 6 hex digits, or the empty string.
  4876. if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
  4877. return $color;
  4878. }
  4879. }
  4880. /**
  4881. * Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible.
  4882. *
  4883. * Saving hex colors without a hash puts the burden of adding the hash on the
  4884. * UI, which makes it difficult to use or upgrade to other color types such as
  4885. * rgba, hsl, rgb, and html color names.
  4886. *
  4887. * Returns either '', a 3 or 6 digit hex color (without a #), or null.
  4888. *
  4889. * @since 3.4.0
  4890. *
  4891. * @param string $color
  4892. * @return string|null
  4893. */
  4894. function sanitize_hex_color_no_hash( $color ) {
  4895. $color = ltrim( $color, '#' );
  4896. if ( '' === $color ) {
  4897. return '';
  4898. }
  4899. return sanitize_hex_color( '#' . $color ) ? $color : null;
  4900. }
  4901. /**
  4902. * Ensures that any hex color is properly hashed.
  4903. * Otherwise, returns value untouched.
  4904. *
  4905. * This method should only be necessary if using sanitize_hex_color_no_hash().
  4906. *
  4907. * @since 3.4.0
  4908. *
  4909. * @param string $color
  4910. * @return string
  4911. */
  4912. function maybe_hash_hex_color( $color ) {
  4913. if ( $unhashed = sanitize_hex_color_no_hash( $color ) ) {
  4914. return '#' . $unhashed;
  4915. }
  4916. return $color;
  4917. }