ofs | hex dump | ascii |
---|
0000 | 70 61 63 6b 61 67 65 2e 78 6d 6c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | package.xml..................... |
0020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0040 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0060 | 00 00 00 00 31 30 30 36 36 34 20 00 20 20 20 20 20 30 20 00 20 20 20 37 36 37 20 00 20 20 20 20 | ....100664.......0.....767...... |
0080 | 20 20 20 33 30 33 33 20 20 37 35 32 30 35 33 32 36 36 33 20 20 20 36 33 30 30 20 00 00 00 00 00 | ...3033..7520532663...6300...... |
00a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
00c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
00e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0100 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0120 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0140 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0160 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
01e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0200 | 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d 22 49 53 | <?xml.version="1.0".encoding="IS |
0220 | 4f 2d 38 38 35 39 2d 31 22 20 3f 3e 0a 3c 70 61 63 6b 61 67 65 20 76 65 72 73 69 6f 6e 3d 22 31 | O-8859-1".?>.<package.version="1 |
0240 | 2e 30 22 3e 0a 20 20 3c 6e 61 6d 65 3e 4d 61 69 6c 3c 2f 6e 61 6d 65 3e 0a 20 20 3c 73 75 6d 6d | .0">...<name>Mail</name>...<summ |
0260 | 61 72 79 3e 43 6c 61 73 73 20 74 68 61 74 20 70 72 6f 76 69 64 65 73 20 6d 75 6c 74 69 70 6c 65 | ary>Class.that.provides.multiple |
0280 | 20 69 6e 74 65 72 66 61 63 65 73 20 66 6f 72 20 73 65 6e 64 69 6e 67 20 65 6d 61 69 6c 73 3c 2f | .interfaces.for.sending.emails</ |
02a0 | 73 75 6d 6d 61 72 79 3e 0a 20 20 3c 64 65 73 63 72 69 70 74 69 6f 6e 3e 54 68 65 20 50 45 41 52 | summary>...<description>The.PEAR |
02c0 | 27 73 20 4d 61 69 6c 3a 3a 20 69 6e 74 65 72 66 61 63 65 2c 20 64 65 66 69 6e 65 73 20 74 68 65 | 's.Mail::.interface,.defines.the |
02e0 | 20 69 6e 74 65 72 66 61 63 65 20 66 6f 72 20 69 6d 70 6c 65 6d 65 6e 74 69 6e 67 3c 2f 64 65 73 | .interface.for.implementing</des |
0300 | 63 72 69 70 74 69 6f 6e 3e 0a 20 20 3c 6d 61 69 6e 74 61 69 6e 65 72 73 3e 0a 20 20 20 20 3c 6d | cription>...<maintainers>.....<m |
0320 | 61 69 6e 74 61 69 6e 65 72 3e 0a 20 20 20 20 20 20 3c 75 73 65 72 3e 63 68 61 67 65 6e 62 75 3c | aintainer>.......<user>chagenbu< |
0340 | 2f 75 73 65 72 3e 0a 20 20 20 20 20 20 3c 6e 61 6d 65 3e 43 68 75 63 6b 20 48 61 67 65 6e 62 75 | /user>.......<name>Chuck.Hagenbu |
0360 | 63 68 3c 2f 6e 61 6d 65 3e 0a 20 20 20 20 20 20 3c 65 6d 61 69 6c 3e 63 68 75 63 6b 40 68 6f 72 | ch</name>.......<email>chuck@hor |
0380 | 64 65 2e 6f 72 67 3c 2f 65 6d 61 69 6c 3e 0a 20 20 20 20 20 20 3c 72 6f 6c 65 3e 6c 65 61 64 3c | de.org</email>.......<role>lead< |
03a0 | 2f 72 6f 6c 65 3e 0a 20 20 20 20 3c 2f 6d 61 69 6e 74 61 69 6e 65 72 3e 0a 20 20 20 20 3c 6d 61 | /role>.....</maintainer>.....<ma |
03c0 | 69 6e 74 61 69 6e 65 72 3e 0a 20 20 20 20 20 20 3c 75 73 65 72 3e 72 69 63 68 61 72 64 3c 2f 75 | intainer>.......<user>richard</u |
03e0 | 73 65 72 3e 0a 20 20 20 20 20 20 3c 6e 61 6d 65 3e 52 69 63 68 61 72 64 20 48 65 79 65 73 3c 2f | ser>.......<name>Richard.Heyes</ |
0400 | 6e 61 6d 65 3e 0a 20 20 20 20 20 20 3c 65 6d 61 69 6c 3e 72 69 63 68 61 72 64 40 70 68 70 67 75 | name>.......<email>richard@phpgu |
0420 | 72 75 2e 6f 72 67 3c 2f 65 6d 61 69 6c 3e 0a 20 20 20 20 20 20 3c 72 6f 6c 65 3e 64 65 76 65 6c | ru.org</email>.......<role>devel |
0440 | 6f 70 65 72 3c 2f 72 6f 6c 65 3e 0a 20 20 20 20 3c 2f 6d 61 69 6e 74 61 69 6e 65 72 3e 0a 20 20 | oper</role>.....</maintainer>... |
0460 | 3c 2f 6d 61 69 6e 74 61 69 6e 65 72 73 3e 0a 20 20 3c 72 65 6c 65 61 73 65 3e 0a 20 20 20 20 3c | </maintainers>...<release>.....< |
0480 | 76 65 72 73 69 6f 6e 3e 31 2e 30 2e 31 3c 2f 76 65 72 73 69 6f 6e 3e 0a 20 20 20 20 3c 64 61 74 | version>1.0.1</version>.....<dat |
04a0 | 65 3e 32 30 30 32 2d 30 37 2d 32 37 3c 2f 64 61 74 65 3e 0a 20 20 20 20 3c 6c 69 63 65 6e 73 65 | e>2002-07-27</date>.....<license |
04c0 | 3e 50 48 50 2f 42 53 44 3c 2f 6c 69 63 65 6e 73 65 3e 0a 20 20 20 20 3c 73 74 61 74 65 3e 73 74 | >PHP/BSD</license>.....<state>st |
04e0 | 61 62 6c 65 3c 2f 73 74 61 74 65 3e 0a 20 20 20 20 3c 6e 6f 74 65 73 3e 4c 69 63 65 6e 73 65 20 | able</state>.....<notes>License. |
0500 | 63 68 61 6e 67 65 20 66 6f 72 20 52 46 43 38 32 32 2e 70 68 70 3c 2f 6e 6f 74 65 73 3e 0a 20 20 | change.for.RFC822.php</notes>... |
0520 | 20 20 3c 64 65 70 73 3e 0a 20 20 20 20 20 20 3c 64 65 70 20 74 79 70 65 3d 22 70 6b 67 22 20 72 | ..<deps>.......<dep.type="pkg".r |
0540 | 65 6c 3d 22 68 61 73 22 3e 4e 65 74 5f 53 4d 54 50 3c 2f 64 65 70 3e 0a 20 20 20 20 3c 2f 64 65 | el="has">Net_SMTP</dep>.....</de |
0560 | 70 73 3e 0a 20 20 20 20 3c 66 69 6c 65 6c 69 73 74 3e 0a 20 20 20 20 20 20 3c 66 69 6c 65 20 72 | ps>.....<filelist>.......<file.r |
0580 | 6f 6c 65 3d 22 70 68 70 22 20 6d 64 35 73 75 6d 3d 22 33 35 30 30 32 38 62 38 64 65 63 35 61 34 | ole="php".md5sum="350028b8dec5a4 |
05a0 | 36 39 30 33 62 36 38 32 31 39 61 39 62 39 66 62 38 64 22 20 6e 61 6d 65 3d 22 4d 61 69 6c 2e 70 | 6903b68219a9b9fb8d".name="Mail.p |
05c0 | 68 70 22 2f 3e 0a 20 20 20 20 20 20 3c 66 69 6c 65 20 72 6f 6c 65 3d 22 70 68 70 22 20 6d 64 35 | hp"/>.......<file.role="php".md5 |
05e0 | 73 75 6d 3d 22 36 33 38 32 64 31 36 30 64 37 63 38 31 63 65 65 38 34 37 63 63 63 62 37 34 63 66 | sum="6382d160d7c81cee847cccb74cf |
0600 | 30 63 65 30 62 22 20 6e 61 6d 65 3d 22 4d 61 69 6c 2f 6d 61 69 6c 2e 70 68 70 22 2f 3e 0a 20 20 | 0ce0b".name="Mail/mail.php"/>... |
0620 | 20 20 20 20 3c 66 69 6c 65 20 72 6f 6c 65 3d 22 70 68 70 22 20 6d 64 35 73 75 6d 3d 22 61 33 65 | ....<file.role="php".md5sum="a3e |
0640 | 37 62 39 38 33 31 61 61 37 64 61 35 62 63 62 61 37 62 33 36 30 61 39 61 63 37 33 39 66 22 20 6e | 7b9831aa7da5bcba7b360a9ac739f".n |
0660 | 61 6d 65 3d 22 4d 61 69 6c 2f 73 65 6e 64 6d 61 69 6c 2e 70 68 70 22 2f 3e 0a 20 20 20 20 20 20 | ame="Mail/sendmail.php"/>....... |
0680 | 3c 66 69 6c 65 20 72 6f 6c 65 3d 22 70 68 70 22 20 6d 64 35 73 75 6d 3d 22 39 34 63 32 35 35 31 | <file.role="php".md5sum="94c2551 |
06a0 | 39 31 63 61 38 61 39 35 61 32 62 31 30 34 30 63 33 36 62 61 36 64 39 39 64 22 20 6e 61 6d 65 3d | 91ca8a95a2b1040c36ba6d99d".name= |
06c0 | 22 4d 61 69 6c 2f 73 6d 74 70 2e 70 68 70 22 2f 3e 0a 20 20 20 20 20 20 3c 66 69 6c 65 20 72 6f | "Mail/smtp.php"/>.......<file.ro |
06e0 | 6c 65 3d 22 70 68 70 22 20 6d 64 35 73 75 6d 3d 22 31 35 62 62 38 62 34 30 63 39 38 65 62 63 38 | le="php".md5sum="15bb8b40c98ebc8 |
0700 | 30 39 36 65 65 32 35 64 38 63 32 36 62 32 39 31 36 22 20 6e 61 6d 65 3d 22 4d 61 69 6c 2f 52 46 | 096ee25d8c26b2916".name="Mail/RF |
0720 | 43 38 32 32 2e 70 68 70 22 2f 3e 0a 20 20 20 20 3c 2f 66 69 6c 65 6c 69 73 74 3e 0a 20 20 3c 2f | C822.php"/>.....</filelist>...</ |
0740 | 72 65 6c 65 61 73 65 3e 0a 20 20 3c 63 68 61 6e 67 65 6c 6f 67 3e 0a 20 20 20 20 3c 72 65 6c 65 | release>...<changelog>.....<rele |
0760 | 61 73 65 3e 0a 20 20 20 20 20 20 3c 76 65 72 73 69 6f 6e 3e 31 2e 30 3c 2f 76 65 72 73 69 6f 6e | ase>.......<version>1.0</version |
0780 | 3e 0a 20 20 20 20 20 20 3c 64 61 74 65 3e 32 30 30 32 2d 30 36 2d 30 36 3c 2f 64 61 74 65 3e 0a | >.......<date>2002-06-06</date>. |
07a0 | 20 20 20 20 20 20 3c 73 74 61 74 65 3e 73 74 61 62 6c 65 3c 2f 73 74 61 74 65 3e 0a 20 20 20 20 | ......<state>stable</state>..... |
07c0 | 20 20 3c 6e 6f 74 65 73 3e 49 6e 69 74 69 61 6c 20 72 65 6c 65 61 73 65 20 61 73 20 50 45 41 52 | ..<notes>Initial.release.as.PEAR |
07e0 | 20 70 61 63 6b 61 67 65 0a 3c 2f 6e 6f 74 65 73 3e 0a 20 20 20 20 3c 2f 72 65 6c 65 61 73 65 3e | .package.</notes>.....</release> |
0800 | 0a 20 20 3c 2f 63 68 61 6e 67 65 6c 6f 67 3e 0a 3c 2f 70 61 63 6b 61 67 65 3e 0a 00 00 00 00 00 | ...</changelog>.</package>...... |
0820 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0840 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0860 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0880 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
08a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
08c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
08e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0900 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0920 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0960 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
09a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
09c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
09e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0a00 | 4d 61 69 6c 2d 31 2e 30 2e 31 2f 4d 61 69 6c 2e 70 68 70 00 00 00 00 00 00 00 00 00 00 00 00 00 | Mail-1.0.1/Mail.php............. |
0a20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0a40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0a60 | 00 00 00 00 31 30 30 36 36 34 20 00 20 20 20 20 20 30 20 00 20 20 20 37 36 37 20 00 20 20 20 20 | ....100664.......0.....767...... |
0a80 | 20 20 31 36 31 35 37 20 20 37 35 31 36 34 36 32 32 36 35 20 20 20 37 31 33 33 20 00 00 00 00 00 | ..16157..7516462265...7133...... |
0aa0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0ac0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0ae0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0b00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0b20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0b40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0b60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0b80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0ba0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0bc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0be0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
0c00 | 3c 3f 70 68 70 0a 2f 2f 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | <?php.//.//.+------------------- |
0c20 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0c40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 50 48 50 20 56 65 | -------------------+.//.|.PHP.Ve |
0c60 | 72 73 69 6f 6e 20 34 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | rsion.4......................... |
0c80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c | ...............................| |
0ca0 | 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | .//.+--------------------------- |
0cc0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0ce0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 | -----------+.//.|.Copyright.(c). |
0d00 | 31 39 39 37 2d 32 30 30 32 20 54 68 65 20 50 48 50 20 47 72 6f 75 70 20 20 20 20 20 20 20 20 20 | 1997-2002.The.PHP.Group......... |
0d20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | .......................|.//.+--- |
0d40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0d60 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0d80 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 54 68 69 73 20 73 6f 75 72 63 65 20 66 69 6c 65 20 69 73 20 73 75 | ---+.//.|.This.source.file.is.su |
0da0 | 62 6a 65 63 74 20 74 6f 20 76 65 72 73 69 6f 6e 20 32 2e 30 32 20 6f 66 20 74 68 65 20 50 48 50 | bject.to.version.2.02.of.the.PHP |
0dc0 | 20 6c 69 63 65 6e 73 65 2c 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 74 68 61 74 20 69 73 20 62 75 | .license,......|.//.|.that.is.bu |
0de0 | 6e 64 6c 65 64 20 77 69 74 68 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 69 6e 20 74 68 65 20 66 | ndled.with.this.package.in.the.f |
0e00 | 69 6c 65 20 4c 49 43 45 4e 53 45 2c 20 61 6e 64 20 69 73 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 | ile.LICENSE,.and.is........|.//. |
0e20 | 7c 20 61 76 61 69 6c 61 62 6c 65 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c 64 2d 77 69 | |.available.through.the.world-wi |
0e40 | 64 65 2d 77 65 62 20 61 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 75 72 6c 3a 20 20 20 20 | de-web.at.the.following.url:.... |
0e60 | 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 68 74 74 70 3a 2f 2f 77 77 77 2e 70 68 70 2e 6e 65 74 | .......|.//.|.http://www.php.net |
0e80 | 2f 6c 69 63 65 6e 73 65 2f 32 5f 30 32 2e 74 78 74 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | /license/2_02.txt............... |
0ea0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 49 66 20 79 6f 75 | ...................|.//.|.If.you |
0ec0 | 20 64 69 64 20 6e 6f 74 20 72 65 63 65 69 76 65 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 50 | .did.not.receive.a.copy.of.the.P |
0ee0 | 48 50 20 6c 69 63 65 6e 73 65 20 61 6e 64 20 61 72 65 20 75 6e 61 62 6c 65 20 74 6f 20 20 20 7c | HP.license.and.are.unable.to...| |
0f00 | 0a 2f 2f 20 7c 20 6f 62 74 61 69 6e 20 69 74 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c | .//.|.obtain.it.through.the.worl |
0f20 | 64 2d 77 69 64 65 2d 77 65 62 2c 20 70 6c 65 61 73 65 20 73 65 6e 64 20 61 20 6e 6f 74 65 20 74 | d-wide-web,.please.send.a.note.t |
0f40 | 6f 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 6c 69 63 65 6e 73 65 40 70 68 70 2e 6e 65 | o..........|.//.|.license@php.ne |
0f60 | 74 20 73 6f 20 77 65 20 63 61 6e 20 6d 61 69 6c 20 79 6f 75 20 61 20 63 6f 70 79 20 69 6d 6d 65 | t.so.we.can.mail.you.a.copy.imme |
0f80 | 64 69 61 74 65 6c 79 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | diately................|.//.+--- |
0fa0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0fc0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
0fe0 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 41 75 74 68 6f 72 3a 20 43 68 75 63 6b 20 48 61 67 65 6e 62 75 63 | ---+.//.|.Author:.Chuck.Hagenbuc |
1000 | 68 20 3c 63 68 75 63 6b 40 68 6f 72 64 65 2e 6f 72 67 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 | h.<chuck@horde.org>............. |
1020 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | ...............|.//.+----------- |
1040 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
1060 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 0a | ---------------------------+.//. |
1080 | 2f 2f 20 24 49 64 3a 20 4d 61 69 6c 2e 70 68 70 2c 76 20 31 2e 31 20 32 30 30 32 2f 30 37 2f 32 | //.$Id:.Mail.php,v.1.1.2002/07/2 |
10a0 | 31 20 30 37 3a 33 37 3a 32 35 20 73 73 62 20 45 78 70 20 24 0a 0a 72 65 71 75 69 72 65 5f 6f 6e | 1.07:37:25.ssb.Exp.$..require_on |
10c0 | 63 65 20 27 50 45 41 52 2e 70 68 70 27 3b 0a 0a 2f 2a 2a 0a 20 2a 20 50 45 41 52 27 73 20 4d 61 | ce.'PEAR.php';../**..*.PEAR's.Ma |
10e0 | 69 6c 3a 3a 20 69 6e 74 65 72 66 61 63 65 2e 20 44 65 66 69 6e 65 73 20 74 68 65 20 69 6e 74 65 | il::.interface..Defines.the.inte |
1100 | 72 66 61 63 65 20 66 6f 72 20 69 6d 70 6c 65 6d 65 6e 74 69 6e 67 0a 20 2a 20 6d 61 69 6c 65 72 | rface.for.implementing..*.mailer |
1120 | 73 20 75 6e 64 65 72 20 74 68 65 20 50 45 41 52 20 68 69 65 72 61 72 63 68 79 2c 20 61 6e 64 20 | s.under.the.PEAR.hierarchy,.and. |
1140 | 70 72 6f 76 69 64 65 73 20 73 75 70 70 6f 72 74 69 6e 67 20 66 75 6e 63 74 69 6f 6e 73 0a 20 2a | provides.supporting.functions..* |
1160 | 20 75 73 65 66 75 6c 20 69 6e 20 6d 75 6c 74 69 70 6c 65 20 6d 61 69 6c 65 72 20 62 61 63 6b 65 | .useful.in.multiple.mailer.backe |
1180 | 6e 64 73 2e 0a 20 2a 0a 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 2a 20 40 76 65 | nds...*..*.@access.public..*.@ve |
11a0 | 72 73 69 6f 6e 20 24 52 65 76 69 73 69 6f 6e 3a 20 31 2e 31 20 24 0a 20 2a 20 40 70 61 63 6b 61 | rsion.$Revision:.1.1.$..*.@packa |
11c0 | 67 65 20 4d 61 69 6c 0a 20 2a 2f 0a 63 6c 61 73 73 20 4d 61 69 6c 20 65 78 74 65 6e 64 73 20 50 | ge.Mail..*/.class.Mail.extends.P |
11e0 | 45 41 52 0a 7b 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 50 72 6f 76 69 64 65 73 20 61 6e | EAR.{...../**......*.Provides.an |
1200 | 20 69 6e 74 65 72 66 61 63 65 20 66 6f 72 20 67 65 6e 65 72 61 74 69 6e 67 20 4d 61 69 6c 3a 3a | .interface.for.generating.Mail:: |
1220 | 20 6f 62 6a 65 63 74 73 20 6f 66 20 76 61 72 69 6f 75 73 0a 20 20 20 20 20 2a 20 74 79 70 65 73 | .objects.of.various......*.types |
1240 | 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 64 72 | ......*......*.@param.string.$dr |
1260 | 69 76 65 72 20 54 68 65 20 6b 69 6e 64 20 6f 66 20 4d 61 69 6c 3a 3a 20 6f 62 6a 65 63 74 20 74 | iver.The.kind.of.Mail::.object.t |
1280 | 6f 20 69 6e 73 74 61 6e 74 69 61 74 65 2e 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 61 72 72 | o.instantiate.......*.@param.arr |
12a0 | 61 79 20 20 24 70 61 72 61 6d 73 20 54 68 65 20 70 61 72 61 6d 65 74 65 72 73 20 74 6f 20 70 61 | ay..$params.The.parameters.to.pa |
12c0 | 73 73 20 74 6f 20 74 68 65 20 4d 61 69 6c 3a 3a 20 6f 62 6a 65 63 74 2e 0a 20 20 20 20 20 2a 20 | ss.to.the.Mail::.object.......*. |
12e0 | 40 72 65 74 75 72 6e 20 6f 62 6a 65 63 74 20 4d 61 69 6c 20 61 20 69 6e 73 74 61 6e 63 65 20 6f | @return.object.Mail.a.instance.o |
1300 | 66 20 74 68 65 20 64 72 69 76 65 72 20 63 6c 61 73 73 20 6f 72 20 69 66 20 66 61 69 6c 73 20 61 | f.the.driver.class.or.if.fails.a |
1320 | 20 50 45 41 52 20 45 72 72 6f 72 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 | .PEAR.Error......*.@access.publi |
1340 | 63 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 66 61 63 74 6f 72 79 28 24 | c......*/.....function.factory($ |
1360 | 64 72 69 76 65 72 2c 20 24 70 61 72 61 6d 73 20 3d 20 61 72 72 61 79 28 29 29 0a 20 20 20 20 7b | driver,.$params.=.array()).....{ |
1380 | 0a 20 20 20 20 20 20 20 20 24 64 72 69 76 65 72 20 3d 20 73 74 72 74 6f 6c 6f 77 65 72 28 24 64 | .........$driver.=.strtolower($d |
13a0 | 72 69 76 65 72 29 3b 0a 20 20 20 20 20 20 20 20 40 69 6e 63 6c 75 64 65 5f 6f 6e 63 65 20 27 4d | river);.........@include_once.'M |
13c0 | 61 69 6c 2f 27 20 2e 20 24 64 72 69 76 65 72 20 2e 20 27 2e 70 68 70 27 3b 0a 20 20 20 20 20 20 | ail/'...$driver...'.php';....... |
13e0 | 20 20 24 63 6c 61 73 73 20 3d 20 27 4d 61 69 6c 5f 27 20 2e 20 24 64 72 69 76 65 72 3b 0a 20 20 | ..$class.=.'Mail_'...$driver;... |
1400 | 20 20 20 20 20 20 69 66 20 28 63 6c 61 73 73 5f 65 78 69 73 74 73 28 24 63 6c 61 73 73 29 29 20 | ......if.(class_exists($class)). |
1420 | 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 24 63 6c 61 73 73 28 | {.............return.new.$class( |
1440 | 24 70 61 72 61 6d 73 29 3b 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 20 | $params);.........}.else.{...... |
1460 | 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 50 45 41 52 3a 3a 72 61 69 73 65 45 72 72 6f 72 28 27 | .......return.PEAR::raiseError(' |
1480 | 55 6e 61 62 6c 65 20 74 6f 20 66 69 6e 64 20 63 6c 61 73 73 20 66 6f 72 20 64 72 69 76 65 72 20 | Unable.to.find.class.for.driver. |
14a0 | 27 20 2e 20 24 64 72 69 76 65 72 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 7d 0a 0a 20 | '...$driver);.........}.....}... |
14c0 | 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 49 6d 70 6c 65 6d 65 6e 74 73 20 4d 61 69 6c 3a 3a 73 | .../**......*.Implements.Mail::s |
14e0 | 65 6e 64 28 29 20 66 75 6e 63 74 69 6f 6e 20 75 73 69 6e 67 20 70 68 70 27 73 20 62 75 69 6c 74 | end().function.using.php's.built |
1500 | 2d 69 6e 20 6d 61 69 6c 28 29 0a 20 20 20 20 20 2a 20 63 6f 6d 6d 61 6e 64 2e 0a 20 20 20 20 20 | -in.mail()......*.command....... |
1520 | 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 6d 69 78 65 64 20 24 72 65 63 69 70 69 65 6e 74 | *......*.@param.mixed.$recipient |
1540 | 73 20 45 69 74 68 65 72 20 61 20 63 6f 6d 6d 61 2d 73 65 70 65 72 61 74 65 64 20 6c 69 73 74 20 | s.Either.a.comma-seperated.list. |
1560 | 6f 66 20 72 65 63 69 70 69 65 6e 74 73 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 | of.recipients......*............ |
1580 | 20 20 28 52 46 43 38 32 32 20 63 6f 6d 70 6c 69 61 6e 74 29 2c 20 6f 72 20 61 6e 20 61 72 72 61 | ..(RFC822.compliant),.or.an.arra |
15a0 | 79 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 2c 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 | y.of.recipients,......*......... |
15c0 | 20 20 20 20 20 65 61 63 68 20 52 46 43 38 32 32 20 76 61 6c 69 64 2e 20 54 68 69 73 20 6d 61 79 | .....each.RFC822.valid..This.may |
15e0 | 20 63 6f 6e 74 61 69 6e 20 72 65 63 69 70 69 65 6e 74 73 20 6e 6f 74 0a 20 20 20 20 20 2a 20 20 | .contain.recipients.not......*.. |
1600 | 20 20 20 20 20 20 20 20 20 20 20 20 73 70 65 63 69 66 69 65 64 20 69 6e 20 74 68 65 20 68 65 61 | ............specified.in.the.hea |
1620 | 64 65 72 73 2c 20 66 6f 72 20 42 63 63 3a 2c 20 72 65 73 65 6e 64 69 6e 67 0a 20 20 20 20 20 2a | ders,.for.Bcc:,.resending......* |
1640 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 65 73 73 61 67 65 73 2c 20 65 74 63 2e 0a 20 20 20 | ..............messages,.etc..... |
1660 | 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 61 72 72 61 79 20 24 68 65 61 64 65 72 73 | ..*......*.@param.array.$headers |
1680 | 20 54 68 65 20 61 72 72 61 79 20 6f 66 20 68 65 61 64 65 72 73 20 74 6f 20 73 65 6e 64 20 77 69 | .The.array.of.headers.to.send.wi |
16a0 | 74 68 20 74 68 65 20 6d 61 69 6c 2c 20 69 6e 20 61 6e 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 | th.the.mail,.in.an......*....... |
16c0 | 20 20 20 20 20 20 20 61 73 73 6f 63 69 61 74 69 76 65 20 61 72 72 61 79 2c 20 77 68 65 72 65 20 | .......associative.array,.where. |
16e0 | 74 68 65 20 61 72 72 61 79 20 6b 65 79 20 69 73 20 74 68 65 0a 20 20 20 20 20 2a 20 20 20 20 20 | the.array.key.is.the......*..... |
1700 | 20 20 20 20 20 20 20 20 20 68 65 61 64 65 72 20 6e 61 6d 65 20 28 69 65 2c 20 27 53 75 62 6a 65 | .........header.name.(ie,.'Subje |
1720 | 63 74 27 29 2c 20 61 6e 64 20 74 68 65 20 61 72 72 61 79 20 76 61 6c 75 65 0a 20 20 20 20 20 2a | ct'),.and.the.array.value......* |
1740 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 20 74 68 65 20 68 65 61 64 65 72 20 76 61 6c 75 | ..............is.the.header.valu |
1760 | 65 20 28 69 65 2c 20 27 74 65 73 74 27 29 2e 20 54 68 65 20 68 65 61 64 65 72 0a 20 20 20 20 20 | e.(ie,.'test')..The.header...... |
1780 | 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 64 75 63 65 64 20 66 72 6f 6d 20 74 68 6f | *..............produced.from.tho |
17a0 | 73 65 20 76 61 6c 75 65 73 20 77 6f 75 6c 64 20 62 65 20 27 53 75 62 6a 65 63 74 3a 0a 20 20 20 | se.values.would.be.'Subject:.... |
17c0 | 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 65 73 74 27 2e 0a 20 20 20 20 20 2a 0a 20 | ..*..............test'.......*.. |
17e0 | 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 62 6f 64 79 20 54 68 65 20 66 75 | ....*.@param.string.$body.The.fu |
1800 | 6c 6c 20 74 65 78 74 20 6f 66 20 74 68 65 20 6d 65 73 73 61 67 65 20 62 6f 64 79 2c 20 69 6e 63 | ll.text.of.the.message.body,.inc |
1820 | 6c 75 64 69 6e 67 20 61 6e 79 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | luding.any......*............... |
1840 | 4d 69 6d 65 20 70 61 72 74 73 2c 20 65 74 63 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 | Mime.parts,.etc.......*......*.@ |
1860 | 72 65 74 75 72 6e 20 6d 69 78 65 64 20 52 65 74 75 72 6e 73 20 74 72 75 65 20 6f 6e 20 73 75 63 | return.mixed.Returns.true.on.suc |
1880 | 63 65 73 73 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 72 6f 72 0a 20 20 20 20 20 2a 20 20 20 20 | cess,.or.a.PEAR_Error......*.... |
18a0 | 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 20 64 65 73 63 72 69 70 74 | ...........containing.a.descript |
18c0 | 69 76 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20 6f 6e 0a 20 20 20 20 20 2a 20 20 20 20 20 | ive.error.message.on......*..... |
18e0 | 20 20 20 20 20 20 20 20 20 20 66 61 69 6c 75 72 65 2e 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 | ..........failure.......*.@acces |
1900 | 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 20 40 64 65 70 72 65 63 61 74 65 64 20 75 73 65 20 | s.public......*.@deprecated.use. |
1920 | 4d 61 69 6c 5f 6d 61 69 6c 3a 3a 73 65 6e 64 20 69 6e 73 74 65 61 64 0a 20 20 20 20 20 2a 2f 0a | Mail_mail::send.instead......*/. |
1940 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 65 6e 64 28 24 72 65 63 69 70 69 65 6e 74 73 2c 20 24 | ....function.send($recipients,.$ |
1960 | 68 65 61 64 65 72 73 2c 20 24 62 6f 64 79 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 2f 2f | headers,.$body).....{.........// |
1980 | 20 69 66 20 77 65 27 72 65 20 70 61 73 73 65 64 20 61 6e 20 61 72 72 61 79 20 6f 66 20 72 65 63 | .if.we're.passed.an.array.of.rec |
19a0 | 69 70 69 65 6e 74 73 2c 20 69 6d 70 6c 6f 64 65 20 69 74 2e 0a 20 20 20 20 20 20 20 20 69 66 20 | ipients,.implode.it..........if. |
19c0 | 28 69 73 5f 61 72 72 61 79 28 24 72 65 63 69 70 69 65 6e 74 73 29 29 20 7b 0a 20 20 20 20 20 20 | (is_array($recipients)).{....... |
19e0 | 20 20 20 20 20 20 24 72 65 63 69 70 69 65 6e 74 73 20 3d 20 69 6d 70 6c 6f 64 65 28 27 2c 20 27 | ......$recipients.=.implode(',.' |
1a00 | 2c 20 24 72 65 63 69 70 69 65 6e 74 73 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 | ,.$recipients);.........}....... |
1a20 | 20 20 20 2f 2f 20 67 65 74 20 74 68 65 20 53 75 62 6a 65 63 74 20 6f 75 74 20 6f 66 20 74 68 65 | ...//.get.the.Subject.out.of.the |
1a40 | 20 68 65 61 64 65 72 73 20 61 72 72 61 79 20 73 6f 20 74 68 61 74 20 77 65 20 63 61 6e 0a 20 20 | .headers.array.so.that.we.can... |
1a60 | 20 20 20 20 20 20 2f 2f 20 70 61 73 73 20 69 74 20 61 73 20 61 20 73 65 70 65 72 61 74 65 20 61 | ......//.pass.it.as.a.seperate.a |
1a80 | 72 67 75 6d 65 6e 74 20 74 6f 20 6d 61 69 6c 28 29 2e 0a 20 20 20 20 20 20 20 20 24 73 75 62 6a | rgument.to.mail()..........$subj |
1aa0 | 65 63 74 20 3d 20 27 27 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 68 65 61 | ect.=.'';.........if.(isset($hea |
1ac0 | 64 65 72 73 5b 27 53 75 62 6a 65 63 74 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ders['Subject'])).{............. |
1ae0 | 24 73 75 62 6a 65 63 74 20 3d 20 24 68 65 61 64 65 72 73 5b 27 53 75 62 6a 65 63 74 27 5d 3b 0a | $subject.=.$headers['Subject'];. |
1b00 | 20 20 20 20 20 20 20 20 20 20 20 20 75 6e 73 65 74 28 24 68 65 61 64 65 72 73 5b 27 53 75 62 6a | ............unset($headers['Subj |
1b20 | 65 63 74 27 5d 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 2f 2f 20 66 6c | ect']);.........}..........//.fl |
1b40 | 61 74 74 65 6e 20 74 68 65 20 68 65 61 64 65 72 73 20 6f 75 74 2e 0a 20 20 20 20 20 20 20 20 6c | atten.the.headers.out..........l |
1b60 | 69 73 74 28 2c 24 74 65 78 74 5f 68 65 61 64 65 72 73 29 20 3d 20 4d 61 69 6c 3a 3a 70 72 65 70 | ist(,$text_headers).=.Mail::prep |
1b80 | 61 72 65 48 65 61 64 65 72 73 28 24 68 65 61 64 65 72 73 29 3b 0a 0a 20 20 20 20 20 20 20 20 72 | areHeaders($headers);..........r |
1ba0 | 65 74 75 72 6e 20 6d 61 69 6c 28 24 72 65 63 69 70 69 65 6e 74 73 2c 20 24 73 75 62 6a 65 63 74 | eturn.mail($recipients,.$subject |
1bc0 | 2c 20 24 62 6f 64 79 2c 20 24 74 65 78 74 5f 68 65 61 64 65 72 73 29 3b 0a 0a 20 20 20 20 7d 0a | ,.$body,.$text_headers);......}. |
1be0 | 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 61 6b 65 20 61 6e 20 61 72 72 61 79 20 6f 66 | ...../**......*.Take.an.array.of |
1c00 | 20 6d 61 69 6c 20 68 65 61 64 65 72 73 20 61 6e 64 20 72 65 74 75 72 6e 20 61 20 73 74 72 69 6e | .mail.headers.and.return.a.strin |
1c20 | 67 20 63 6f 6e 74 61 69 6e 69 6e 67 0a 20 20 20 20 20 2a 20 74 65 78 74 20 75 73 61 62 6c 65 20 | g.containing......*.text.usable. |
1c40 | 69 6e 20 73 65 6e 64 69 6e 67 20 61 20 6d 65 73 73 61 67 65 2e 0a 20 20 20 20 20 2a 0a 20 20 20 | in.sending.a.message.......*.... |
1c60 | 20 20 2a 20 40 70 61 72 61 6d 20 61 72 72 61 79 20 24 68 65 61 64 65 72 73 20 54 68 65 20 61 72 | ..*.@param.array.$headers.The.ar |
1c80 | 72 61 79 20 6f 66 20 68 65 61 64 65 72 73 20 74 6f 20 70 72 65 70 61 72 65 2c 20 69 6e 20 61 6e | ray.of.headers.to.prepare,.in.an |
1ca0 | 20 61 73 73 6f 63 69 61 74 69 76 65 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 | .associative......*............. |
1cc0 | 20 61 72 72 61 79 2c 20 77 68 65 72 65 20 74 68 65 20 61 72 72 61 79 20 6b 65 79 20 69 73 20 74 | .array,.where.the.array.key.is.t |
1ce0 | 68 65 20 68 65 61 64 65 72 20 6e 61 6d 65 20 28 69 65 2c 0a 20 20 20 20 20 2a 20 20 20 20 20 20 | he.header.name.(ie,......*...... |
1d00 | 20 20 20 20 20 20 20 20 27 53 75 62 6a 65 63 74 27 29 2c 20 61 6e 64 20 74 68 65 20 61 72 72 61 | ........'Subject'),.and.the.arra |
1d20 | 79 20 76 61 6c 75 65 20 69 73 20 74 68 65 20 68 65 61 64 65 72 0a 20 20 20 20 20 2a 20 20 20 20 | y.value.is.the.header......*.... |
1d40 | 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 20 28 69 65 2c 20 27 74 65 73 74 27 29 2e 20 54 68 | ..........value.(ie,.'test')..Th |
1d60 | 65 20 68 65 61 64 65 72 20 70 72 6f 64 75 63 65 64 20 66 72 6f 6d 20 74 68 6f 73 65 0a 20 20 20 | e.header.produced.from.those.... |
1d80 | 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 76 61 6c 75 65 73 20 77 6f 75 6c 64 20 62 65 | ..*..............values.would.be |
1da0 | 20 27 53 75 62 6a 65 63 74 3a 20 74 65 73 74 27 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 | .'Subject:.test'.......*......*. |
1dc0 | 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 52 65 74 75 72 6e 73 20 66 61 6c 73 65 20 69 66 20 69 | @return.mixed.Returns.false.if.i |
1de0 | 74 20 65 6e 63 6f 75 6e 74 65 72 73 20 61 20 62 61 64 20 61 64 64 72 65 73 73 2c 0a 20 20 20 20 | t.encounters.a.bad.address,..... |
1e00 | 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 74 68 65 72 77 69 73 65 20 72 65 74 75 72 | .*...............otherwise.retur |
1e20 | 6e 73 20 61 6e 20 61 72 72 61 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 77 6f 0a 20 20 20 20 20 | ns.an.array.containing.two...... |
1e40 | 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 6c 65 6d 65 6e 74 73 3a 20 41 6e 79 20 46 72 | *...............elements:.Any.Fr |
1e60 | 6f 6d 3a 20 61 64 64 72 65 73 73 20 66 6f 75 6e 64 20 69 6e 20 74 68 65 20 68 65 61 64 65 72 73 | om:.address.found.in.the.headers |
1e80 | 2c 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 6e 64 20 74 68 65 20 70 | ,......*...............and.the.p |
1ea0 | 6c 61 69 6e 20 74 65 78 74 20 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 65 20 68 65 61 64 65 72 73 | lain.text.version.of.the.headers |
1ec0 | 2e 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0a 20 20 20 20 20 2a 2f | .......*.@access.private......*/ |
1ee0 | 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 70 72 65 70 61 72 65 48 65 61 64 65 72 73 28 24 68 65 | .....function.prepareHeaders($he |
1f00 | 61 64 65 72 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 2f 2f 20 4c 6f 6f 6b 20 6f 75 74 | aders).....{.........//.Look.out |
1f20 | 20 66 6f 72 20 74 68 65 20 46 72 6f 6d 3a 20 76 61 6c 75 65 20 74 6f 20 75 73 65 20 61 6c 6f 6e | .for.the.From:.value.to.use.alon |
1f40 | 67 20 74 68 65 20 77 61 79 2e 0a 20 20 20 20 20 20 20 20 24 74 65 78 74 5f 68 65 61 64 65 72 73 | g.the.way..........$text_headers |
1f60 | 20 3d 20 27 27 3b 20 20 2f 2f 20 74 65 78 74 20 72 65 70 72 65 73 65 6e 74 61 74 69 6f 6e 20 6f | .=.'';..//.text.representation.o |
1f80 | 66 20 68 65 61 64 65 72 73 0a 20 20 20 20 20 20 20 20 24 66 72 6f 6d 20 3d 20 6e 75 6c 6c 3b 0a | f.headers.........$from.=.null;. |
1fa0 | 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 68 65 61 64 65 72 73 20 61 73 20 24 6b | .........foreach.($headers.as.$k |
1fc0 | 65 79 20 3d 3e 20 24 76 61 6c 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 6b | ey.=>.$val).{.............if.($k |
1fe0 | 65 79 20 3d 3d 20 27 46 72 6f 6d 27 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ey.==.'From').{................. |
2000 | 69 6e 63 6c 75 64 65 5f 6f 6e 63 65 20 27 4d 61 69 6c 2f 52 46 43 38 32 32 2e 70 68 70 27 3b 0a | include_once.'Mail/RFC822.php';. |
2020 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 66 72 6f 6d 5f 61 72 72 20 3d 20 4d 61 69 | .................$from_arr.=.Mai |
2040 | 6c 5f 52 46 43 38 32 32 3a 3a 70 61 72 73 65 41 64 64 72 65 73 73 4c 69 73 74 28 24 76 61 6c 2c | l_RFC822::parseAddressList($val, |
2060 | 20 27 6c 6f 63 61 6c 68 6f 73 74 27 2c 20 66 61 6c 73 65 29 3b 0a 20 20 20 20 20 20 20 20 20 20 | .'localhost',.false);........... |
2080 | 20 20 20 20 20 20 24 66 72 6f 6d 20 3d 20 24 66 72 6f 6d 5f 61 72 72 5b 30 5d 2d 3e 6d 61 69 6c | ......$from.=.$from_arr[0]->mail |
20a0 | 62 6f 78 20 2e 20 27 40 27 20 2e 20 24 66 72 6f 6d 5f 61 72 72 5b 30 5d 2d 3e 68 6f 73 74 3b 0a | box...'@'...$from_arr[0]->host;. |
20c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 73 74 72 28 24 66 72 6f 6d | ................if.(strstr($from |
20e0 | 2c 20 27 20 27 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f | ,.'.')).{.....................// |
2100 | 20 52 65 6a 65 63 74 20 6f 75 74 72 69 67 68 74 20 65 6e 76 65 6c 6f 70 65 20 46 72 6f 6d 20 61 | .Reject.outright.envelope.From.a |
2120 | 64 64 72 65 73 73 65 73 20 77 69 74 68 20 73 70 61 63 65 73 2e 0a 20 20 20 20 20 20 20 20 20 20 | ddresses.with.spaces............ |
2140 | 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 20 20 20 20 20 20 20 20 | ..........return.false;......... |
2160 | 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 65 78 74 5f | ........}.................$text_ |
2180 | 68 65 61 64 65 72 73 20 2e 3d 20 24 6b 65 79 20 2e 20 27 3a 20 27 20 2e 20 24 76 61 6c 20 2e 20 | headers..=.$key...':.'...$val... |
21a0 | 22 5c 6e 22 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 69 66 20 28 24 6b 65 | "\n";.............}.else.if.($ke |
21c0 | 79 20 3d 3d 20 27 52 65 63 65 69 76 65 64 27 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | y.==.'Received').{.............. |
21e0 | 20 20 20 2f 2f 20 70 75 74 20 52 65 63 65 69 76 65 64 3a 20 68 65 61 64 65 72 73 20 61 74 20 74 | ...//.put.Received:.headers.at.t |
2200 | 68 65 20 74 6f 70 2c 20 73 69 6e 63 65 20 52 65 63 65 69 65 76 65 64 3a 0a 20 20 20 20 20 20 20 | he.top,.since.Receieved:........ |
2220 | 20 20 20 20 20 20 20 20 20 2f 2f 20 61 66 74 65 72 20 53 75 62 6a 65 63 74 3a 20 69 6e 20 74 68 | .........//.after.Subject:.in.th |
2240 | 65 20 68 65 61 64 65 72 20 6f 72 64 65 72 20 69 73 20 73 6f 6d 74 69 6d 65 73 20 75 73 65 64 0a | e.header.order.is.somtimes.used. |
2260 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 61 73 20 61 20 73 70 61 6d 20 74 72 61 | ................//.as.a.spam.tra |
2280 | 70 2e 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 65 78 74 5f 68 65 61 64 65 72 73 | p..................$text_headers |
22a0 | 20 3d 20 24 6b 65 79 20 2e 20 27 3a 20 27 20 2e 20 24 76 61 6c 20 2e 20 22 5c 6e 22 20 2e 20 24 | .=.$key...':.'...$val..."\n"...$ |
22c0 | 74 65 78 74 5f 68 65 61 64 65 72 73 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 | text_headers;.............}.else |
22e0 | 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 65 78 74 5f 68 65 61 64 65 72 73 | .{.................$text_headers |
2300 | 20 2e 3d 20 24 6b 65 79 20 2e 20 27 3a 20 27 20 2e 20 24 76 61 6c 20 2e 20 22 5c 6e 22 3b 0a 20 | ..=.$key...':.'...$val..."\n";.. |
2320 | 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 | ...........}.........}.......... |
2340 | 72 65 74 75 72 6e 20 61 72 72 61 79 28 24 66 72 6f 6d 2c 20 24 74 65 78 74 5f 68 65 61 64 65 72 | return.array($from,.$text_header |
2360 | 73 29 3b 0a 20 20 20 20 7d 0a 0a 20 20 20 20 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 61 6b 65 20 61 | s);.....}....../**......*.Take.a |
2380 | 20 73 65 74 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 20 61 6e 64 20 70 61 72 73 65 20 74 68 65 | .set.of.recipients.and.parse.the |
23a0 | 6d 2c 20 72 65 74 75 72 6e 69 6e 67 20 61 6e 20 61 72 72 61 79 20 6f 66 0a 20 20 20 20 20 2a 20 | m,.returning.an.array.of......*. |
23c0 | 62 61 72 65 20 61 64 64 72 65 73 73 65 73 20 28 66 6f 72 77 61 72 64 20 70 61 74 68 73 29 20 74 | bare.addresses.(forward.paths).t |
23e0 | 68 61 74 20 63 61 6e 20 62 65 20 70 61 73 73 65 64 20 74 6f 20 73 65 6e 64 6d 61 69 6c 0a 20 20 | hat.can.be.passed.to.sendmail... |
2400 | 20 20 20 2a 20 6f 72 20 61 6e 20 73 6d 74 70 20 73 65 72 76 65 72 20 77 69 74 68 20 74 68 65 20 | ...*.or.an.smtp.server.with.the. |
2420 | 72 63 70 74 20 74 6f 3a 20 63 6f 6d 6d 61 6e 64 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 | rcpt.to:.command.......*......*. |
2440 | 40 70 61 72 61 6d 20 6d 69 78 65 64 20 45 69 74 68 65 72 20 61 20 63 6f 6d 6d 61 2d 73 65 70 65 | @param.mixed.Either.a.comma-sepe |
2460 | 72 61 74 65 64 20 6c 69 73 74 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 0a 20 20 20 20 20 2a 20 | rated.list.of.recipients......*. |
2480 | 20 20 20 20 20 20 20 20 20 20 20 20 20 28 52 46 43 38 32 32 20 63 6f 6d 70 6c 69 61 6e 74 29 2c | .............(RFC822.compliant), |
24a0 | 20 6f 72 20 61 6e 20 61 72 72 61 79 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 2c 0a 20 20 20 20 | .or.an.array.of.recipients,..... |
24c0 | 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 61 63 68 20 52 46 43 38 32 32 20 76 61 6c 69 | .*..............each.RFC822.vali |
24e0 | 64 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 61 72 72 61 79 20 41 | d.......*......*.@return.array.A |
2500 | 6e 20 61 72 72 61 79 20 6f 66 20 66 6f 72 77 61 72 64 20 70 61 74 68 73 20 28 62 61 72 65 20 61 | n.array.of.forward.paths.(bare.a |
2520 | 64 64 72 65 73 73 65 73 29 2e 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 | ddresses).......*.@access.privat |
2540 | 65 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 70 61 72 73 65 52 65 63 69 | e......*/.....function.parseReci |
2560 | 70 69 65 6e 74 73 28 24 72 65 63 69 70 69 65 6e 74 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 | pients($recipients).....{....... |
2580 | 20 20 69 6e 63 6c 75 64 65 5f 6f 6e 63 65 20 27 4d 61 69 6c 2f 52 46 43 38 32 32 2e 70 68 70 27 | ..include_once.'Mail/RFC822.php' |
25a0 | 3b 0a 0a 20 20 20 20 20 20 20 20 2f 2f 20 69 66 20 77 65 27 72 65 20 70 61 73 73 65 64 20 61 6e | ;..........//.if.we're.passed.an |
25c0 | 20 61 72 72 61 79 2c 20 61 73 73 75 6d 65 20 61 64 64 72 65 73 73 65 73 20 61 72 65 20 76 61 6c | .array,.assume.addresses.are.val |
25e0 | 69 64 20 61 6e 64 0a 20 20 20 20 20 20 20 20 2f 2f 20 69 6d 70 6c 6f 64 65 20 74 68 65 6d 20 62 | id.and.........//.implode.them.b |
2600 | 65 66 6f 72 65 20 70 61 72 73 69 6e 67 2e 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 61 72 | efore.parsing..........if.(is_ar |
2620 | 72 61 79 28 24 72 65 63 69 70 69 65 6e 74 73 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ray($recipients)).{............. |
2640 | 24 72 65 63 69 70 69 65 6e 74 73 20 3d 20 69 6d 70 6c 6f 64 65 28 27 2c 20 27 2c 20 24 72 65 63 | $recipients.=.implode(',.',.$rec |
2660 | 69 70 69 65 6e 74 73 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 2f 2f 20 | ipients);.........}..........//. |
2680 | 50 61 72 73 65 20 72 65 63 69 70 69 65 6e 74 73 2c 20 6c 65 61 76 69 6e 67 20 6f 75 74 20 61 6c | Parse.recipients,.leaving.out.al |
26a0 | 6c 20 70 65 72 73 6f 6e 61 6c 20 69 6e 66 6f 2e 20 54 68 69 73 20 69 73 0a 20 20 20 20 20 20 20 | l.personal.info..This.is........ |
26c0 | 20 2f 2f 20 66 6f 72 20 73 6d 74 70 20 72 65 63 69 70 69 65 6e 74 73 2c 20 65 74 63 2e 20 41 6c | .//.for.smtp.recipients,.etc..Al |
26e0 | 6c 20 72 65 6c 65 76 61 6e 74 20 70 65 72 73 6f 6e 61 6c 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 0a | l.relevant.personal.information. |
2700 | 20 20 20 20 20 20 20 20 2f 2f 20 73 68 6f 75 6c 64 20 61 6c 72 65 61 64 79 20 62 65 20 69 6e 20 | ........//.should.already.be.in. |
2720 | 74 68 65 20 68 65 61 64 65 72 73 2e 0a 20 20 20 20 20 20 20 20 24 61 64 64 72 65 73 73 65 73 20 | the.headers..........$addresses. |
2740 | 3d 20 4d 61 69 6c 5f 52 46 43 38 32 32 3a 3a 70 61 72 73 65 41 64 64 72 65 73 73 4c 69 73 74 28 | =.Mail_RFC822::parseAddressList( |
2760 | 24 72 65 63 69 70 69 65 6e 74 73 2c 20 27 6c 6f 63 61 6c 68 6f 73 74 27 2c 20 66 61 6c 73 65 29 | $recipients,.'localhost',.false) |
2780 | 3b 0a 20 20 20 20 20 20 20 20 24 72 65 63 69 70 69 65 6e 74 73 20 3d 20 61 72 72 61 79 28 29 3b | ;.........$recipients.=.array(); |
27a0 | 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 61 72 72 61 79 28 24 61 64 64 72 65 73 73 65 73 | .........if.(is_array($addresses |
27c0 | 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 28 24 61 64 64 72 65 | )).{.............foreach.($addre |
27e0 | 73 73 65 73 20 61 73 20 24 6f 62 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 | sses.as.$ob).{.................$ |
2800 | 72 65 63 69 70 69 65 6e 74 73 5b 5d 20 3d 20 24 6f 62 2d 3e 6d 61 69 6c 62 6f 78 20 2e 20 27 40 | recipients[].=.$ob->mailbox...'@ |
2820 | 27 20 2e 20 24 6f 62 2d 3e 68 6f 73 74 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0a 20 20 20 | '...$ob->host;.............}.... |
2840 | 20 20 20 20 20 7d 0a 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 63 69 70 69 65 6e | .....}..........return.$recipien |
2860 | 74 73 3b 0a 20 20 20 20 7d 0a 0a 7d 0a 3f 3e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ts;.....}..}.?>................. |
2880 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
28a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
28c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
28e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2900 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2920 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2960 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
29a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
29c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
29e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2a00 | 4d 61 69 6c 2d 31 2e 30 2e 31 2f 4d 61 69 6c 2f 6d 61 69 6c 2e 70 68 70 00 00 00 00 00 00 00 00 | Mail-1.0.1/Mail/mail.php........ |
2a20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2a40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2a60 | 00 00 00 00 31 30 30 36 36 34 20 00 20 20 20 20 20 30 20 00 20 20 20 37 36 37 20 00 20 20 20 20 | ....100664.......0.....767...... |
2a80 | 20 20 20 36 32 32 33 20 20 37 35 31 36 34 36 32 32 36 35 20 20 31 30 30 32 36 20 00 00 00 00 00 | ...6223..7516462265..10026...... |
2aa0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2ac0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2ae0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2b00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2b20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2b40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2b60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2b80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2ba0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2bc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2be0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
2c00 | 3c 3f 70 68 70 0a 2f 2f 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | <?php.//.//.+------------------- |
2c20 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
2c40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 50 48 50 20 56 65 | -------------------+.//.|.PHP.Ve |
2c60 | 72 73 69 6f 6e 20 34 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | rsion.4......................... |
2c80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c | ...............................| |
2ca0 | 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | .//.+--------------------------- |
2cc0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
2ce0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 | -----------+.//.|.Copyright.(c). |
2d00 | 31 39 39 37 2d 32 30 30 32 20 54 68 65 20 50 48 50 20 47 72 6f 75 70 20 20 20 20 20 20 20 20 20 | 1997-2002.The.PHP.Group......... |
2d20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | .......................|.//.+--- |
2d40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
2d60 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
2d80 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 54 68 69 73 20 73 6f 75 72 63 65 20 66 69 6c 65 20 69 73 20 73 75 | ---+.//.|.This.source.file.is.su |
2da0 | 62 6a 65 63 74 20 74 6f 20 76 65 72 73 69 6f 6e 20 32 2e 30 32 20 6f 66 20 74 68 65 20 50 48 50 | bject.to.version.2.02.of.the.PHP |
2dc0 | 20 6c 69 63 65 6e 73 65 2c 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 74 68 61 74 20 69 73 20 62 75 | .license,......|.//.|.that.is.bu |
2de0 | 6e 64 6c 65 64 20 77 69 74 68 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 69 6e 20 74 68 65 20 66 | ndled.with.this.package.in.the.f |
2e00 | 69 6c 65 20 4c 49 43 45 4e 53 45 2c 20 61 6e 64 20 69 73 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 | ile.LICENSE,.and.is........|.//. |
2e20 | 7c 20 61 76 61 69 6c 61 62 6c 65 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c 64 2d 77 69 | |.available.through.the.world-wi |
2e40 | 64 65 2d 77 65 62 20 61 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 75 72 6c 3a 20 20 20 20 | de-web.at.the.following.url:.... |
2e60 | 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 68 74 74 70 3a 2f 2f 77 77 77 2e 70 68 70 2e 6e 65 74 | .......|.//.|.http://www.php.net |
2e80 | 2f 6c 69 63 65 6e 73 65 2f 32 5f 30 32 2e 74 78 74 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | /license/2_02.txt............... |
2ea0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 49 66 20 79 6f 75 | ...................|.//.|.If.you |
2ec0 | 20 64 69 64 20 6e 6f 74 20 72 65 63 65 69 76 65 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 50 | .did.not.receive.a.copy.of.the.P |
2ee0 | 48 50 20 6c 69 63 65 6e 73 65 20 61 6e 64 20 61 72 65 20 75 6e 61 62 6c 65 20 74 6f 20 20 20 7c | HP.license.and.are.unable.to...| |
2f00 | 0a 2f 2f 20 7c 20 6f 62 74 61 69 6e 20 69 74 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c | .//.|.obtain.it.through.the.worl |
2f20 | 64 2d 77 69 64 65 2d 77 65 62 2c 20 70 6c 65 61 73 65 20 73 65 6e 64 20 61 20 6e 6f 74 65 20 74 | d-wide-web,.please.send.a.note.t |
2f40 | 6f 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 6c 69 63 65 6e 73 65 40 70 68 70 2e 6e 65 | o..........|.//.|.license@php.ne |
2f60 | 74 20 73 6f 20 77 65 20 63 61 6e 20 6d 61 69 6c 20 79 6f 75 20 61 20 63 6f 70 79 20 69 6d 6d 65 | t.so.we.can.mail.you.a.copy.imme |
2f80 | 64 69 61 74 65 6c 79 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | diately................|.//.+--- |
2fa0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
2fc0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
2fe0 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 41 75 74 68 6f 72 3a 20 43 68 75 63 6b 20 48 61 67 65 6e 62 75 63 | ---+.//.|.Author:.Chuck.Hagenbuc |
3000 | 68 20 3c 63 68 75 63 6b 40 68 6f 72 64 65 2e 6f 72 67 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 | h.<chuck@horde.org>............. |
3020 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | ...............|.//.+----------- |
3040 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
3060 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 0a | ---------------------------+.//. |
3080 | 2f 2f 20 24 49 64 3a 20 6d 61 69 6c 2e 70 68 70 2c 76 20 31 2e 31 20 32 30 30 32 2f 30 37 2f 32 | //.$Id:.mail.php,v.1.1.2002/07/2 |
30a0 | 31 20 30 37 3a 33 37 3a 32 35 20 73 73 62 20 45 78 70 20 24 0a 0a 72 65 71 75 69 72 65 5f 6f 6e | 1.07:37:25.ssb.Exp.$..require_on |
30c0 | 63 65 20 28 27 4d 61 69 6c 2e 70 68 70 27 29 3b 0a 0a 2f 2a 2a 0a 20 2a 20 69 6e 74 65 72 6e 61 | ce.('Mail.php');../**..*.interna |
30e0 | 6c 20 50 48 50 2d 6d 61 69 6c 28 29 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 | l.PHP-mail().implementation.of.t |
3100 | 68 65 20 50 45 41 52 20 4d 61 69 6c 3a 3a 20 69 6e 74 65 72 66 61 63 65 2e 0a 20 2a 20 40 61 63 | he.PEAR.Mail::.interface...*.@ac |
3120 | 63 65 73 73 20 70 75 62 6c 69 63 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 4d 61 69 6c 0a 20 2a 20 | cess.public..*.@package.Mail..*. |
3140 | 40 76 65 72 73 69 6f 6e 20 24 52 65 76 69 73 69 6f 6e 3a 20 31 2e 31 20 24 0a 20 2a 2f 0a 20 0a | @version.$Revision:.1.1.$..*/... |
3160 | 20 63 6c 61 73 73 20 4d 61 69 6c 5f 6d 61 69 6c 20 65 78 74 65 6e 64 73 20 4d 61 69 6c 20 7b 0a | .class.Mail_mail.extends.Mail.{. |
3180 | 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 49 6d 70 6c 65 6d 65 6e 74 73 20 4d 61 69 6c 5f 6d 61 69 6c | ./**......*.Implements.Mail_mail |
31a0 | 3a 3a 73 65 6e 64 28 29 20 66 75 6e 63 74 69 6f 6e 20 75 73 69 6e 67 20 70 68 70 27 73 20 62 75 | ::send().function.using.php's.bu |
31c0 | 69 6c 74 2d 69 6e 20 6d 61 69 6c 28 29 0a 20 20 20 20 20 2a 20 63 6f 6d 6d 61 6e 64 2e 0a 20 20 | ilt-in.mail()......*.command.... |
31e0 | 20 20 20 2a 20 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 6d 69 78 65 64 20 24 72 65 63 69 70 | ...*.......*.@param.mixed.$recip |
3200 | 69 65 6e 74 73 20 45 69 74 68 65 72 20 61 20 63 6f 6d 6d 61 2d 73 65 70 65 72 61 74 65 64 20 6c | ients.Either.a.comma-seperated.l |
3220 | 69 73 74 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 | ist.of.recipients......*........ |
3240 | 20 20 20 20 20 20 28 52 46 43 38 32 32 20 63 6f 6d 70 6c 69 61 6e 74 29 2c 20 6f 72 20 61 6e 20 | ......(RFC822.compliant),.or.an. |
3260 | 61 72 72 61 79 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 2c 0a 20 20 20 20 20 2a 20 20 20 20 20 | array.of.recipients,......*..... |
3280 | 20 20 20 20 20 20 20 20 20 65 61 63 68 20 52 46 43 38 32 32 20 76 61 6c 69 64 2e 20 54 68 69 73 | .........each.RFC822.valid..This |
32a0 | 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 72 65 63 69 70 69 65 6e 74 73 20 6e 6f 74 0a 20 20 20 20 | .may.contain.recipients.not..... |
32c0 | 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 65 63 69 66 69 65 64 20 69 6e 20 74 68 65 | .*..............specified.in.the |
32e0 | 20 68 65 61 64 65 72 73 2c 20 66 6f 72 20 42 63 63 3a 2c 20 72 65 73 65 6e 64 69 6e 67 0a 20 20 | .headers,.for.Bcc:,.resending... |
3300 | 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 65 73 73 61 67 65 73 2c 20 65 74 63 2e | ...*..............messages,.etc. |
3320 | 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 61 72 72 61 79 20 24 68 65 61 | ......*......*.@param.array.$hea |
3340 | 64 65 72 73 20 54 68 65 20 61 72 72 61 79 20 6f 66 20 68 65 61 64 65 72 73 20 74 6f 20 73 65 6e | ders.The.array.of.headers.to.sen |
3360 | 64 20 77 69 74 68 20 74 68 65 20 6d 61 69 6c 2c 20 69 6e 20 61 6e 0a 20 20 20 20 20 2a 20 20 20 | d.with.the.mail,.in.an......*... |
3380 | 20 20 20 20 20 20 20 20 20 20 20 61 73 73 6f 63 69 61 74 69 76 65 20 61 72 72 61 79 2c 20 77 68 | ...........associative.array,.wh |
33a0 | 65 72 65 20 74 68 65 20 61 72 72 61 79 20 6b 65 79 20 69 73 20 74 68 65 0a 20 20 20 20 20 2a 20 | ere.the.array.key.is.the......*. |
33c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 68 65 61 64 65 72 20 6e 61 6d 65 20 28 69 65 2c 20 27 53 | .............header.name.(ie,.'S |
33e0 | 75 62 6a 65 63 74 27 29 2c 20 61 6e 64 20 74 68 65 20 61 72 72 61 79 20 76 61 6c 75 65 0a 20 20 | ubject'),.and.the.array.value... |
3400 | 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 20 74 68 65 20 68 65 61 64 65 72 20 | ...*..............is.the.header. |
3420 | 76 61 6c 75 65 20 28 69 65 2c 20 27 74 65 73 74 27 29 2e 20 54 68 65 20 68 65 61 64 65 72 0a 20 | value.(ie,.'test')..The.header.. |
3440 | 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f 64 75 63 65 64 20 66 72 6f 6d | ....*..............produced.from |
3460 | 20 74 68 6f 73 65 20 76 61 6c 75 65 73 20 77 6f 75 6c 64 20 62 65 20 27 53 75 62 6a 65 63 74 3a | .those.values.would.be.'Subject: |
3480 | 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 65 73 74 27 2e 0a 20 20 20 20 | ......*..............test'...... |
34a0 | 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 62 6f 64 79 20 54 68 | .*......*.@param.string.$body.Th |
34c0 | 65 20 66 75 6c 6c 20 74 65 78 74 20 6f 66 20 74 68 65 20 6d 65 73 73 61 67 65 20 62 6f 64 79 2c | e.full.text.of.the.message.body, |
34e0 | 20 69 6e 63 6c 75 64 69 6e 67 20 61 6e 79 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 | .including.any......*........... |
3500 | 20 20 20 20 4d 69 6d 65 20 70 61 72 74 73 2c 20 65 74 63 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 | ....Mime.parts,.etc.......*..... |
3520 | 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 52 65 74 75 72 6e 73 20 74 72 75 65 20 6f 6e | .*.@return.mixed.Returns.true.on |
3540 | 20 73 75 63 63 65 73 73 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 72 6f 72 0a 20 20 20 20 20 2a | .success,.or.a.PEAR_Error......* |
3560 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 20 64 65 73 63 | ...............containing.a.desc |
3580 | 72 69 70 74 69 76 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20 6f 6e 0a 20 20 20 20 20 2a 20 | riptive.error.message.on......*. |
35a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 61 69 6c 75 72 65 2e 0a 20 20 20 20 20 2a 20 40 61 | ..............failure.......*.@a |
35c0 | 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 2f 09 0a 20 20 20 20 66 75 6e 63 74 69 | ccess.public......*/......functi |
35e0 | 6f 6e 20 73 65 6e 64 28 24 72 65 63 69 70 69 65 6e 74 73 2c 20 24 68 65 61 64 65 72 73 2c 20 24 | on.send($recipients,.$headers,.$ |
3600 | 62 6f 64 79 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 2f 2f 20 69 66 20 77 65 27 72 65 20 | body).....{.........//.if.we're. |
3620 | 70 61 73 73 65 64 20 61 6e 20 61 72 72 61 79 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 2c 20 69 | passed.an.array.of.recipients,.i |
3640 | 6d 70 6c 6f 64 65 20 69 74 2e 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 5f 61 72 72 61 79 28 | mplode.it..........if.(is_array( |
3660 | 24 72 65 63 69 70 69 65 6e 74 73 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 63 | $recipients)).{.............$rec |
3680 | 69 70 69 65 6e 74 73 20 3d 20 69 6d 70 6c 6f 64 65 28 27 2c 20 27 2c 20 24 72 65 63 69 70 69 65 | ipients.=.implode(',.',.$recipie |
36a0 | 6e 74 73 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 | nts);.........}................. |
36c0 | 20 2f 2f 20 67 65 74 20 74 68 65 20 53 75 62 6a 65 63 74 20 6f 75 74 20 6f 66 20 74 68 65 20 68 | .//.get.the.Subject.out.of.the.h |
36e0 | 65 61 64 65 72 73 20 61 72 72 61 79 20 73 6f 20 74 68 61 74 20 77 65 20 63 61 6e 0a 20 20 20 20 | eaders.array.so.that.we.can..... |
3700 | 20 20 20 20 2f 2f 20 70 61 73 73 20 69 74 20 61 73 20 61 20 73 65 70 65 72 61 74 65 20 61 72 67 | ....//.pass.it.as.a.seperate.arg |
3720 | 75 6d 65 6e 74 20 74 6f 20 6d 61 69 6c 28 29 2e 0a 20 20 20 20 20 20 20 20 24 73 75 62 6a 65 63 | ument.to.mail()..........$subjec |
3740 | 74 20 3d 20 27 27 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 68 65 61 64 65 | t.=.'';.........if.(isset($heade |
3760 | 72 73 5b 27 53 75 62 6a 65 63 74 27 5d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 73 | rs['Subject'])).{.............$s |
3780 | 75 62 6a 65 63 74 20 3d 20 24 68 65 61 64 65 72 73 5b 27 53 75 62 6a 65 63 74 27 5d 3b 0a 20 20 | ubject.=.$headers['Subject'];... |
37a0 | 20 20 20 20 20 20 20 20 20 20 75 6e 73 65 74 28 24 68 65 61 64 65 72 73 5b 27 53 75 62 6a 65 63 | ..........unset($headers['Subjec |
37c0 | 74 27 5d 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 | t']);.........}................. |
37e0 | 20 2f 2f 20 66 6c 61 74 74 65 6e 20 74 68 65 20 68 65 61 64 65 72 73 20 6f 75 74 2e 0a 20 20 20 | .//.flatten.the.headers.out..... |
3800 | 20 20 20 20 20 6c 69 73 74 28 2c 24 74 65 78 74 5f 68 65 61 64 65 72 73 29 20 3d 20 4d 61 69 6c | .....list(,$text_headers).=.Mail |
3820 | 3a 3a 70 72 65 70 61 72 65 48 65 61 64 65 72 73 28 24 68 65 61 64 65 72 73 29 3b 0a 20 20 20 20 | ::prepareHeaders($headers);..... |
3840 | 20 20 20 20 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6d 61 69 6c 28 24 72 65 63 69 70 69 | .............return.mail($recipi |
3860 | 65 6e 74 73 2c 20 24 73 75 62 6a 65 63 74 2c 20 24 62 6f 64 79 2c 20 24 74 65 78 74 5f 68 65 61 | ents,.$subject,.$body,.$text_hea |
3880 | 64 65 72 73 29 3b 0a 20 20 20 20 7d 0a 20 20 20 20 0a 7d 00 00 00 00 00 00 00 00 00 00 00 00 00 | ders);.....}......}............. |
38a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
38c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
38e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3900 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3920 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3960 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
39a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
39c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
39e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3a00 | 4d 61 69 6c 2d 31 2e 30 2e 31 2f 4d 61 69 6c 2f 73 65 6e 64 6d 61 69 6c 2e 70 68 70 00 00 00 00 | Mail-1.0.1/Mail/sendmail.php.... |
3a20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3a40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3a60 | 00 00 00 00 31 30 30 36 36 34 20 00 20 20 20 20 20 30 20 00 20 20 20 37 36 37 20 00 20 20 20 20 | ....100664.......0.....767...... |
3a80 | 20 20 31 31 37 35 36 20 20 37 35 31 36 34 36 32 32 36 35 20 20 31 30 37 32 37 20 00 00 00 00 00 | ..11756..7516462265..10727...... |
3aa0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3ac0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3ae0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3b00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3b20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3b40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3b60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3b80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3ba0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3bc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3be0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
3c00 | 3c 3f 70 68 70 0a 2f 2f 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | <?php.//.//.+------------------- |
3c20 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
3c40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 50 48 50 20 56 65 | -------------------+.//.|.PHP.Ve |
3c60 | 72 73 69 6f 6e 20 34 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | rsion.4......................... |
3c80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c | ...............................| |
3ca0 | 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | .//.+--------------------------- |
3cc0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
3ce0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 | -----------+.//.|.Copyright.(c). |
3d00 | 31 39 39 37 2d 32 30 30 32 20 54 68 65 20 50 48 50 20 47 72 6f 75 70 20 20 20 20 20 20 20 20 20 | 1997-2002.The.PHP.Group......... |
3d20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | .......................|.//.+--- |
3d40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
3d60 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
3d80 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 54 68 69 73 20 73 6f 75 72 63 65 20 66 69 6c 65 20 69 73 20 73 75 | ---+.//.|.This.source.file.is.su |
3da0 | 62 6a 65 63 74 20 74 6f 20 76 65 72 73 69 6f 6e 20 32 2e 30 32 20 6f 66 20 74 68 65 20 50 48 50 | bject.to.version.2.02.of.the.PHP |
3dc0 | 20 6c 69 63 65 6e 73 65 2c 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 74 68 61 74 20 69 73 20 62 75 | .license,......|.//.|.that.is.bu |
3de0 | 6e 64 6c 65 64 20 77 69 74 68 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 69 6e 20 74 68 65 20 66 | ndled.with.this.package.in.the.f |
3e00 | 69 6c 65 20 4c 49 43 45 4e 53 45 2c 20 61 6e 64 20 69 73 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 | ile.LICENSE,.and.is........|.//. |
3e20 | 7c 20 61 76 61 69 6c 61 62 6c 65 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c 64 2d 77 69 | |.available.through.the.world-wi |
3e40 | 64 65 2d 77 65 62 20 61 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 75 72 6c 3a 20 20 20 20 | de-web.at.the.following.url:.... |
3e60 | 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 68 74 74 70 3a 2f 2f 77 77 77 2e 70 68 70 2e 6e 65 74 | .......|.//.|.http://www.php.net |
3e80 | 2f 6c 69 63 65 6e 73 65 2f 32 5f 30 32 2e 74 78 74 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | /license/2_02.txt............... |
3ea0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 49 66 20 79 6f 75 | ...................|.//.|.If.you |
3ec0 | 20 64 69 64 20 6e 6f 74 20 72 65 63 65 69 76 65 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 50 | .did.not.receive.a.copy.of.the.P |
3ee0 | 48 50 20 6c 69 63 65 6e 73 65 20 61 6e 64 20 61 72 65 20 75 6e 61 62 6c 65 20 74 6f 20 20 20 7c | HP.license.and.are.unable.to...| |
3f00 | 0a 2f 2f 20 7c 20 6f 62 74 61 69 6e 20 69 74 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c | .//.|.obtain.it.through.the.worl |
3f20 | 64 2d 77 69 64 65 2d 77 65 62 2c 20 70 6c 65 61 73 65 20 73 65 6e 64 20 61 20 6e 6f 74 65 20 74 | d-wide-web,.please.send.a.note.t |
3f40 | 6f 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 6c 69 63 65 6e 73 65 40 70 68 70 2e 6e 65 | o..........|.//.|.license@php.ne |
3f60 | 74 20 73 6f 20 77 65 20 63 61 6e 20 6d 61 69 6c 20 79 6f 75 20 61 20 63 6f 70 79 20 69 6d 6d 65 | t.so.we.can.mail.you.a.copy.imme |
3f80 | 64 69 61 74 65 6c 79 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | diately................|.//.+--- |
3fa0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
3fc0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
3fe0 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 41 75 74 68 6f 72 3a 20 43 68 75 63 6b 20 48 61 67 65 6e 62 75 63 | ---+.//.|.Author:.Chuck.Hagenbuc |
4000 | 68 20 3c 63 68 75 63 6b 40 68 6f 72 64 65 2e 6f 72 67 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 | h.<chuck@horde.org>............. |
4020 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | ...............|.//.+----------- |
4040 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
4060 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 0a 72 65 | ---------------------------+..re |
4080 | 71 75 69 72 65 5f 6f 6e 63 65 20 27 4d 61 69 6c 2e 70 68 70 27 3b 0a 0a 2f 2a 2a 0a 20 2a 20 53 | quire_once.'Mail.php';../**..*.S |
40a0 | 65 6e 64 6d 61 69 6c 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 50 45 | endmail.implementation.of.the.PE |
40c0 | 41 52 20 4d 61 69 6c 3a 3a 20 69 6e 74 65 72 66 61 63 65 2e 0a 20 2a 20 40 61 63 63 65 73 73 20 | AR.Mail::.interface...*.@access. |
40e0 | 70 75 62 6c 69 63 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 4d 61 69 6c 0a 20 2a 20 40 76 65 72 73 | public..*.@package.Mail..*.@vers |
4100 | 69 6f 6e 20 24 52 65 76 69 73 69 6f 6e 3a 20 31 2e 31 20 24 0a 20 2a 2f 0a 63 6c 61 73 73 20 4d | ion.$Revision:.1.1.$..*/.class.M |
4120 | 61 69 6c 5f 73 65 6e 64 6d 61 69 6c 20 65 78 74 65 6e 64 73 20 4d 61 69 6c 20 7b 0a 20 20 20 20 | ail_sendmail.extends.Mail.{..... |
4140 | 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 68 65 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 | ../**......*.The.location.of.the |
4160 | 20 73 65 6e 64 6d 61 69 6c 20 6f 72 20 73 65 6e 64 6d 61 69 6c 20 77 72 61 70 70 65 72 20 62 69 | .sendmail.or.sendmail.wrapper.bi |
4180 | 6e 61 72 79 20 6f 6e 20 74 68 65 0a 20 20 20 20 20 2a 20 66 69 6c 65 73 79 73 74 65 6d 2e 0a 20 | nary.on.the......*.filesystem... |
41a0 | 20 20 20 20 2a 20 40 76 61 72 20 73 74 72 69 6e 67 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 76 61 | ....*.@var.string......*/.....va |
41c0 | 72 20 24 73 65 6e 64 6d 61 69 6c 5f 70 61 74 68 20 3d 20 27 2f 75 73 72 2f 73 62 69 6e 2f 73 65 | r.$sendmail_path.=.'/usr/sbin/se |
41e0 | 6e 64 6d 61 69 6c 27 3b 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 41 6e 79 20 65 78 | ndmail';......./**......*.Any.ex |
4200 | 74 72 61 20 63 6f 6d 6d 61 6e 64 2d 6c 69 6e 65 20 70 61 72 61 6d 65 74 65 72 73 20 74 6f 20 70 | tra.command-line.parameters.to.p |
4220 | 61 73 73 20 74 6f 20 74 68 65 20 73 65 6e 64 6d 61 69 6c 20 6f 72 0a 20 20 20 20 20 2a 20 73 65 | ass.to.the.sendmail.or......*.se |
4240 | 6e 64 6d 61 69 6c 20 77 72 61 70 70 65 72 20 62 69 6e 61 72 79 2e 0a 20 20 20 20 20 2a 20 40 76 | ndmail.wrapper.binary.......*.@v |
4260 | 61 72 20 73 74 72 69 6e 67 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 73 65 6e 64 6d | ar.string......*/.....var.$sendm |
4280 | 61 69 6c 5f 61 72 67 73 20 3d 20 27 27 3b 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 | ail_args.=.'';......./**......*. |
42a0 | 43 6f 6e 73 74 72 75 63 74 6f 72 2e 0a 20 20 20 20 20 2a 20 0a 20 20 20 20 20 2a 20 49 6e 73 74 | Constructor.......*.......*.Inst |
42c0 | 61 6e 74 69 61 74 65 73 20 61 20 6e 65 77 20 4d 61 69 6c 5f 73 65 6e 64 6d 61 69 6c 3a 3a 20 6f | antiates.a.new.Mail_sendmail::.o |
42e0 | 62 6a 65 63 74 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 70 61 72 61 6d 65 74 65 72 73 0a 20 20 | bject.based.on.the.parameters... |
4300 | 20 20 20 2a 20 70 61 73 73 65 64 20 69 6e 2e 20 49 74 20 6c 6f 6f 6b 73 20 66 6f 72 20 74 68 65 | ...*.passed.in..It.looks.for.the |
4320 | 20 66 6f 6c 6c 6f 77 69 6e 67 20 70 61 72 61 6d 65 74 65 72 73 3a 0a 20 20 20 20 20 2a 20 20 20 | .following.parameters:......*... |
4340 | 20 20 73 65 6e 64 6d 61 69 6c 5f 70 61 74 68 20 20 20 20 54 68 65 20 6c 6f 63 61 74 69 6f 6e 20 | ..sendmail_path....The.location. |
4360 | 6f 66 20 74 68 65 20 73 65 6e 64 6d 61 69 6c 20 62 69 6e 61 72 79 20 6f 6e 20 74 68 65 0a 20 20 | of.the.sendmail.binary.on.the... |
4380 | 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 69 6c 65 73 79 | ...*......................filesy |
43a0 | 73 74 65 6d 2e 20 44 65 66 61 75 6c 74 73 20 74 6f 20 27 2f 75 73 72 2f 73 62 69 6e 2f 73 65 6e | stem..Defaults.to.'/usr/sbin/sen |
43c0 | 64 6d 61 69 6c 27 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 20 20 20 20 73 65 6e 64 6d 61 | dmail'.......*......*.....sendma |
43e0 | 69 6c 5f 61 72 67 73 20 20 20 20 41 6e 79 20 65 78 74 72 61 20 70 61 72 61 6d 65 74 65 72 73 20 | il_args....Any.extra.parameters. |
4400 | 74 6f 20 70 61 73 73 20 74 6f 20 74 68 65 20 73 65 6e 64 6d 61 69 6c 0a 20 20 20 20 20 2a 20 20 | to.pass.to.the.sendmail......*.. |
4420 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6f 72 20 73 65 6e 64 6d 61 69 6c 20 | ....................or.sendmail. |
4440 | 77 72 61 70 70 65 72 20 62 69 6e 61 72 79 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 49 66 | wrapper.binary.......*......*.If |
4460 | 20 61 20 70 61 72 61 6d 65 74 65 72 20 69 73 20 70 72 65 73 65 6e 74 20 69 6e 20 74 68 65 20 24 | .a.parameter.is.present.in.the.$ |
4480 | 70 61 72 61 6d 73 20 61 72 72 61 79 2c 20 69 74 20 72 65 70 6c 61 63 65 73 20 74 68 65 0a 20 20 | params.array,.it.replaces.the... |
44a0 | 20 20 20 2a 20 64 65 66 61 75 6c 74 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 | ...*.default.......*......*.@par |
44c0 | 61 6d 20 61 72 72 61 79 20 24 70 61 72 61 6d 73 20 48 61 73 68 20 63 6f 6e 74 61 69 6e 69 6e 67 | am.array.$params.Hash.containing |
44e0 | 20 61 6e 79 20 70 61 72 61 6d 65 74 65 72 73 20 64 69 66 66 65 72 65 6e 74 20 66 72 6f 6d 20 74 | .any.parameters.different.from.t |
4500 | 68 65 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 73 2e | he......*..............defaults. |
4520 | 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 2f 09 0a | ......*.@access.public......*/.. |
4540 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 4d 61 69 6c 5f 73 65 6e 64 6d 61 69 6c 28 24 70 61 72 61 | ....function.Mail_sendmail($para |
4560 | 6d 73 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 70 61 72 | ms).....{.........if.(isset($par |
4580 | 61 6d 73 5b 27 73 65 6e 64 6d 61 69 6c 5f 70 61 74 68 27 5d 29 29 20 24 74 68 69 73 2d 3e 73 65 | ams['sendmail_path'])).$this->se |
45a0 | 6e 64 6d 61 69 6c 5f 70 61 74 68 20 3d 20 24 70 61 72 61 6d 73 5b 27 73 65 6e 64 6d 61 69 6c 5f | ndmail_path.=.$params['sendmail_ |
45c0 | 70 61 74 68 27 5d 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 70 61 72 61 6d | path'];.........if.(isset($param |
45e0 | 73 5b 27 73 65 6e 64 6d 61 69 6c 5f 61 72 67 73 27 5d 29 29 20 24 74 68 69 73 2d 3e 73 65 6e 64 | s['sendmail_args'])).$this->send |
4600 | 6d 61 69 6c 5f 61 72 67 73 20 3d 20 24 70 61 72 61 6d 73 5b 27 73 65 6e 64 6d 61 69 6c 5f 61 72 | mail_args.=.$params['sendmail_ar |
4620 | 67 73 27 5d 3b 0a 20 20 20 20 7d 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 49 6d 70 | gs'];.....}......./**......*.Imp |
4640 | 6c 65 6d 65 6e 74 73 20 4d 61 69 6c 3a 3a 73 65 6e 64 28 29 20 66 75 6e 63 74 69 6f 6e 20 75 73 | lements.Mail::send().function.us |
4660 | 69 6e 67 20 74 68 65 20 73 65 6e 64 6d 61 69 6c 0a 20 20 20 20 20 2a 20 63 6f 6d 6d 61 6e 64 2d | ing.the.sendmail......*.command- |
4680 | 6c 69 6e 65 20 62 69 6e 61 72 79 2e 0a 20 20 20 20 20 2a 20 0a 20 20 20 20 20 2a 20 40 70 61 72 | line.binary.......*.......*.@par |
46a0 | 61 6d 20 6d 69 78 65 64 20 24 72 65 63 69 70 69 65 6e 74 73 20 45 69 74 68 65 72 20 61 20 63 6f | am.mixed.$recipients.Either.a.co |
46c0 | 6d 6d 61 2d 73 65 70 65 72 61 74 65 64 20 6c 69 73 74 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 | mma-seperated.list.of.recipients |
46e0 | 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 52 46 43 38 32 32 20 63 6f 6d | ......*..............(RFC822.com |
4700 | 70 6c 69 61 6e 74 29 2c 20 6f 72 20 61 6e 20 61 72 72 61 79 20 6f 66 20 72 65 63 69 70 69 65 6e | pliant),.or.an.array.of.recipien |
4720 | 74 73 2c 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 61 63 68 20 52 46 43 | ts,......*..............each.RFC |
4740 | 38 32 32 20 76 61 6c 69 64 2e 20 54 68 69 73 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 72 65 63 69 | 822.valid..This.may.contain.reci |
4760 | 70 69 65 6e 74 73 20 6e 6f 74 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 | pients.not......*..............s |
4780 | 70 65 63 69 66 69 65 64 20 69 6e 20 74 68 65 20 68 65 61 64 65 72 73 2c 20 66 6f 72 20 42 63 63 | pecified.in.the.headers,.for.Bcc |
47a0 | 3a 2c 20 72 65 73 65 6e 64 69 6e 67 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 | :,.resending......*............. |
47c0 | 20 6d 65 73 73 61 67 65 73 2c 20 65 74 63 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 | .messages,.etc.......*......*.@p |
47e0 | 61 72 61 6d 20 61 72 72 61 79 20 24 68 65 61 64 65 72 73 20 54 68 65 20 61 72 72 61 79 20 6f 66 | aram.array.$headers.The.array.of |
4800 | 20 68 65 61 64 65 72 73 20 74 6f 20 73 65 6e 64 20 77 69 74 68 20 74 68 65 20 6d 61 69 6c 2c 20 | .headers.to.send.with.the.mail,. |
4820 | 69 6e 20 61 6e 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 73 73 6f 63 69 | in.an......*..............associ |
4840 | 61 74 69 76 65 20 61 72 72 61 79 2c 20 77 68 65 72 65 20 74 68 65 20 61 72 72 61 79 20 6b 65 79 | ative.array,.where.the.array.key |
4860 | 20 69 73 20 74 68 65 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 65 61 64 | .is.the......*..............head |
4880 | 65 72 20 6e 61 6d 65 20 28 69 65 2c 20 27 53 75 62 6a 65 63 74 27 29 2c 20 61 6e 64 20 74 68 65 | er.name.(ie,.'Subject'),.and.the |
48a0 | 20 61 72 72 61 79 20 76 61 6c 75 65 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 | .array.value......*............. |
48c0 | 20 69 73 20 74 68 65 20 68 65 61 64 65 72 20 76 61 6c 75 65 20 28 69 65 2c 20 27 74 65 73 74 27 | .is.the.header.value.(ie,.'test' |
48e0 | 29 2e 20 54 68 65 20 68 65 61 64 65 72 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 | )..The.header......*............ |
4900 | 20 20 70 72 6f 64 75 63 65 64 20 66 72 6f 6d 20 74 68 6f 73 65 20 76 61 6c 75 65 73 20 77 6f 75 | ..produced.from.those.values.wou |
4920 | 6c 64 20 62 65 20 27 53 75 62 6a 65 63 74 3a 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 | ld.be.'Subject:......*.......... |
4940 | 20 20 20 20 74 65 73 74 27 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 | ....test'.......*......*.@param. |
4960 | 73 74 72 69 6e 67 20 24 62 6f 64 79 20 54 68 65 20 66 75 6c 6c 20 74 65 78 74 20 6f 66 20 74 68 | string.$body.The.full.text.of.th |
4980 | 65 20 6d 65 73 73 61 67 65 20 62 6f 64 79 2c 20 69 6e 63 6c 75 64 69 6e 67 20 61 6e 79 0a 20 20 | e.message.body,.including.any... |
49a0 | 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 69 6d 65 20 70 61 72 74 73 2c 20 65 | ...*...............Mime.parts,.e |
49c0 | 74 63 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 | tc.......*......*.@return.mixed. |
49e0 | 52 65 74 75 72 6e 73 20 74 72 75 65 20 6f 6e 20 73 75 63 63 65 73 73 2c 20 6f 72 20 61 20 50 45 | Returns.true.on.success,.or.a.PE |
4a00 | 41 52 5f 45 72 72 6f 72 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f | AR_Error......*...............co |
4a20 | 6e 74 61 69 6e 69 6e 67 20 61 20 64 65 73 63 72 69 70 74 69 76 65 20 65 72 72 6f 72 20 6d 65 73 | ntaining.a.descriptive.error.mes |
4a40 | 73 61 67 65 20 6f 6e 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 61 69 | sage.on......*...............fai |
4a60 | 6c 75 72 65 2e 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 | lure.......*.@access.public..... |
4a80 | 20 2a 2f 09 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 65 6e 64 28 24 72 65 63 69 70 69 65 6e | .*/......function.send($recipien |
4aa0 | 74 73 2c 20 24 68 65 61 64 65 72 73 2c 20 24 62 6f 64 79 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 | ts,.$headers,.$body).....{...... |
4ac0 | 20 20 20 24 72 65 63 69 70 69 65 6e 74 73 20 3d 20 65 73 63 61 70 65 53 68 65 6c 6c 43 6d 64 28 | ...$recipients.=.escapeShellCmd( |
4ae0 | 69 6d 70 6c 6f 64 65 28 27 20 27 2c 20 24 74 68 69 73 2d 3e 70 61 72 73 65 52 65 63 69 70 69 65 | implode('.',.$this->parseRecipie |
4b00 | 6e 74 73 28 24 72 65 63 69 70 69 65 6e 74 73 29 29 29 3b 0a 20 20 20 20 20 20 20 20 0a 20 20 20 | nts($recipients)));............. |
4b20 | 20 20 20 20 20 6c 69 73 74 28 24 66 72 6f 6d 2c 20 24 74 65 78 74 5f 68 65 61 64 65 72 73 29 20 | .....list($from,.$text_headers). |
4b40 | 3d 20 24 74 68 69 73 2d 3e 70 72 65 70 61 72 65 48 65 61 64 65 72 73 28 24 68 65 61 64 65 72 73 | =.$this->prepareHeaders($headers |
4b60 | 29 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 73 65 74 28 24 66 72 6f 6d 29 29 20 7b 0a | );.........if.(!isset($from)).{. |
4b80 | 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f | ............return.new.PEAR_Erro |
4ba0 | 72 28 27 4e 6f 20 66 72 6f 6d 20 61 64 64 72 65 73 73 20 67 69 76 65 6e 2e 27 29 3b 0a 20 20 20 | r('No.from.address.given.');.... |
4bc0 | 20 20 20 20 20 7d 20 65 6c 73 65 69 66 20 28 73 74 72 73 74 72 28 24 66 72 6f 6d 2c 20 27 20 27 | .....}.elseif.(strstr($from,.'.' |
4be0 | 29 20 7c 7c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 74 72 73 74 72 28 24 66 | ).||...................strstr($f |
4c00 | 72 6f 6d 2c 20 27 3b 27 29 20 7c 7c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 | rom,.';').||...................s |
4c20 | 74 72 73 74 72 28 24 66 72 6f 6d 2c 20 27 26 27 29 20 7c 7c 0a 20 20 20 20 20 20 20 20 20 20 20 | trstr($from,.'&').||............ |
4c40 | 20 20 20 20 20 20 20 73 74 72 73 74 72 28 24 66 72 6f 6d 2c 20 27 60 27 29 29 20 7b 0a 20 20 20 | .......strstr($from,.'`')).{.... |
4c60 | 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 | .........return.new.PEAR_Error(' |
4c80 | 46 72 6f 6d 20 61 64 64 72 65 73 73 20 73 70 65 63 69 66 69 65 64 20 77 69 74 68 20 64 61 6e 67 | From.address.specified.with.dang |
4ca0 | 65 72 6f 75 73 20 63 68 61 72 61 63 74 65 72 73 2e 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 | erous.characters.');.........}.. |
4cc0 | 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 30 3b 0a 20 20 20 | ................$result.=.0;.... |
4ce0 | 20 20 20 20 20 69 66 20 28 40 69 73 5f 65 78 65 63 75 74 61 62 6c 65 28 24 74 68 69 73 2d 3e 73 | .....if.(@is_executable($this->s |
4d00 | 65 6e 64 6d 61 69 6c 5f 70 61 74 68 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 66 72 | endmail_path)).{.............$fr |
4d20 | 6f 6d 20 3d 20 65 73 63 61 70 65 53 68 65 6c 6c 43 6d 64 28 24 66 72 6f 6d 29 3b 0a 20 20 20 20 | om.=.escapeShellCmd($from);..... |
4d40 | 20 20 20 20 20 20 20 20 24 6d 61 69 6c 20 3d 20 70 6f 70 65 6e 28 24 74 68 69 73 2d 3e 73 65 6e | ........$mail.=.popen($this->sen |
4d60 | 64 6d 61 69 6c 5f 70 61 74 68 20 2e 20 28 21 65 6d 70 74 79 28 24 74 68 69 73 2d 3e 73 65 6e 64 | dmail_path...(!empty($this->send |
4d80 | 6d 61 69 6c 5f 61 72 67 73 29 20 3f 20 27 20 27 20 2e 20 24 74 68 69 73 2d 3e 73 65 6e 64 6d 61 | mail_args).?.'.'...$this->sendma |
4da0 | 69 6c 5f 61 72 67 73 20 3a 20 27 27 29 20 2e 20 22 20 2d 66 24 66 72 6f 6d 20 2d 2d 20 24 72 65 | il_args.:.'')...".-f$from.--.$re |
4dc0 | 63 69 70 69 65 6e 74 73 22 2c 20 27 77 27 29 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 70 75 | cipients",.'w');.............fpu |
4de0 | 74 73 28 24 6d 61 69 6c 2c 20 24 74 65 78 74 5f 68 65 61 64 65 72 73 29 3b 0a 20 20 20 20 20 20 | ts($mail,.$text_headers);....... |
4e00 | 20 20 20 20 20 20 66 70 75 74 73 28 24 6d 61 69 6c 2c 20 22 5c 6e 22 29 3b 20 20 2f 2f 20 6e 65 | ......fputs($mail,."\n");..//.ne |
4e20 | 77 6c 69 6e 65 20 74 6f 20 65 6e 64 20 74 68 65 20 68 65 61 64 65 72 73 20 73 65 63 74 69 6f 6e | wline.to.end.the.headers.section |
4e40 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 70 75 74 73 28 24 6d 61 69 6c 2c 20 24 62 6f 64 79 29 | .............fputs($mail,.$body) |
4e60 | 3b 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 3d 20 70 63 6c 6f 73 65 28 24 | ;.............$result.=.pclose($ |
4e80 | 6d 61 69 6c 29 20 3e 3e 20 38 20 26 20 30 78 46 46 3b 20 2f 2f 20 6e 65 65 64 20 74 6f 20 73 68 | mail).>>.8.&.0xFF;.//.need.to.sh |
4ea0 | 69 66 74 20 74 68 65 20 70 63 6c 6f 73 65 20 72 65 73 75 6c 74 20 74 6f 20 67 65 74 20 74 68 65 | ift.the.pclose.result.to.get.the |
4ec0 | 20 65 78 69 74 20 63 6f 64 65 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0a 20 20 20 20 | .exit.code.........}.else.{..... |
4ee0 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 73 | ........return.new.PEAR_Error('s |
4f00 | 65 6e 64 6d 61 69 6c 20 5b 27 20 2e 20 24 74 68 69 73 2d 3e 73 65 6e 64 6d 61 69 6c 5f 70 61 74 | endmail.['...$this->sendmail_pat |
4f20 | 68 20 2e 20 27 5d 20 6e 6f 74 20 65 78 65 63 75 74 61 62 6c 65 27 29 3b 0a 20 20 20 20 20 20 20 | h...'].not.executable');........ |
4f40 | 20 7d 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 72 65 73 75 6c 74 20 | .}..................if.($result. |
4f60 | 21 3d 20 30 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 6e 65 77 20 50 | !=.0).{.............return.new.P |
4f80 | 45 41 52 5f 45 72 72 6f 72 28 27 73 65 6e 64 6d 61 69 6c 20 72 65 74 75 72 6e 65 64 20 65 72 72 | EAR_Error('sendmail.returned.err |
4fa0 | 6f 72 20 63 6f 64 65 20 27 20 2e 20 24 72 65 73 75 6c 74 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a | or.code.'...$result);.........}. |
4fc0 | 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 20 20 | .................return.true;... |
4fe0 | 20 20 7d 0a 20 20 20 20 0a 7d 0a 3f 3e 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ..}......}.?>................... |
5000 | 4d 61 69 6c 2d 31 2e 30 2e 31 2f 4d 61 69 6c 2f 73 6d 74 70 2e 70 68 70 00 00 00 00 00 00 00 00 | Mail-1.0.1/Mail/smtp.php........ |
5020 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5040 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5060 | 00 00 00 00 31 30 30 36 36 34 20 00 20 20 20 20 20 30 20 00 20 20 20 37 36 37 20 00 20 20 20 20 | ....100664.......0.....767...... |
5080 | 20 20 31 33 30 34 32 20 20 37 35 31 36 34 36 32 32 36 35 20 20 31 30 31 30 34 20 00 00 00 00 00 | ..13042..7516462265..10104...... |
50a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
50c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
50e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5100 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5120 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5140 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5160 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5180 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
51a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
51c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
51e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
5200 | 3c 3f 70 68 70 0a 2f 2f 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | <?php.//.//.+------------------- |
5220 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
5240 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 50 48 50 20 56 65 | -------------------+.//.|.PHP.Ve |
5260 | 72 73 69 6f 6e 20 34 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | rsion.4......................... |
5280 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c | ...............................| |
52a0 | 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | .//.+--------------------------- |
52c0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
52e0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 2f 2f 20 7c 20 43 6f 70 79 72 69 67 68 74 20 28 63 29 20 | -----------+.//.|.Copyright.(c). |
5300 | 31 39 39 37 2d 32 30 30 32 20 54 68 65 20 50 48 50 20 47 72 6f 75 70 20 20 20 20 20 20 20 20 20 | 1997-2002.The.PHP.Group......... |
5320 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | .......................|.//.+--- |
5340 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
5360 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
5380 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 54 68 69 73 20 73 6f 75 72 63 65 20 66 69 6c 65 20 69 73 20 73 75 | ---+.//.|.This.source.file.is.su |
53a0 | 62 6a 65 63 74 20 74 6f 20 76 65 72 73 69 6f 6e 20 32 2e 30 32 20 6f 66 20 74 68 65 20 50 48 50 | bject.to.version.2.02.of.the.PHP |
53c0 | 20 6c 69 63 65 6e 73 65 2c 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 74 68 61 74 20 69 73 20 62 75 | .license,......|.//.|.that.is.bu |
53e0 | 6e 64 6c 65 64 20 77 69 74 68 20 74 68 69 73 20 70 61 63 6b 61 67 65 20 69 6e 20 74 68 65 20 66 | ndled.with.this.package.in.the.f |
5400 | 69 6c 65 20 4c 49 43 45 4e 53 45 2c 20 61 6e 64 20 69 73 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 | ile.LICENSE,.and.is........|.//. |
5420 | 7c 20 61 76 61 69 6c 61 62 6c 65 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c 64 2d 77 69 | |.available.through.the.world-wi |
5440 | 64 65 2d 77 65 62 20 61 74 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 75 72 6c 3a 20 20 20 20 | de-web.at.the.following.url:.... |
5460 | 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 68 74 74 70 3a 2f 2f 77 77 77 2e 70 68 70 2e 6e 65 74 | .......|.//.|.http://www.php.net |
5480 | 2f 6c 69 63 65 6e 73 65 2f 32 5f 30 32 2e 74 78 74 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | /license/2_02.txt............... |
54a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 49 66 20 79 6f 75 | ...................|.//.|.If.you |
54c0 | 20 64 69 64 20 6e 6f 74 20 72 65 63 65 69 76 65 20 61 20 63 6f 70 79 20 6f 66 20 74 68 65 20 50 | .did.not.receive.a.copy.of.the.P |
54e0 | 48 50 20 6c 69 63 65 6e 73 65 20 61 6e 64 20 61 72 65 20 75 6e 61 62 6c 65 20 74 6f 20 20 20 7c | HP.license.and.are.unable.to...| |
5500 | 0a 2f 2f 20 7c 20 6f 62 74 61 69 6e 20 69 74 20 74 68 72 6f 75 67 68 20 74 68 65 20 77 6f 72 6c | .//.|.obtain.it.through.the.worl |
5520 | 64 2d 77 69 64 65 2d 77 65 62 2c 20 70 6c 65 61 73 65 20 73 65 6e 64 20 61 20 6e 6f 74 65 20 74 | d-wide-web,.please.send.a.note.t |
5540 | 6f 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 7c 20 6c 69 63 65 6e 73 65 40 70 68 70 2e 6e 65 | o..........|.//.|.license@php.ne |
5560 | 74 20 73 6f 20 77 65 20 63 61 6e 20 6d 61 69 6c 20 79 6f 75 20 61 20 63 6f 70 79 20 69 6d 6d 65 | t.so.we.can.mail.you.a.copy.imme |
5580 | 64 69 61 74 65 6c 79 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d | diately................|.//.+--- |
55a0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
55c0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
55e0 | 2d 2d 2d 2b 0a 2f 2f 20 7c 20 41 75 74 68 6f 72 3a 20 43 68 75 63 6b 20 48 61 67 65 6e 62 75 63 | ---+.//.|.Author:.Chuck.Hagenbuc |
5600 | 68 20 3c 63 68 75 63 6b 40 68 6f 72 64 65 2e 6f 72 67 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 | h.<chuck@horde.org>............. |
5620 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | ...............|.//.+----------- |
5640 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
5660 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0a 0a 72 65 | ---------------------------+..re |
5680 | 71 75 69 72 65 5f 6f 6e 63 65 20 27 4d 61 69 6c 2e 70 68 70 27 3b 0a 0a 2f 2a 2a 0a 20 2a 20 53 | quire_once.'Mail.php';../**..*.S |
56a0 | 4d 54 50 20 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 50 45 41 52 20 4d | MTP.implementation.of.the.PEAR.M |
56c0 | 61 69 6c 3a 3a 20 69 6e 74 65 72 66 61 63 65 2e 20 52 65 71 75 69 72 65 73 20 74 68 65 20 50 45 | ail::.interface..Requires.the.PE |
56e0 | 41 52 0a 20 2a 20 4e 65 74 5f 53 4d 54 50 3a 3a 20 63 6c 61 73 73 2e 0a 20 2a 20 40 61 63 63 65 | AR..*.Net_SMTP::.class...*.@acce |
5700 | 73 73 20 70 75 62 6c 69 63 0a 20 2a 20 40 70 61 63 6b 61 67 65 20 4d 61 69 6c 0a 20 2a 20 40 76 | ss.public..*.@package.Mail..*.@v |
5720 | 65 72 73 69 6f 6e 20 24 52 65 76 69 73 69 6f 6e 3a 20 31 2e 31 20 24 20 0a 20 2a 2f 0a 63 6c 61 | ersion.$Revision:.1.1.$...*/.cla |
5740 | 73 73 20 4d 61 69 6c 5f 73 6d 74 70 20 65 78 74 65 6e 64 73 20 4d 61 69 6c 20 7b 0a 20 20 20 20 | ss.Mail_smtp.extends.Mail.{..... |
5760 | 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 68 65 20 53 4d 54 50 20 68 6f 73 74 20 74 6f 20 63 6f | ../**......*.The.SMTP.host.to.co |
5780 | 6e 6e 65 63 74 20 74 6f 2e 0a 20 20 20 20 20 2a 20 40 76 61 72 09 73 74 72 69 6e 67 0a 20 20 20 | nnect.to.......*.@var.string.... |
57a0 | 20 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 68 6f 73 74 20 3d 20 27 6c 6f 63 61 6c 68 6f 73 74 27 | ..*/.....var.$host.=.'localhost' |
57c0 | 3b 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 68 65 20 70 6f 72 74 20 74 68 65 20 | ;......./**......*.The.port.the. |
57e0 | 53 4d 54 50 20 73 65 72 76 65 72 20 69 73 20 6f 6e 2e 0a 20 20 20 20 20 2a 20 40 76 61 72 09 69 | SMTP.server.is.on.......*.@var.i |
5800 | 6e 74 65 67 65 72 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 70 6f 72 74 20 3d 20 32 | nteger......*/.....var.$port.=.2 |
5820 | 35 3b 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 57 68 65 74 68 65 72 20 6f 72 20 6e | 5;......./**......*.Whether.or.n |
5840 | 6f 74 20 74 6f 20 61 74 74 65 6d 70 74 20 74 6f 20 61 75 74 68 65 6e 74 69 63 61 74 65 20 74 6f | ot.to.attempt.to.authenticate.to |
5860 | 20 74 68 65 20 53 4d 54 50 20 73 65 72 76 65 72 2e 0a 20 20 20 20 20 2a 20 40 76 61 72 20 62 6f | .the.SMTP.server.......*.@var.bo |
5880 | 6f 6c 65 61 6e 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 61 75 74 68 20 3d 20 66 61 | olean......*/.....var.$auth.=.fa |
58a0 | 6c 73 65 3b 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 68 65 20 75 73 65 72 6e 61 | lse;......./**......*.The.userna |
58c0 | 6d 65 20 74 6f 20 75 73 65 20 69 66 20 74 68 65 20 53 4d 54 50 20 73 65 72 76 65 72 20 72 65 71 | me.to.use.if.the.SMTP.server.req |
58e0 | 75 69 72 65 73 20 61 75 74 68 65 6e 74 69 63 61 74 69 6f 6e 2e 0a 20 20 20 20 20 2a 20 40 76 61 | uires.authentication.......*.@va |
5900 | 72 20 73 74 72 69 6e 67 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 75 73 65 72 6e 61 | r.string......*/.....var.$userna |
5920 | 6d 65 20 3d 20 27 27 3b 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 54 68 65 20 70 61 | me.=.'';......./**......*.The.pa |
5940 | 73 73 77 6f 72 64 20 74 6f 20 75 73 65 20 69 66 20 74 68 65 20 53 4d 54 50 20 73 65 72 76 65 72 | ssword.to.use.if.the.SMTP.server |
5960 | 20 72 65 71 75 69 72 65 73 20 61 75 74 68 65 6e 74 69 63 61 74 69 6f 6e 2e 0a 20 20 20 20 20 2a | .requires.authentication.......* |
5980 | 20 40 76 61 72 20 73 74 72 69 6e 67 0a 20 20 20 20 20 2a 2f 0a 20 20 20 20 76 61 72 20 24 70 61 | .@var.string......*/.....var.$pa |
59a0 | 73 73 77 6f 72 64 20 3d 20 27 27 3b 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 43 6f | ssword.=.'';......./**......*.Co |
59c0 | 6e 73 74 72 75 63 74 6f 72 2e 0a 20 20 20 20 20 2a 20 0a 20 20 20 20 20 2a 20 49 6e 73 74 61 6e | nstructor.......*.......*.Instan |
59e0 | 74 69 61 74 65 73 20 61 20 6e 65 77 20 4d 61 69 6c 5f 73 6d 74 70 3a 3a 20 6f 62 6a 65 63 74 20 | tiates.a.new.Mail_smtp::.object. |
5a00 | 62 61 73 65 64 20 6f 6e 20 74 68 65 20 70 61 72 61 6d 65 74 65 72 73 0a 20 20 20 20 20 2a 20 70 | based.on.the.parameters......*.p |
5a20 | 61 73 73 65 64 20 69 6e 2e 20 49 74 20 6c 6f 6f 6b 73 20 66 6f 72 20 74 68 65 20 66 6f 6c 6c 6f | assed.in..It.looks.for.the.follo |
5a40 | 77 69 6e 67 20 70 61 72 61 6d 65 74 65 72 73 3a 0a 20 20 20 20 20 2a 20 20 20 20 20 68 6f 73 74 | wing.parameters:......*.....host |
5a60 | 20 20 20 20 20 20 20 20 54 68 65 20 73 65 72 76 65 72 20 74 6f 20 63 6f 6e 6e 65 63 74 20 74 6f | ........The.server.to.connect.to |
5a80 | 2e 20 44 65 66 61 75 6c 74 73 20 74 6f 20 6c 6f 63 61 6c 68 6f 73 74 2e 0a 20 20 20 20 20 2a 20 | ..Defaults.to.localhost.......*. |
5aa0 | 20 20 20 20 70 6f 72 74 20 20 20 20 20 20 20 20 54 68 65 20 70 6f 72 74 20 74 6f 20 63 6f 6e 6e | ....port........The.port.to.conn |
5ac0 | 65 63 74 20 74 6f 2e 20 44 65 66 61 75 6c 74 73 20 74 6f 20 32 35 2e 0a 20 20 20 20 20 2a 20 20 | ect.to..Defaults.to.25.......*.. |
5ae0 | 20 20 20 61 75 74 68 20 20 20 20 20 20 20 20 57 68 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 74 6f | ...auth........Whether.or.not.to |
5b00 | 20 75 73 65 20 53 4d 54 50 20 61 75 74 68 2e 20 44 65 66 61 75 6c 74 73 20 74 6f 20 66 61 6c 73 | .use.SMTP.auth..Defaults.to.fals |
5b20 | 65 2e 0a 20 20 20 20 20 2a 20 20 20 20 20 75 73 65 72 6e 61 6d 65 20 20 20 20 54 68 65 20 75 73 | e.......*.....username....The.us |
5b40 | 65 72 6e 61 6d 65 20 74 6f 20 75 73 65 20 66 6f 72 20 53 4d 54 50 20 61 75 74 68 2e 20 4e 6f 20 | ername.to.use.for.SMTP.auth..No. |
5b60 | 64 65 66 61 75 6c 74 2e 0a 20 20 20 20 20 2a 20 20 20 20 20 70 61 73 73 77 6f 72 64 20 20 20 20 | default.......*.....password.... |
5b80 | 54 68 65 20 70 61 73 73 77 6f 72 64 20 74 6f 20 75 73 65 20 66 6f 72 20 53 4d 54 50 20 61 75 74 | The.password.to.use.for.SMTP.aut |
5ba0 | 68 2e 20 4e 6f 20 64 65 66 61 75 6c 74 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 49 66 20 | h..No.default.......*......*.If. |
5bc0 | 61 20 70 61 72 61 6d 65 74 65 72 20 69 73 20 70 72 65 73 65 6e 74 20 69 6e 20 74 68 65 20 24 70 | a.parameter.is.present.in.the.$p |
5be0 | 61 72 61 6d 73 20 61 72 72 61 79 2c 20 69 74 20 72 65 70 6c 61 63 65 73 20 74 68 65 0a 20 20 20 | arams.array,.it.replaces.the.... |
5c00 | 20 20 2a 20 64 65 66 61 75 6c 74 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 | ..*.default.......*......*.@para |
5c20 | 6d 20 61 72 72 61 79 20 48 61 73 68 20 63 6f 6e 74 61 69 6e 69 6e 67 20 61 6e 79 20 70 61 72 61 | m.array.Hash.containing.any.para |
5c40 | 6d 65 74 65 72 73 20 64 69 66 66 65 72 65 6e 74 20 66 72 6f 6d 20 74 68 65 0a 20 20 20 20 20 2a | meters.different.from.the......* |
5c60 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 64 65 66 61 75 6c 74 73 2e 0a 20 20 20 20 20 2a 20 40 | ..............defaults.......*.@ |
5c80 | 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 2f 09 0a 20 20 20 20 66 75 6e 63 74 | access.public......*/......funct |
5ca0 | 69 6f 6e 20 4d 61 69 6c 5f 73 6d 74 70 28 24 70 61 72 61 6d 73 29 0a 20 20 20 20 7b 0a 20 20 20 | ion.Mail_smtp($params).....{.... |
5cc0 | 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 70 61 72 61 6d 73 5b 27 68 6f 73 74 27 5d 29 29 | .....if.(isset($params['host'])) |
5ce0 | 20 24 74 68 69 73 2d 3e 68 6f 73 74 20 3d 20 24 70 61 72 61 6d 73 5b 27 68 6f 73 74 27 5d 3b 0a | .$this->host.=.$params['host'];. |
5d00 | 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 70 61 72 61 6d 73 5b 27 70 6f 72 74 27 | ........if.(isset($params['port' |
5d20 | 5d 29 29 20 24 74 68 69 73 2d 3e 70 6f 72 74 20 3d 20 24 70 61 72 61 6d 73 5b 27 70 6f 72 74 27 | ])).$this->port.=.$params['port' |
5d40 | 5d 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 70 61 72 61 6d 73 5b 27 61 75 | ];.........if.(isset($params['au |
5d60 | 74 68 27 5d 29 29 20 24 74 68 69 73 2d 3e 61 75 74 68 20 3d 20 24 70 61 72 61 6d 73 5b 27 61 75 | th'])).$this->auth.=.$params['au |
5d80 | 74 68 27 5d 3b 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 70 61 72 61 6d 73 5b | th'];.........if.(isset($params[ |
5da0 | 27 75 73 65 72 6e 61 6d 65 27 5d 29 29 20 24 74 68 69 73 2d 3e 75 73 65 72 6e 61 6d 65 20 3d 20 | 'username'])).$this->username.=. |
5dc0 | 24 70 61 72 61 6d 73 5b 27 75 73 65 72 6e 61 6d 65 27 5d 3b 0a 20 20 20 20 20 20 20 20 69 66 20 | $params['username'];.........if. |
5de0 | 28 69 73 73 65 74 28 24 70 61 72 61 6d 73 5b 27 70 61 73 73 77 6f 72 64 27 5d 29 29 20 24 74 68 | (isset($params['password'])).$th |
5e00 | 69 73 2d 3e 70 61 73 73 77 6f 72 64 20 3d 20 24 70 61 72 61 6d 73 5b 27 70 61 73 73 77 6f 72 64 | is->password.=.$params['password |
5e20 | 27 5d 3b 0a 20 20 20 20 7d 0a 20 20 20 20 0a 09 2f 2a 2a 0a 20 20 20 20 20 2a 20 49 6d 70 6c 65 | '];.....}......./**......*.Imple |
5e40 | 6d 65 6e 74 73 20 4d 61 69 6c 3a 3a 73 65 6e 64 28 29 20 66 75 6e 63 74 69 6f 6e 20 75 73 69 6e | ments.Mail::send().function.usin |
5e60 | 67 20 53 4d 54 50 2e 0a 20 20 20 20 20 2a 20 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 6d 69 | g.SMTP.......*.......*.@param.mi |
5e80 | 78 65 64 20 24 72 65 63 69 70 69 65 6e 74 73 20 45 69 74 68 65 72 20 61 20 63 6f 6d 6d 61 2d 73 | xed.$recipients.Either.a.comma-s |
5ea0 | 65 70 65 72 61 74 65 64 20 6c 69 73 74 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 0a 20 20 20 20 | eperated.list.of.recipients..... |
5ec0 | 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 28 52 46 43 38 32 32 20 63 6f 6d 70 6c 69 61 6e | .*..............(RFC822.complian |
5ee0 | 74 29 2c 20 6f 72 20 61 6e 20 61 72 72 61 79 20 6f 66 20 72 65 63 69 70 69 65 6e 74 73 2c 0a 20 | t),.or.an.array.of.recipients,.. |
5f00 | 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 65 61 63 68 20 52 46 43 38 32 32 20 76 | ....*..............each.RFC822.v |
5f20 | 61 6c 69 64 2e 20 54 68 69 73 20 6d 61 79 20 63 6f 6e 74 61 69 6e 20 72 65 63 69 70 69 65 6e 74 | alid..This.may.contain.recipient |
5f40 | 73 20 6e 6f 74 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 70 65 63 69 66 | s.not......*..............specif |
5f60 | 69 65 64 20 69 6e 20 74 68 65 20 68 65 61 64 65 72 73 2c 20 66 6f 72 20 42 63 63 3a 2c 20 72 65 | ied.in.the.headers,.for.Bcc:,.re |
5f80 | 73 65 6e 64 69 6e 67 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 6d 65 73 73 | sending......*..............mess |
5fa0 | 61 67 65 73 2c 20 65 74 63 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 | ages,.etc.......*......*.@param. |
5fc0 | 61 72 72 61 79 20 24 68 65 61 64 65 72 73 20 54 68 65 20 61 72 72 61 79 20 6f 66 20 68 65 61 64 | array.$headers.The.array.of.head |
5fe0 | 65 72 73 20 74 6f 20 73 65 6e 64 20 77 69 74 68 20 74 68 65 20 6d 61 69 6c 2c 20 69 6e 20 61 6e | ers.to.send.with.the.mail,.in.an |
6000 | 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 73 73 6f 63 69 61 74 69 76 65 | ......*..............associative |
6020 | 20 61 72 72 61 79 2c 20 77 68 65 72 65 20 74 68 65 20 61 72 72 61 79 20 6b 65 79 20 69 73 20 74 | .array,.where.the.array.key.is.t |
6040 | 68 65 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 68 65 61 64 65 72 20 6e 61 | he......*..............header.na |
6060 | 6d 65 20 28 69 65 2c 20 27 53 75 62 6a 65 63 74 27 29 2c 20 61 6e 64 20 74 68 65 20 61 72 72 61 | me.(ie,.'Subject'),.and.the.arra |
6080 | 79 20 76 61 6c 75 65 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 73 20 74 | y.value......*..............is.t |
60a0 | 68 65 20 68 65 61 64 65 72 20 76 61 6c 75 65 20 28 69 65 2c 20 27 74 65 73 74 27 29 2e 20 54 68 | he.header.value.(ie,.'test')..Th |
60c0 | 65 20 68 65 61 64 65 72 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 70 72 6f | e.header......*..............pro |
60e0 | 64 75 63 65 64 20 66 72 6f 6d 20 74 68 6f 73 65 20 76 61 6c 75 65 73 20 77 6f 75 6c 64 20 62 65 | duced.from.those.values.would.be |
6100 | 20 27 53 75 62 6a 65 63 74 3a 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 | .'Subject:......*..............t |
6120 | 65 73 74 27 2e 0a 20 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e | est'.......*......*.@param.strin |
6140 | 67 20 24 62 6f 64 79 20 54 68 65 20 66 75 6c 6c 20 74 65 78 74 20 6f 66 20 74 68 65 20 6d 65 73 | g.$body.The.full.text.of.the.mes |
6160 | 73 61 67 65 20 62 6f 64 79 2c 20 69 6e 63 6c 75 64 69 6e 67 20 61 6e 79 0a 20 20 20 20 20 2a 20 | sage.body,.including.any......*. |
6180 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4d 69 6d 65 20 70 61 72 74 73 2c 20 65 74 63 2e 0a 20 | ..............Mime.parts,.etc... |
61a0 | 20 20 20 20 2a 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 52 65 74 75 72 | ....*......*.@return.mixed.Retur |
61c0 | 6e 73 20 74 72 75 65 20 6f 6e 20 73 75 63 63 65 73 73 2c 20 6f 72 20 61 20 50 45 41 52 5f 45 72 | ns.true.on.success,.or.a.PEAR_Er |
61e0 | 72 6f 72 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 61 69 6e | ror......*...............contain |
6200 | 69 6e 67 20 61 20 64 65 73 63 72 69 70 74 69 76 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 20 | ing.a.descriptive.error.message. |
6220 | 6f 6e 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 61 69 6c 75 72 65 2e | on......*...............failure. |
6240 | 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0a 20 20 20 20 20 2a 2f 0a 20 | ......*.@access.public......*/.. |
6260 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 73 65 6e 64 28 24 72 65 63 69 70 69 65 6e 74 73 2c 20 24 68 | ...function.send($recipients,.$h |
6280 | 65 61 64 65 72 73 2c 20 24 62 6f 64 79 29 0a 20 20 20 20 7b 0a 20 20 20 20 20 20 20 20 69 6e 63 | eaders,.$body).....{.........inc |
62a0 | 6c 75 64 65 5f 6f 6e 63 65 20 27 4e 65 74 2f 53 4d 54 50 2e 70 68 70 27 3b 0a 20 20 20 20 20 20 | lude_once.'Net/SMTP.php';....... |
62c0 | 20 20 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 28 24 73 6d 74 70 20 3d 20 6e 65 77 20 4e 65 74 | ...........if.(!($smtp.=.new.Net |
62e0 | 5f 53 4d 54 50 28 24 74 68 69 73 2d 3e 68 6f 73 74 2c 20 24 74 68 69 73 2d 3e 70 6f 72 74 29 29 | _SMTP($this->host,.$this->port)) |
6300 | 29 20 7b 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 75 6e 61 62 6c | ).{.return.new.PEAR_Error('unabl |
6320 | 65 20 74 6f 20 69 6e 73 74 61 6e 74 69 61 74 65 20 4e 65 74 5f 53 4d 54 50 20 6f 62 6a 65 63 74 | e.to.instantiate.Net_SMTP.object |
6340 | 27 29 3b 20 7d 0a 20 20 20 20 20 20 20 20 69 66 20 28 50 45 41 52 3a 3a 69 73 45 72 72 6f 72 28 | ');.}.........if.(PEAR::isError( |
6360 | 24 73 6d 74 70 2d 3e 63 6f 6e 6e 65 63 74 28 29 29 29 20 7b 20 72 65 74 75 72 6e 20 6e 65 77 20 | $smtp->connect())).{.return.new. |
6380 | 50 45 41 52 5f 45 72 72 6f 72 28 27 75 6e 61 62 6c 65 20 74 6f 20 63 6f 6e 6e 65 63 74 20 74 6f | PEAR_Error('unable.to.connect.to |
63a0 | 20 73 6d 74 70 20 73 65 72 76 65 72 20 27 20 2e 20 24 74 68 69 73 2d 3e 68 6f 73 74 20 2e 20 27 | .smtp.server.'...$this->host...' |
63c0 | 3a 27 20 2e 20 24 74 68 69 73 2d 3e 70 6f 72 74 29 3b 20 7d 0a 20 20 20 20 20 20 20 20 0a 20 20 | :'...$this->port);.}............ |
63e0 | 20 20 20 20 20 20 69 66 20 28 24 74 68 69 73 2d 3e 61 75 74 68 29 20 7b 0a 20 20 20 20 20 20 20 | ......if.($this->auth).{........ |
6400 | 20 20 20 20 20 69 66 20 28 50 45 41 52 3a 3a 69 73 45 72 72 6f 72 28 24 73 6d 74 70 2d 3e 61 75 | .....if.(PEAR::isError($smtp->au |
6420 | 74 68 28 24 74 68 69 73 2d 3e 75 73 65 72 6e 61 6d 65 2c 20 24 74 68 69 73 2d 3e 70 61 73 73 77 | th($this->username,.$this->passw |
6440 | 6f 72 64 29 29 29 20 7b 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 | ord))).{.return.new.PEAR_Error(' |
6460 | 75 6e 61 62 6c 65 20 74 6f 20 61 75 74 68 65 6e 74 69 63 61 74 65 20 74 6f 20 73 6d 74 70 20 73 | unable.to.authenticate.to.smtp.s |
6480 | 65 72 76 65 72 27 29 3b 20 7d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 45 41 52 3a | erver');.}.............if.(PEAR: |
64a0 | 3a 69 73 45 72 72 6f 72 28 24 73 6d 74 70 2d 3e 69 64 65 6e 74 69 66 79 53 65 6e 64 65 72 28 29 | :isError($smtp->identifySender() |
64c0 | 29 29 20 7b 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 75 6e 61 62 | )).{.return.new.PEAR_Error('unab |
64e0 | 6c 65 20 74 6f 20 69 64 65 6e 74 69 66 79 20 73 6d 74 70 20 73 65 72 76 65 72 27 29 3b 20 7d 0a | le.to.identify.smtp.server');.}. |
6500 | 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 6c 69 73 74 28 | ........}..................list( |
6520 | 24 66 72 6f 6d 2c 20 24 74 65 78 74 5f 68 65 61 64 65 72 73 29 20 3d 20 24 74 68 69 73 2d 3e 70 | $from,.$text_headers).=.$this->p |
6540 | 72 65 70 61 72 65 48 65 61 64 65 72 73 28 24 68 65 61 64 65 72 73 29 3b 0a 20 20 20 20 20 20 20 | repareHeaders($headers);........ |
6560 | 20 69 66 20 28 21 69 73 73 65 74 28 24 66 72 6f 6d 29 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 | .if.(!isset($from)).{........... |
6580 | 20 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 4e 6f 20 66 72 6f 6d | ..return.new.PEAR_Error('No.from |
65a0 | 20 61 64 64 72 65 73 73 20 67 69 76 65 6e 27 29 3b 0a 20 20 20 20 20 20 20 20 7d 0a 20 20 20 20 | .address.given');.........}..... |
65c0 | 20 20 20 20 0a 20 20 20 20 20 20 20 20 69 66 20 28 50 45 41 52 3a 3a 69 73 45 72 72 6f 72 28 24 | .............if.(PEAR::isError($ |
65e0 | 73 6d 74 70 2d 3e 6d 61 69 6c 46 72 6f 6d 28 24 66 72 6f 6d 29 29 29 20 7b 20 72 65 74 75 72 6e | smtp->mailFrom($from))).{.return |
6600 | 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 75 6e 61 62 6c 65 20 74 6f 20 73 65 74 20 73 | .new.PEAR_Error('unable.to.set.s |
6620 | 65 6e 64 65 72 20 74 6f 20 5b 27 20 2e 20 24 66 72 6f 6d 20 2e 20 27 5d 27 29 3b 20 7d 0a 20 20 | ender.to.['...$from...']');.}... |
6640 | 20 20 20 20 20 20 0a 20 20 20 20 20 20 20 20 24 72 65 63 69 70 69 65 6e 74 73 20 3d 20 24 74 68 | ...............$recipients.=.$th |
6660 | 69 73 2d 3e 70 61 72 73 65 52 65 63 69 70 69 65 6e 74 73 28 24 72 65 63 69 70 69 65 6e 74 73 29 | is->parseRecipients($recipients) |
6680 | 3b 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 28 24 72 65 63 69 70 69 65 6e 74 73 20 61 73 | ;.........foreach($recipients.as |
66a0 | 20 24 72 65 63 69 70 69 65 6e 74 29 20 7b 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 50 | .$recipient).{.............if.(P |
66c0 | 45 41 52 3a 3a 69 73 45 72 72 6f 72 28 24 72 65 73 20 3d 20 24 73 6d 74 70 2d 3e 72 63 70 74 54 | EAR::isError($res.=.$smtp->rcptT |
66e0 | 6f 28 24 72 65 63 69 70 69 65 6e 74 29 29 29 20 7b 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 | o($recipient))).{.return.new.PEA |
6700 | 52 5f 45 72 72 6f 72 28 27 75 6e 61 62 6c 65 20 74 6f 20 61 64 64 20 72 65 63 69 70 69 65 6e 74 | R_Error('unable.to.add.recipient |
6720 | 20 5b 27 20 2e 20 24 72 65 63 69 70 69 65 6e 74 20 2e 20 27 5d 3a 20 27 20 2e 20 24 72 65 73 2d | .['...$recipient...']:.'...$res- |
6740 | 3e 67 65 74 4d 65 73 73 61 67 65 28 29 29 3b 20 7d 0a 20 20 20 20 20 20 20 20 7d 0a 09 09 0a 20 | >getMessage());.}.........}..... |
6760 | 20 20 20 20 20 20 20 69 66 20 28 50 45 41 52 3a 3a 69 73 45 72 72 6f 72 28 24 73 6d 74 70 2d 3e | .......if.(PEAR::isError($smtp-> |
6780 | 64 61 74 61 28 24 74 65 78 74 5f 68 65 61 64 65 72 73 20 2e 20 22 5c 6e 22 20 2e 20 24 62 6f 64 | data($text_headers..."\n"...$bod |
67a0 | 79 29 29 29 20 7b 20 72 65 74 75 72 6e 20 6e 65 77 20 50 45 41 52 5f 45 72 72 6f 72 28 27 75 6e | y))).{.return.new.PEAR_Error('un |
67c0 | 61 62 6c 65 20 74 6f 20 73 65 6e 64 20 64 61 74 61 27 29 3b 20 7d 0a 20 20 20 20 20 20 20 20 0a | able.to.send.data');.}.......... |
67e0 | 20 20 20 20 20 20 20 20 24 73 6d 74 70 2d 3e 64 69 73 63 6f 6e 6e 65 63 74 28 29 3b 0a 20 20 20 | ........$smtp->disconnect();.... |
6800 | 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0a 20 20 20 20 7d 0a 20 20 20 20 0a 7d 0a 3f | .....return.true;.....}......}.? |
6820 | 3e 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | >............................... |
6840 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6860 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6880 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
68a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
68c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
68e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6900 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6920 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6960 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
69a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
69c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
69e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6a00 | 4d 61 69 6c 2d 31 2e 30 2e 31 2f 4d 61 69 6c 2f 52 46 43 38 32 32 2e 70 68 70 00 00 00 00 00 00 | Mail-1.0.1/Mail/RFC822.php...... |
6a20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6a40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6a60 | 00 00 00 00 31 30 30 36 36 34 20 00 20 20 20 20 20 30 20 00 20 20 20 37 36 37 20 00 20 20 20 20 | ....100664.......0.....767...... |
6a80 | 20 20 37 35 32 34 30 20 20 37 35 32 30 32 37 30 30 33 34 20 20 20 37 37 36 31 20 00 00 00 00 00 | ..75240..7520270034...7761...... |
6aa0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6ac0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6ae0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6b00 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6b20 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6b40 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6b60 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6b80 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6ba0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6bc0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6be0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
6c00 | 3c 3f 70 68 70 0d 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | <?php..//.+--------------------- |
6c20 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
6c40 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0a 2f 2f 20 7c 20 43 6f 70 79 72 69 | ------------------+..//.|.Copyri |
6c60 | 67 68 74 20 28 63 29 20 32 30 30 31 2d 32 30 30 32 2c 20 52 69 63 68 61 72 64 20 48 65 79 65 73 | ght.(c).2001-2002,.Richard.Heyes |
6c80 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
6ca0 | 7c 0d 0a 2f 2f 20 7c 20 41 6c 6c 20 72 69 67 68 74 73 20 72 65 73 65 72 76 65 64 2e 20 20 20 20 | |..//.|.All.rights.reserved..... |
6cc0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
6ce0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 20 20 20 20 20 20 20 20 20 20 | ..............|..//.|........... |
6d00 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
6d20 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 0a 2f | ............................|../ |
6d40 | 2f 20 7c 20 52 65 64 69 73 74 72 69 62 75 74 69 6f 6e 20 61 6e 64 20 75 73 65 20 69 6e 20 73 6f | /.|.Redistribution.and.use.in.so |
6d60 | 75 72 63 65 20 61 6e 64 20 62 69 6e 61 72 79 20 66 6f 72 6d 73 2c 20 77 69 74 68 20 6f 72 20 77 | urce.and.binary.forms,.with.or.w |
6d80 | 69 74 68 6f 75 74 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 6d 6f 64 69 66 69 63 61 74 69 6f 6e 2c 20 | ithout....|..//.|.modification,. |
6da0 | 61 72 65 20 70 65 72 6d 69 74 74 65 64 20 70 72 6f 76 69 64 65 64 20 74 68 61 74 20 74 68 65 20 | are.permitted.provided.that.the. |
6dc0 | 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6e 64 69 74 69 6f 6e 73 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 | following.conditions....|..//.|. |
6de0 | 61 72 65 20 6d 65 74 3a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | are.met:........................ |
6e00 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
6e20 | 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ......|..//.|................... |
6e40 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
6e60 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 6f 20 52 65 | ....................|..//.|.o.Re |
6e80 | 64 69 73 74 72 69 62 75 74 69 6f 6e 73 20 6f 66 20 73 6f 75 72 63 65 20 63 6f 64 65 20 6d 75 73 | distributions.of.source.code.mus |
6ea0 | 74 20 72 65 74 61 69 6e 20 74 68 65 20 61 62 6f 76 65 20 63 6f 70 79 72 69 67 68 74 20 20 20 20 | t.retain.the.above.copyright.... |
6ec0 | 20 20 7c 0d 0a 2f 2f 20 7c 20 20 20 6e 6f 74 69 63 65 2c 20 74 68 69 73 20 6c 69 73 74 20 6f 66 | ..|..//.|...notice,.this.list.of |
6ee0 | 20 63 6f 6e 64 69 74 69 6f 6e 73 20 61 6e 64 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 64 69 | .conditions.and.the.following.di |
6f00 | 73 63 6c 61 69 6d 65 72 2e 20 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 6f 20 52 65 64 69 73 74 | sclaimer........|..//.|.o.Redist |
6f20 | 72 69 62 75 74 69 6f 6e 73 20 69 6e 20 62 69 6e 61 72 79 20 66 6f 72 6d 20 6d 75 73 74 20 72 65 | ributions.in.binary.form.must.re |
6f40 | 70 72 6f 64 75 63 65 20 74 68 65 20 61 62 6f 76 65 20 63 6f 70 79 72 69 67 68 74 20 20 20 7c 0d | produce.the.above.copyright...|. |
6f60 | 0a 2f 2f 20 7c 20 20 20 6e 6f 74 69 63 65 2c 20 74 68 69 73 20 6c 69 73 74 20 6f 66 20 63 6f 6e | .//.|...notice,.this.list.of.con |
6f80 | 64 69 74 69 6f 6e 73 20 61 6e 64 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 64 69 73 63 6c 61 | ditions.and.the.following.discla |
6fa0 | 69 6d 65 72 20 69 6e 20 74 68 65 20 7c 0d 0a 2f 2f 20 7c 20 20 20 64 6f 63 75 6d 65 6e 74 61 74 | imer.in.the.|..//.|...documentat |
6fc0 | 69 6f 6e 20 61 6e 64 2f 6f 72 20 6f 74 68 65 72 20 6d 61 74 65 72 69 61 6c 73 20 70 72 6f 76 69 | ion.and/or.other.materials.provi |
6fe0 | 64 65 64 20 77 69 74 68 20 74 68 65 20 64 69 73 74 72 69 62 75 74 69 6f 6e 2e 7c 20 0d 0a 2f 2f | ded.with.the.distribution.|...// |
7000 | 20 7c 20 6f 20 54 68 65 20 6e 61 6d 65 73 20 6f 66 20 74 68 65 20 61 75 74 68 6f 72 73 20 6d 61 | .|.o.The.names.of.the.authors.ma |
7020 | 79 20 6e 6f 74 20 62 65 20 75 73 65 64 20 74 6f 20 65 6e 64 6f 72 73 65 20 6f 72 20 70 72 6f 6d | y.not.be.used.to.endorse.or.prom |
7040 | 6f 74 65 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 20 20 70 72 6f 64 75 63 74 73 20 64 65 72 69 | ote......|..//.|...products.deri |
7060 | 76 65 64 20 66 72 6f 6d 20 74 68 69 73 20 73 6f 66 74 77 61 72 65 20 77 69 74 68 6f 75 74 20 73 | ved.from.this.software.without.s |
7080 | 70 65 63 69 66 69 63 20 70 72 69 6f 72 20 77 72 69 74 74 65 6e 20 20 7c 0d 0a 2f 2f 20 7c 20 20 | pecific.prior.written..|..//.|.. |
70a0 | 20 70 65 72 6d 69 73 73 69 6f 6e 2e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .permission..................... |
70c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
70e0 | 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .....|..//.|.................... |
7100 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
7120 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 54 48 49 53 20 | ...................|..//.|.THIS. |
7140 | 53 4f 46 54 57 41 52 45 20 49 53 20 50 52 4f 56 49 44 45 44 20 42 59 20 54 48 45 20 43 4f 50 59 | SOFTWARE.IS.PROVIDED.BY.THE.COPY |
7160 | 52 49 47 48 54 20 48 4f 4c 44 45 52 53 20 41 4e 44 20 43 4f 4e 54 52 49 42 55 54 4f 52 53 20 20 | RIGHT.HOLDERS.AND.CONTRIBUTORS.. |
7180 | 20 7c 0d 0a 2f 2f 20 7c 20 22 41 53 20 49 53 22 20 41 4e 44 20 41 4e 59 20 45 58 50 52 45 53 53 | .|..//.|."AS.IS".AND.ANY.EXPRESS |
71a0 | 20 4f 52 20 49 4d 50 4c 49 45 44 20 57 41 52 52 41 4e 54 49 45 53 2c 20 49 4e 43 4c 55 44 49 4e | .OR.IMPLIED.WARRANTIES,.INCLUDIN |
71c0 | 47 2c 20 42 55 54 20 4e 4f 54 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 4c 49 4d 49 54 45 44 20 54 | G,.BUT.NOT.....|..//.|.LIMITED.T |
71e0 | 4f 2c 20 54 48 45 20 49 4d 50 4c 49 45 44 20 57 41 52 52 41 4e 54 49 45 53 20 4f 46 20 4d 45 52 | O,.THE.IMPLIED.WARRANTIES.OF.MER |
7200 | 43 48 41 4e 54 41 42 49 4c 49 54 59 20 41 4e 44 20 46 49 54 4e 45 53 53 20 46 4f 52 20 7c 0d 0a | CHANTABILITY.AND.FITNESS.FOR.|.. |
7220 | 2f 2f 20 7c 20 41 20 50 41 52 54 49 43 55 4c 41 52 20 50 55 52 50 4f 53 45 20 41 52 45 20 44 49 | //.|.A.PARTICULAR.PURPOSE.ARE.DI |
7240 | 53 43 4c 41 49 4d 45 44 2e 20 49 4e 20 4e 4f 20 45 56 45 4e 54 20 53 48 41 4c 4c 20 54 48 45 20 | SCLAIMED..IN.NO.EVENT.SHALL.THE. |
7260 | 43 4f 50 59 52 49 47 48 54 20 20 7c 0d 0a 2f 2f 20 7c 20 4f 57 4e 45 52 20 4f 52 20 43 4f 4e 54 | COPYRIGHT..|..//.|.OWNER.OR.CONT |
7280 | 52 49 42 55 54 4f 52 53 20 42 45 20 4c 49 41 42 4c 45 20 46 4f 52 20 41 4e 59 20 44 49 52 45 43 | RIBUTORS.BE.LIABLE.FOR.ANY.DIREC |
72a0 | 54 2c 20 49 4e 44 49 52 45 43 54 2c 20 49 4e 43 49 44 45 4e 54 41 4c 2c 20 7c 0d 0a 2f 2f 20 7c | T,.INDIRECT,.INCIDENTAL,.|..//.| |
72c0 | 20 53 50 45 43 49 41 4c 2c 20 45 58 45 4d 50 4c 41 52 59 2c 20 4f 52 20 43 4f 4e 53 45 51 55 45 | .SPECIAL,.EXEMPLARY,.OR.CONSEQUE |
72e0 | 4e 54 49 41 4c 20 44 41 4d 41 47 45 53 20 28 49 4e 43 4c 55 44 49 4e 47 2c 20 42 55 54 20 4e 4f | NTIAL.DAMAGES.(INCLUDING,.BUT.NO |
7300 | 54 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 4c 49 4d 49 54 45 44 20 54 4f 2c 20 50 52 4f 43 55 | T......|..//.|.LIMITED.TO,.PROCU |
7320 | 52 45 4d 45 4e 54 20 4f 46 20 53 55 42 53 54 49 54 55 54 45 20 47 4f 4f 44 53 20 4f 52 20 53 45 | REMENT.OF.SUBSTITUTE.GOODS.OR.SE |
7340 | 52 56 49 43 45 53 3b 20 4c 4f 53 53 20 4f 46 20 55 53 45 2c 20 7c 0d 0a 2f 2f 20 7c 20 44 41 54 | RVICES;.LOSS.OF.USE,.|..//.|.DAT |
7360 | 41 2c 20 4f 52 20 50 52 4f 46 49 54 53 3b 20 4f 52 20 42 55 53 49 4e 45 53 53 20 49 4e 54 45 52 | A,.OR.PROFITS;.OR.BUSINESS.INTER |
7380 | 52 55 50 54 49 4f 4e 29 20 48 4f 57 45 56 45 52 20 43 41 55 53 45 44 20 41 4e 44 20 4f 4e 20 41 | RUPTION).HOWEVER.CAUSED.AND.ON.A |
73a0 | 4e 59 20 7c 0d 0a 2f 2f 20 7c 20 54 48 45 4f 52 59 20 4f 46 20 4c 49 41 42 49 4c 49 54 59 2c 20 | NY.|..//.|.THEORY.OF.LIABILITY,. |
73c0 | 57 48 45 54 48 45 52 20 49 4e 20 43 4f 4e 54 52 41 43 54 2c 20 53 54 52 49 43 54 20 4c 49 41 42 | WHETHER.IN.CONTRACT,.STRICT.LIAB |
73e0 | 49 4c 49 54 59 2c 20 4f 52 20 54 4f 52 54 20 20 20 7c 0d 0a 2f 2f 20 7c 20 28 49 4e 43 4c 55 44 | ILITY,.OR.TORT...|..//.|.(INCLUD |
7400 | 49 4e 47 20 4e 45 47 4c 49 47 45 4e 43 45 20 4f 52 20 4f 54 48 45 52 57 49 53 45 29 20 41 52 49 | ING.NEGLIGENCE.OR.OTHERWISE).ARI |
7420 | 53 49 4e 47 20 49 4e 20 41 4e 59 20 57 41 59 20 4f 55 54 20 4f 46 20 54 48 45 20 55 53 45 20 7c | SING.IN.ANY.WAY.OUT.OF.THE.USE.| |
7440 | 0d 0a 2f 2f 20 7c 20 4f 46 20 54 48 49 53 20 53 4f 46 54 57 41 52 45 2c 20 45 56 45 4e 20 49 46 | ..//.|.OF.THIS.SOFTWARE,.EVEN.IF |
7460 | 20 41 44 56 49 53 45 44 20 4f 46 20 54 48 45 20 50 4f 53 53 49 42 49 4c 49 54 59 20 4f 46 20 53 | .ADVISED.OF.THE.POSSIBILITY.OF.S |
7480 | 55 43 48 20 44 41 4d 41 47 45 2e 20 20 7c 0d 0a 2f 2f 20 7c 20 20 20 20 20 20 20 20 20 20 20 20 | UCH.DAMAGE...|..//.|............ |
74a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ................................ |
74c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 0a 2f 2f | ...........................|..// |
74e0 | 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | .+------------------------------ |
7500 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
7520 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0a 2f 2f 20 7c 20 41 75 74 68 6f 72 73 3a 20 52 69 63 68 61 72 | ---------+..//.|.Authors:.Richar |
7540 | 64 20 48 65 79 65 73 20 3c 72 69 63 68 61 72 64 40 70 68 70 67 75 72 75 2e 6f 72 67 3e 20 20 20 | d.Heyes.<richard@phpguru.org>... |
7560 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 0d 0a 2f 2f 20 7c 20 20 | .......................|..//.|.. |
7580 | 20 20 20 20 20 20 20 20 43 68 75 63 6b 20 48 61 67 65 6e 62 75 63 68 20 3c 63 68 75 63 6b 40 68 | ........Chuck.Hagenbuch.<chuck@h |
75a0 | 6f 72 64 65 2e 6f 72 67 3e 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | orde.org>....................... |
75c0 | 20 20 20 20 20 7c 0d 0a 2f 2f 20 2b 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | .....|..//.+-------------------- |
75e0 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d | -------------------------------- |
7600 | 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2b 0d 0a 0d 0a 72 65 71 75 69 72 65 5f | -------------------+....require_ |
7620 | 6f 6e 63 65 20 28 27 50 45 41 52 2e 70 68 70 27 29 3b 0d 0a 0d 0a 2f 2a 2a 0d 0a 2a 20 52 46 43 | once.('PEAR.php');..../**..*.RFC |
7640 | 20 38 32 32 20 45 6d 61 69 6c 20 61 64 64 72 65 73 73 20 6c 69 73 74 20 76 61 6c 69 64 61 74 69 | .822.Email.address.list.validati |
7660 | 6f 6e 20 55 74 69 6c 69 74 79 0d 0a 2a 0d 0a 2a 20 57 68 61 74 20 69 73 20 69 74 3f 0d 0a 2a 0d | on.Utility..*..*.What.is.it?..*. |
7680 | 0a 2a 20 54 68 69 73 20 63 6c 61 73 73 20 77 69 6c 6c 20 74 61 6b 65 20 61 6e 20 61 64 64 72 65 | .*.This.class.will.take.an.addre |
76a0 | 73 73 20 73 74 72 69 6e 67 2c 20 61 6e 64 20 70 61 72 73 65 20 69 74 20 69 6e 74 6f 20 69 74 27 | ss.string,.and.parse.it.into.it' |
76c0 | 73 20 63 6f 6e 73 69 74 75 65 6e 74 0d 0a 2a 20 70 61 72 74 73 2c 20 62 65 20 74 68 61 74 20 65 | s.consituent..*.parts,.be.that.e |
76e0 | 69 74 68 65 72 20 61 64 64 72 65 73 73 65 73 2c 20 67 72 6f 75 70 73 2c 20 6f 72 20 63 6f 6d 62 | ither.addresses,.groups,.or.comb |
7700 | 69 6e 61 74 69 6f 6e 73 2e 20 4e 65 73 74 65 64 20 67 72 6f 75 70 73 0d 0a 2a 20 61 72 65 20 6e | inations..Nested.groups..*.are.n |
7720 | 6f 74 20 73 75 70 70 6f 72 74 65 64 2e 20 54 68 65 20 73 74 72 75 63 74 75 72 65 20 69 74 20 72 | ot.supported..The.structure.it.r |
7740 | 65 74 75 72 6e 73 20 69 73 20 70 72 65 74 74 79 20 73 74 72 61 69 67 68 74 20 66 6f 72 77 61 72 | eturns.is.pretty.straight.forwar |
7760 | 64 2c 0d 0a 2a 20 61 6e 64 20 69 73 20 73 69 6d 69 6c 61 72 20 74 6f 20 74 68 61 74 20 70 72 6f | d,..*.and.is.similar.to.that.pro |
7780 | 76 69 64 65 64 20 62 79 20 74 68 65 20 69 6d 61 70 5f 72 66 63 38 32 32 5f 70 61 72 73 65 5f 61 | vided.by.the.imap_rfc822_parse_a |
77a0 | 64 72 6c 69 73 74 28 29 2e 20 55 73 65 0d 0a 2a 20 70 72 69 6e 74 5f 72 28 29 20 74 6f 20 76 69 | drlist()..Use..*.print_r().to.vi |
77c0 | 65 77 20 74 68 65 20 73 74 72 75 63 74 75 72 65 2e 0d 0a 2a 0d 0a 2a 20 48 6f 77 20 64 6f 20 49 | ew.the.structure...*..*.How.do.I |
77e0 | 20 75 73 65 20 69 74 3f 0d 0a 2a 0d 0a 2a 20 24 61 64 64 72 65 73 73 5f 73 74 72 69 6e 67 20 3d | .use.it?..*..*.$address_string.= |
7800 | 20 27 4d 79 20 47 72 6f 75 70 3a 20 22 52 69 63 68 61 72 64 22 20 3c 72 69 63 68 61 72 64 40 6c | .'My.Group:."Richard".<richard@l |
7820 | 6f 63 61 6c 68 6f 73 74 3e 20 28 41 20 63 6f 6d 6d 65 6e 74 29 2c 20 74 65 64 40 65 78 61 6d 70 | ocalhost>.(A.comment),.ted@examp |
7840 | 6c 65 2e 63 6f 6d 20 28 54 65 64 20 42 6c 6f 67 67 73 29 2c 20 42 61 72 6e 65 79 3b 27 3b 0d 0a | le.com.(Ted.Bloggs),.Barney;';.. |
7860 | 2a 20 24 73 74 72 75 63 74 75 72 65 20 3d 20 4d 61 69 6c 5f 52 46 43 38 32 32 3a 3a 70 61 72 73 | *.$structure.=.Mail_RFC822::pars |
7880 | 65 41 64 64 72 65 73 73 4c 69 73 74 28 24 61 64 64 72 65 73 73 5f 73 74 72 69 6e 67 2c 20 27 65 | eAddressList($address_string,.'e |
78a0 | 78 61 6d 70 6c 65 2e 63 6f 6d 27 2c 20 74 72 75 65 29 0d 0a 2a 20 70 72 69 6e 74 5f 72 28 24 73 | xample.com',.true)..*.print_r($s |
78c0 | 74 72 75 63 74 75 72 65 29 3b 0d 0a 2a 0d 0a 2a 20 40 61 75 74 68 6f 72 20 20 52 69 63 68 61 72 | tructure);..*..*.@author..Richar |
78e0 | 64 20 48 65 79 65 73 20 3c 72 69 63 68 61 72 64 40 70 68 70 67 75 72 75 2e 6f 72 67 3e 0d 0a 2a | d.Heyes.<richard@phpguru.org>..* |
7900 | 20 40 61 75 74 68 6f 72 20 20 43 68 75 63 6b 20 48 61 67 65 6e 62 75 63 68 20 3c 63 68 75 63 6b | .@author..Chuck.Hagenbuch.<chuck |
7920 | 40 68 6f 72 64 65 2e 6f 72 67 3e 0d 0a 2a 20 40 76 65 72 73 69 6f 6e 20 24 52 65 76 69 73 69 6f | @horde.org>..*.@version.$Revisio |
7940 | 6e 3a 20 31 2e 32 20 24 0d 0a 2a 20 40 6c 69 63 65 6e 73 65 20 42 53 44 0d 0a 2a 20 40 70 61 63 | n:.1.2.$..*.@license.BSD..*.@pac |
7960 | 6b 61 67 65 20 4d 61 69 6c 0d 0a 2a 2f 0d 0a 0d 0a 63 6c 61 73 73 20 4d 61 69 6c 5f 52 46 43 38 | kage.Mail..*/....class.Mail_RFC8 |
7980 | 32 32 20 65 78 74 65 6e 64 73 20 50 45 41 52 7b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 | 22.extends.PEAR{......../**..... |
79a0 | 20 20 2a 20 54 68 65 20 61 64 64 72 65 73 73 20 62 65 69 6e 67 20 70 61 72 73 65 64 20 62 79 20 | ..*.The.address.being.parsed.by. |
79c0 | 74 68 65 20 52 46 43 38 32 32 20 6f 62 6a 65 63 74 2e 0d 0a 20 20 20 20 20 2a 20 40 76 61 72 20 | the.RFC822.object........*.@var. |
79e0 | 73 74 72 69 6e 67 20 24 61 64 64 72 65 73 73 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 76 61 | string.$address.......*/......va |
7a00 | 72 20 24 61 64 64 72 65 73 73 20 3d 20 27 27 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 | r.$address.=.'';......../**..... |
7a20 | 20 20 2a 20 54 68 65 20 64 65 66 61 75 6c 74 20 64 6f 6d 61 69 6e 20 74 6f 20 75 73 65 20 66 6f | ..*.The.default.domain.to.use.fo |
7a40 | 72 20 75 6e 71 75 61 6c 69 66 69 65 64 20 61 64 64 72 65 73 73 65 73 2e 0d 0a 20 20 20 20 20 2a | r.unqualified.addresses........* |
7a60 | 20 40 76 61 72 20 73 74 72 69 6e 67 20 24 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 0d 0a 20 20 | .@var.string.$default_domain.... |
7a80 | 20 20 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 20 3d | ...*/......var.$default_domain.= |
7aa0 | 20 27 6c 6f 63 61 6c 68 6f 73 74 27 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a | .'localhost';......../**.......* |
7ac0 | 20 53 68 6f 75 6c 64 20 77 65 20 72 65 74 75 72 6e 20 61 20 6e 65 73 74 65 64 20 61 72 72 61 79 | .Should.we.return.a.nested.array |
7ae0 | 20 73 68 6f 77 69 6e 67 20 67 72 6f 75 70 73 2c 20 6f 72 20 66 6c 61 74 74 65 6e 20 65 76 65 72 | .showing.groups,.or.flatten.ever |
7b00 | 79 74 68 69 6e 67 3f 0d 0a 20 20 20 20 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 20 24 6e 65 | ything?.......*.@var.boolean.$ne |
7b20 | 73 74 47 72 6f 75 70 73 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 6e 65 73 74 | stGroups.......*/......var.$nest |
7b40 | 47 72 6f 75 70 73 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 | Groups.=.true;......../**....... |
7b60 | 2a 20 57 68 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 74 6f | *.Whether.or.not.to.validate.ato |
7b80 | 6d 73 20 66 6f 72 20 6e 6f 6e 2d 61 73 63 69 69 20 63 68 61 72 61 63 74 65 72 73 2e 0d 0a 20 20 | ms.for.non-ascii.characters..... |
7ba0 | 20 20 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 20 24 76 61 6c 69 64 61 74 65 0d 0a 20 20 20 | ...*.@var.boolean.$validate..... |
7bc0 | 20 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 76 61 6c 69 64 61 74 65 20 3d 20 74 72 75 65 3b 0d | ..*/......var.$validate.=.true;. |
7be0 | 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 54 68 65 20 61 72 72 61 79 20 6f 66 20 | ......./**.......*.The.array.of. |
7c00 | 72 61 77 20 61 64 64 72 65 73 73 65 73 20 62 75 69 6c 74 20 75 70 20 61 73 20 77 65 20 70 61 72 | raw.addresses.built.up.as.we.par |
7c20 | 73 65 2e 0d 0a 20 20 20 20 20 2a 20 40 76 61 72 20 61 72 72 61 79 20 24 61 64 64 72 65 73 73 65 | se........*.@var.array.$addresse |
7c40 | 73 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 61 64 64 72 65 73 73 65 73 20 3d | s.......*/......var.$addresses.= |
7c60 | 20 61 72 72 61 79 28 29 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 54 68 65 | .array();......../**.......*.The |
7c80 | 20 66 69 6e 61 6c 20 61 72 72 61 79 20 6f 66 20 70 61 72 73 65 64 20 61 64 64 72 65 73 73 20 69 | .final.array.of.parsed.address.i |
7ca0 | 6e 66 6f 72 6d 61 74 69 6f 6e 20 74 68 61 74 20 77 65 20 62 75 69 6c 64 20 75 70 2e 0d 0a 20 20 | nformation.that.we.build.up..... |
7cc0 | 20 20 20 2a 20 40 76 61 72 20 61 72 72 61 79 20 24 73 74 72 75 63 74 75 72 65 0d 0a 20 20 20 20 | ...*.@var.array.$structure...... |
7ce0 | 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 73 74 72 75 63 74 75 72 65 20 3d 20 61 72 72 61 79 28 | .*/......var.$structure.=.array( |
7d00 | 29 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 54 68 65 20 63 75 72 72 65 6e | );......../**.......*.The.curren |
7d20 | 74 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 2c 20 69 66 20 61 6e 79 2e 0d 0a 20 20 20 20 20 2a | t.error.message,.if.any........* |
7d40 | 20 40 76 61 72 20 73 74 72 69 6e 67 20 24 65 72 72 6f 72 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 | .@var.string.$error.......*/.... |
7d60 | 20 20 76 61 72 20 24 65 72 72 6f 72 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d | ..var.$error.=.null;......../**. |
7d80 | 0a 20 20 20 20 20 2a 20 41 6e 20 69 6e 74 65 72 6e 61 6c 20 63 6f 75 6e 74 65 72 2f 70 6f 69 6e | ......*.An.internal.counter/poin |
7da0 | 74 65 72 2e 0d 0a 20 20 20 20 20 2a 20 40 76 61 72 20 69 6e 74 65 67 65 72 20 24 69 6e 64 65 78 | ter........*.@var.integer.$index |
7dc0 | 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 69 6e 64 65 78 20 3d 20 6e 75 6c 6c | .......*/......var.$index.=.null |
7de0 | 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 54 68 65 20 6e 75 6d 62 65 72 20 | ;......../**.......*.The.number. |
7e00 | 6f 66 20 67 72 6f 75 70 73 20 74 68 61 74 20 68 61 76 65 20 62 65 65 6e 20 66 6f 75 6e 64 20 69 | of.groups.that.have.been.found.i |
7e20 | 6e 20 74 68 65 20 61 64 64 72 65 73 73 20 6c 69 73 74 2e 0d 0a 20 20 20 20 20 2a 20 40 76 61 72 | n.the.address.list........*.@var |
7e40 | 20 69 6e 74 65 67 65 72 20 24 6e 75 6d 5f 67 72 6f 75 70 73 0d 0a 20 20 20 20 20 2a 20 40 61 63 | .integer.$num_groups.......*.@ac |
7e60 | 63 65 73 73 20 70 75 62 6c 69 63 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 6e | cess.public.......*/......var.$n |
7e80 | 75 6d 5f 67 72 6f 75 70 73 20 3d 20 30 3b 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 | um_groups.=.0;......../**....... |
7ea0 | 2a 20 41 20 76 61 72 69 61 62 6c 65 20 73 6f 20 74 68 61 74 20 77 65 20 63 61 6e 20 74 65 6c 6c | *.A.variable.so.that.we.can.tell |
7ec0 | 20 77 68 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 77 65 27 72 65 20 69 6e 73 69 64 65 20 61 0d 0a | .whether.or.not.we're.inside.a.. |
7ee0 | 20 20 20 20 20 2a 20 4d 61 69 6c 5f 52 46 43 38 32 32 20 6f 62 6a 65 63 74 2e 0d 0a 20 20 20 20 | .....*.Mail_RFC822.object....... |
7f00 | 20 2a 20 40 76 61 72 20 62 6f 6f 6c 65 61 6e 20 24 6d 61 69 6c 52 46 43 38 32 32 0d 0a 20 20 20 | .*.@var.boolean.$mailRFC822..... |
7f20 | 20 20 2a 2f 0d 0a 20 20 20 20 76 61 72 20 24 6d 61 69 6c 52 46 43 38 32 32 20 3d 20 74 72 75 65 | ..*/......var.$mailRFC822.=.true |
7f40 | 3b 0d 0a 20 20 20 20 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 2a 20 41 20 6c 69 6d 69 74 20 | ;............/**......*.A.limit. |
7f60 | 61 66 74 65 72 20 77 68 69 63 68 20 70 72 6f 63 65 73 73 69 6e 67 20 73 74 6f 70 73 0d 0a 20 20 | after.which.processing.stops.... |
7f80 | 20 20 2a 20 40 76 61 72 20 69 6e 74 20 24 6c 69 6d 69 74 0d 0a 20 20 20 20 2a 2f 0d 0a 20 20 20 | ..*.@var.int.$limit......*/..... |
7fa0 | 20 76 61 72 20 24 6c 69 6d 69 74 20 3d 20 6e 75 6c 6c 3b 0d 0a 0d 0a 0d 0a 20 20 20 20 2f 2a 2a | .var.$limit.=.null;........../** |
7fc0 | 0d 0a 20 20 20 20 20 2a 20 53 65 74 73 20 75 70 20 74 68 65 20 6f 62 6a 65 63 74 2e 20 54 68 65 | .......*.Sets.up.the.object..The |
7fe0 | 20 61 64 64 72 65 73 73 20 6d 75 73 74 20 65 69 74 68 65 72 20 62 65 20 73 65 74 20 68 65 72 65 | .address.must.either.be.set.here |
8000 | 20 6f 72 20 77 68 65 6e 0d 0a 20 20 20 20 20 2a 20 63 61 6c 6c 69 6e 67 20 70 61 72 73 65 41 64 | .or.when.......*.calling.parseAd |
8020 | 64 72 65 73 73 4c 69 73 74 28 29 2e 20 4f 6e 65 20 6f 72 20 74 68 65 20 6f 74 68 65 72 2e 0d 0a | dressList()..One.or.the.other... |
8040 | 20 20 20 20 20 2a 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0d 0a 20 | .....*.......*.@access.public... |
8060 | 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 61 64 64 72 65 73 73 20 20 20 | ....*.@param.string..$address... |
8080 | 20 20 20 20 20 20 54 68 65 20 61 64 64 72 65 73 73 28 65 73 29 20 74 6f 20 76 61 6c 69 64 61 74 | ......The.address(es).to.validat |
80a0 | 65 2e 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 64 65 66 61 75 | e........*.@param.string..$defau |
80c0 | 6c 74 5f 64 6f 6d 61 69 6e 20 20 44 65 66 61 75 6c 74 20 64 6f 6d 61 69 6e 2f 68 6f 73 74 20 65 | lt_domain..Default.domain/host.e |
80e0 | 74 63 2e 20 49 66 20 6e 6f 74 20 73 75 70 70 6c 69 65 64 2c 20 77 69 6c 6c 20 62 65 20 73 65 74 | tc..If.not.supplied,.will.be.set |
8100 | 20 74 6f 20 6c 6f 63 61 6c 68 6f 73 74 2e 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 62 6f | .to.localhost........*.@param.bo |
8120 | 6f 6c 65 61 6e 20 24 6e 65 73 74 5f 67 72 6f 75 70 73 20 20 20 20 20 57 68 65 74 68 65 72 20 74 | olean.$nest_groups.....Whether.t |
8140 | 6f 20 72 65 74 75 72 6e 20 74 68 65 20 73 74 72 75 63 74 75 72 65 20 77 69 74 68 20 67 72 6f 75 | o.return.the.structure.with.grou |
8160 | 70 73 20 6e 65 73 74 65 64 20 66 6f 72 20 65 61 73 69 65 72 20 76 69 65 77 69 6e 67 2e 0d 0a 20 | ps.nested.for.easier.viewing.... |
8180 | 20 20 20 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 76 61 6c 69 64 61 74 65 20 20 | ....*.@param.boolean.$validate.. |
81a0 | 20 20 20 20 20 20 57 68 65 74 68 65 72 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 74 6f 6d 73 2e | ......Whether.to.validate.atoms. |
81c0 | 20 54 75 72 6e 20 74 68 69 73 20 6f 66 66 20 69 66 20 79 6f 75 20 6e 65 65 64 20 74 6f 20 72 75 | .Turn.this.off.if.you.need.to.ru |
81e0 | 6e 20 61 64 64 72 65 73 73 65 73 20 74 68 72 6f 75 67 68 20 62 65 66 6f 72 65 20 65 6e 63 6f 64 | n.addresses.through.before.encod |
8200 | 69 6e 67 20 74 68 65 20 70 65 72 73 6f 6e 61 6c 20 6e 61 6d 65 73 2c 20 66 6f 72 20 69 6e 73 74 | ing.the.personal.names,.for.inst |
8220 | 61 6e 63 65 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6f | ance........*........*.@return.o |
8240 | 62 6a 65 63 74 20 4d 61 69 6c 5f 52 46 43 38 32 32 20 41 20 6e 65 77 20 4d 61 69 6c 5f 52 46 43 | bject.Mail_RFC822.A.new.Mail_RFC |
8260 | 38 32 32 20 6f 62 6a 65 63 74 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 | 822.object........*/......functi |
8280 | 6f 6e 20 4d 61 69 6c 5f 52 46 43 38 32 32 28 24 61 64 64 72 65 73 73 20 3d 20 6e 75 6c 6c 2c 20 | on.Mail_RFC822($address.=.null,. |
82a0 | 24 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 20 3d 20 6e 75 6c 6c 2c 20 24 6e 65 73 74 5f 67 72 | $default_domain.=.null,.$nest_gr |
82c0 | 6f 75 70 73 20 3d 20 6e 75 6c 6c 2c 20 24 76 61 6c 69 64 61 74 65 20 3d 20 6e 75 6c 6c 2c 20 24 | oups.=.null,.$validate.=.null,.$ |
82e0 | 6c 69 6d 69 74 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 | limit.=.null)......{..........if |
8300 | 20 28 69 73 73 65 74 28 24 61 64 64 72 65 73 73 29 29 20 20 20 20 20 20 20 20 24 74 68 69 73 2d | .(isset($address))........$this- |
8320 | 3e 61 64 64 72 65 73 73 20 20 20 20 20 20 20 20 3d 20 24 61 64 64 72 65 73 73 3b 0d 0a 20 20 20 | >address........=.$address;..... |
8340 | 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 29 29 | .....if.(isset($default_domain)) |
8360 | 20 24 74 68 69 73 2d 3e 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 20 3d 20 24 64 65 66 61 75 6c | .$this->default_domain.=.$defaul |
8380 | 74 5f 64 6f 6d 61 69 6e 3b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 6e 65 | t_domain;..........if.(isset($ne |
83a0 | 73 74 5f 67 72 6f 75 70 73 29 29 20 20 20 20 24 74 68 69 73 2d 3e 6e 65 73 74 47 72 6f 75 70 73 | st_groups))....$this->nestGroups |
83c0 | 20 20 20 20 20 3d 20 24 6e 65 73 74 5f 67 72 6f 75 70 73 3b 0d 0a 20 20 20 20 20 20 20 20 69 66 | .....=.$nest_groups;..........if |
83e0 | 20 28 69 73 73 65 74 28 24 76 61 6c 69 64 61 74 65 29 29 20 20 20 20 20 20 20 24 74 68 69 73 2d | .(isset($validate)).......$this- |
8400 | 3e 76 61 6c 69 64 61 74 65 20 20 20 20 20 20 20 3d 20 24 76 61 6c 69 64 61 74 65 3b 0d 0a 20 20 | >validate.......=.$validate;.... |
8420 | 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 6c 69 6d 69 74 29 29 20 20 20 20 20 20 20 20 | ......if.(isset($limit))........ |
8440 | 20 20 24 74 68 69 73 2d 3e 6c 69 6d 69 74 20 20 20 20 20 20 20 20 20 20 3d 20 24 6c 69 6d 69 74 | ..$this->limit..........=.$limit |
8460 | 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 53 74 | ;......}........../**.......*.St |
8480 | 61 72 74 73 20 74 68 65 20 77 68 6f 6c 65 20 70 72 6f 63 65 73 73 2e 20 54 68 65 20 61 64 64 72 | arts.the.whole.process..The.addr |
84a0 | 65 73 73 20 6d 75 73 74 20 65 69 74 68 65 72 20 62 65 20 73 65 74 20 68 65 72 65 0d 0a 20 20 20 | ess.must.either.be.set.here..... |
84c0 | 20 20 2a 20 6f 72 20 77 68 65 6e 20 63 72 65 61 74 69 6e 67 20 74 68 65 20 6f 62 6a 65 63 74 2e | ..*.or.when.creating.the.object. |
84e0 | 20 4f 6e 65 20 6f 72 20 74 68 65 20 6f 74 68 65 72 2e 0d 0a 20 20 20 20 20 2a 0d 0a 20 20 20 20 | .One.or.the.other........*...... |
8500 | 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d | .*.@access.public.......*.@param |
8520 | 20 73 74 72 69 6e 67 20 20 24 61 64 64 72 65 73 73 20 20 20 20 20 20 20 20 20 54 68 65 20 61 64 | .string..$address.........The.ad |
8540 | 64 72 65 73 73 28 65 73 29 20 74 6f 20 76 61 6c 69 64 61 74 65 2e 0d 0a 20 20 20 20 20 2a 20 40 | dress(es).to.validate........*.@ |
8560 | 70 61 72 61 6d 20 73 74 72 69 6e 67 20 20 24 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 20 20 44 | param.string..$default_domain..D |
8580 | 65 66 61 75 6c 74 20 64 6f 6d 61 69 6e 2f 68 6f 73 74 20 65 74 63 2e 0d 0a 20 20 20 20 20 2a 20 | efault.domain/host.etc........*. |
85a0 | 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 6e 65 73 74 5f 67 72 6f 75 70 73 20 20 20 20 20 | @param.boolean.$nest_groups..... |
85c0 | 57 68 65 74 68 65 72 20 74 6f 20 72 65 74 75 72 6e 20 74 68 65 20 73 74 72 75 63 74 75 72 65 20 | Whether.to.return.the.structure. |
85e0 | 77 69 74 68 20 67 72 6f 75 70 73 20 6e 65 73 74 65 64 20 66 6f 72 20 65 61 73 69 65 72 20 76 69 | with.groups.nested.for.easier.vi |
8600 | 65 77 69 6e 67 2e 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 62 6f 6f 6c 65 61 6e 20 24 76 | ewing........*.@param.boolean.$v |
8620 | 61 6c 69 64 61 74 65 20 20 20 20 20 20 20 20 57 68 65 74 68 65 72 20 74 6f 20 76 61 6c 69 64 61 | alidate........Whether.to.valida |
8640 | 74 65 20 61 74 6f 6d 73 2e 20 54 75 72 6e 20 74 68 69 73 20 6f 66 66 20 69 66 20 79 6f 75 20 6e | te.atoms..Turn.this.off.if.you.n |
8660 | 65 65 64 20 74 6f 20 72 75 6e 20 61 64 64 72 65 73 73 65 73 20 74 68 72 6f 75 67 68 20 62 65 66 | eed.to.run.addresses.through.bef |
8680 | 6f 72 65 20 65 6e 63 6f 64 69 6e 67 20 74 68 65 20 70 65 72 73 6f 6e 61 6c 20 6e 61 6d 65 73 2c | ore.encoding.the.personal.names, |
86a0 | 20 66 6f 72 20 69 6e 73 74 61 6e 63 65 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 | .for.instance........*........*. |
86c0 | 40 72 65 74 75 72 6e 20 61 72 72 61 79 20 41 20 73 74 72 75 63 74 75 72 65 64 20 61 72 72 61 79 | @return.array.A.structured.array |
86e0 | 20 6f 66 20 61 64 64 72 65 73 73 65 73 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e | .of.addresses........*/......fun |
8700 | 63 74 69 6f 6e 20 70 61 72 73 65 41 64 64 72 65 73 73 4c 69 73 74 28 24 61 64 64 72 65 73 73 20 | ction.parseAddressList($address. |
8720 | 3d 20 6e 75 6c 6c 2c 20 24 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 20 3d 20 6e 75 6c 6c 2c 20 | =.null,.$default_domain.=.null,. |
8740 | 24 6e 65 73 74 5f 67 72 6f 75 70 73 20 3d 20 6e 75 6c 6c 2c 20 24 76 61 6c 69 64 61 74 65 20 3d | $nest_groups.=.null,.$validate.= |
8760 | 20 6e 75 6c 6c 2c 20 24 6c 69 6d 69 74 20 3d 20 6e 75 6c 6c 29 0d 0a 20 20 20 20 7b 0d 0a 0d 0a | .null,.$limit.=.null)......{.... |
8780 | 20 20 20 20 20 20 20 20 69 66 20 28 21 69 73 73 65 74 28 24 74 68 69 73 2d 3e 6d 61 69 6c 52 46 | ........if.(!isset($this->mailRF |
87a0 | 43 38 32 32 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6f 62 6a 20 3d 20 6e 65 77 | C822)).{..............$obj.=.new |
87c0 | 20 4d 61 69 6c 5f 52 46 43 38 32 32 28 24 61 64 64 72 65 73 73 2c 20 24 64 65 66 61 75 6c 74 5f | .Mail_RFC822($address,.$default_ |
87e0 | 64 6f 6d 61 69 6e 2c 20 24 6e 65 73 74 5f 67 72 6f 75 70 73 2c 20 24 76 61 6c 69 64 61 74 65 2c | domain,.$nest_groups,.$validate, |
8800 | 20 24 6c 69 6d 69 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 6f | .$limit);..............return.$o |
8820 | 62 6a 2d 3e 70 61 72 73 65 41 64 64 72 65 73 73 4c 69 73 74 28 29 3b 0d 0a 20 20 20 20 20 20 20 | bj->parseAddressList();......... |
8840 | 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 61 64 64 72 65 73 73 | .}............if.(isset($address |
8860 | 29 29 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 61 64 64 72 65 73 73 20 20 20 20 20 20 20 20 | ))........$this->address........ |
8880 | 3d 20 24 61 64 64 72 65 73 73 3b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 | =.$address;..........if.(isset($ |
88a0 | 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 29 29 20 24 74 68 69 73 2d 3e 64 65 66 61 75 6c 74 5f | default_domain)).$this->default_ |
88c0 | 64 6f 6d 61 69 6e 20 3d 20 24 64 65 66 61 75 6c 74 5f 64 6f 6d 61 69 6e 3b 0d 0a 20 20 20 20 20 | domain.=.$default_domain;....... |
88e0 | 20 20 20 69 66 20 28 69 73 73 65 74 28 24 6e 65 73 74 5f 67 72 6f 75 70 73 29 29 20 20 20 20 24 | ...if.(isset($nest_groups))....$ |
8900 | 74 68 69 73 2d 3e 6e 65 73 74 47 72 6f 75 70 73 20 20 20 20 20 3d 20 24 6e 65 73 74 5f 67 72 6f | this->nestGroups.....=.$nest_gro |
8920 | 75 70 73 3b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 76 61 6c 69 64 61 74 | ups;..........if.(isset($validat |
8940 | 65 29 29 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 76 61 6c 69 64 61 74 65 20 20 20 20 20 20 20 | e)).......$this->validate....... |
8960 | 3d 20 24 76 61 6c 69 64 61 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 | =.$validate;..........if.(isset( |
8980 | 24 6c 69 6d 69 74 29 29 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 6c 69 6d 69 74 20 20 | $limit))..........$this->limit.. |
89a0 | 20 20 20 20 20 20 20 20 3d 20 24 6c 69 6d 69 74 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 24 74 68 | ........=.$limit;............$th |
89c0 | 69 73 2d 3e 73 74 72 75 63 74 75 72 65 20 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 20 20 20 20 20 | is->structure..=.array();....... |
89e0 | 20 20 20 24 74 68 69 73 2d 3e 61 64 64 72 65 73 73 65 73 20 20 3d 20 61 72 72 61 79 28 29 3b 0d | ...$this->addresses..=.array();. |
8a00 | 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 65 72 72 6f 72 20 20 20 20 20 20 3d 20 6e 75 6c | .........$this->error......=.nul |
8a20 | 6c 3b 0d 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 69 6e 64 65 78 20 20 20 20 20 20 3d 20 | l;..........$this->index......=. |
8a40 | 6e 75 6c 6c 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 24 74 68 69 73 2d 3e 61 | null;............while.($this->a |
8a60 | 64 64 72 65 73 73 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 41 64 64 72 65 73 73 65 73 28 | ddress.=.$this->_splitAddresses( |
8a80 | 24 74 68 69 73 2d 3e 61 64 64 72 65 73 73 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | $this->address)).{.............. |
8aa0 | 63 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 0d 0a | continue;..........}............ |
8ac0 | 20 20 20 20 20 20 20 20 69 66 20 28 24 74 68 69 73 2d 3e 61 64 64 72 65 73 73 20 3d 3d 3d 20 66 | ........if.($this->address.===.f |
8ae0 | 61 6c 73 65 20 7c 7c 20 69 73 73 65 74 28 24 74 68 69 73 2d 3e 65 72 72 6f 72 29 29 20 7b 0d 0a | alse.||.isset($this->error)).{.. |
8b00 | 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 | ............return.$this->raiseE |
8b20 | 72 72 6f 72 28 24 74 68 69 73 2d 3e 65 72 72 6f 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a | rror($this->error);..........}.. |
8b40 | 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 52 65 73 65 74 20 74 69 6d 65 72 20 73 69 6e 63 65 20 6c | ..........//.Reset.timer.since.l |
8b60 | 61 72 67 65 20 61 6d 6f 75 6e 74 73 20 6f 66 20 61 64 64 72 65 73 73 65 73 20 63 61 6e 20 74 61 | arge.amounts.of.addresses.can.ta |
8b80 | 6b 65 20 61 20 6c 6f 6e 67 20 74 69 6d 65 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 67 65 | ke.a.long.time.to..........//.ge |
8ba0 | 74 20 68 65 72 65 0d 0a 20 20 20 20 20 20 20 20 73 65 74 5f 74 69 6d 65 5f 6c 69 6d 69 74 28 33 | t.here..........set_time_limit(3 |
8bc0 | 30 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4c 6f 6f 70 20 74 68 72 6f 75 67 68 20 61 | 0);............//.Loop.through.a |
8be0 | 6c 6c 20 74 68 65 20 61 64 64 72 65 73 73 65 73 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 24 | ll.the.addresses..........for.($ |
8c00 | 69 20 3d 20 30 3b 20 24 69 20 3c 20 63 6f 75 6e 74 28 24 74 68 69 73 2d 3e 61 64 64 72 65 73 73 | i.=.0;.$i.<.count($this->address |
8c20 | 65 73 29 3b 20 24 69 2b 2b 29 7b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 | es);.$i++){................if.(( |
8c40 | 24 72 65 74 75 72 6e 20 3d 20 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 41 64 64 72 65 73 | $return.=.$this->_validateAddres |
8c60 | 73 28 24 74 68 69 73 2d 3e 61 64 64 72 65 73 73 65 73 5b 24 69 5d 29 29 20 3d 3d 3d 20 66 61 6c | s($this->addresses[$i])).===.fal |
8c80 | 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7c 7c 20 69 73 73 65 74 28 24 74 68 | se..................||.isset($th |
8ca0 | 69 73 2d 3e 65 72 72 6f 72 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 | is->error)).{..................r |
8cc0 | 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 72 61 69 73 65 45 72 72 6f 72 28 24 74 68 69 73 2d 3e 65 | eturn.$this->raiseError($this->e |
8ce0 | 72 72 6f 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 | rror);..............}........... |
8d00 | 20 20 20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e 6e 65 73 | .................if.(!$this->nes |
8d20 | 74 47 72 6f 75 70 73 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 | tGroups).{..................$thi |
8d40 | 73 2d 3e 73 74 72 75 63 74 75 72 65 20 3d 20 61 72 72 61 79 5f 6d 65 72 67 65 28 24 74 68 69 73 | s->structure.=.array_merge($this |
8d60 | 2d 3e 73 74 72 75 63 74 75 72 65 2c 20 24 72 65 74 75 72 6e 29 3b 0d 0a 20 20 20 20 20 20 20 20 | ->structure,.$return);.......... |
8d80 | 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 | ....}.else.{..................$t |
8da0 | 68 69 73 2d 3e 73 74 72 75 63 74 75 72 65 5b 5d 20 3d 20 24 72 65 74 75 72 6e 3b 0d 0a 20 20 20 | his->structure[].=.$return;..... |
8dc0 | 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 | .........}..........}........... |
8de0 | 20 72 65 74 75 72 6e 20 24 74 68 69 73 2d 3e 73 74 72 75 63 74 75 72 65 3b 0d 0a 20 20 20 20 7d | .return.$this->structure;......} |
8e00 | 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 53 70 6c 69 74 73 20 61 6e 20 61 64 | ......../**.......*.Splits.an.ad |
8e20 | 64 72 65 73 73 20 69 6e 74 6f 20 73 65 70 65 72 61 74 65 20 61 64 64 72 65 73 73 65 73 2e 0d 0a | dress.into.seperate.addresses... |
8e40 | 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d | .....*........*.@access.private. |
8e60 | 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 61 64 64 72 65 73 73 20 54 | ......*.@param.string.$address.T |
8e80 | 68 65 20 61 64 64 72 65 73 73 65 73 20 74 6f 20 73 70 6c 69 74 2e 0d 0a 20 20 20 20 20 2a 20 40 | he.addresses.to.split........*.@ |
8ea0 | 72 65 74 75 72 6e 20 62 6f 6f 6c 65 61 6e 20 53 75 63 63 65 73 73 20 6f 72 20 66 61 69 6c 75 72 | return.boolean.Success.or.failur |
8ec0 | 65 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 73 70 6c 69 74 | e........*/......function._split |
8ee0 | 41 64 64 72 65 73 73 65 73 28 24 61 64 64 72 65 73 73 29 0d 0a 20 20 20 20 7b 0d 0a 0d 0a 20 20 | Addresses($address)......{...... |
8f00 | 20 20 20 20 20 20 69 66 20 28 21 65 6d 70 74 79 28 24 74 68 69 73 2d 3e 6c 69 6d 69 74 29 20 41 | ......if.(!empty($this->limit).A |
8f20 | 4e 44 20 63 6f 75 6e 74 28 24 74 68 69 73 2d 3e 61 64 64 72 65 73 73 65 73 29 20 3d 3d 20 24 74 | ND.count($this->addresses).==.$t |
8f40 | 68 69 73 2d 3e 6c 69 6d 69 74 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 | his->limit).{..............retur |
8f60 | 6e 20 27 27 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 | n.'';..........}............if.( |
8f80 | 24 74 68 69 73 2d 3e 5f 69 73 47 72 6f 75 70 28 24 61 64 64 72 65 73 73 29 20 26 26 20 21 69 73 | $this->_isGroup($address).&&.!is |
8fa0 | 73 65 74 28 24 74 68 69 73 2d 3e 65 72 72 6f 72 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | set($this->error)).{............ |
8fc0 | 20 20 24 73 70 6c 69 74 5f 63 68 61 72 20 3d 20 27 3b 27 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 | ..$split_char.=.';';............ |
8fe0 | 20 20 24 69 73 5f 67 72 6f 75 70 20 20 20 3d 20 74 72 75 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d | ..$is_group...=.true;..........} |
9000 | 20 65 6c 73 65 69 66 20 28 21 69 73 73 65 74 28 24 74 68 69 73 2d 3e 65 72 72 6f 72 29 29 20 7b | .elseif.(!isset($this->error)).{ |
9020 | 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 73 70 6c 69 74 5f 63 68 61 72 20 3d 20 27 2c 27 3b | ..............$split_char.=.','; |
9040 | 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 69 73 5f 67 72 6f 75 70 20 20 20 3d 20 66 61 6c 73 | ..............$is_group...=.fals |
9060 | 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 69 66 20 28 69 73 73 65 74 28 24 74 68 69 | e;..........}.elseif.(isset($thi |
9080 | 73 2d 3e 65 72 72 6f 72 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | s->error)).{..............return |
90a0 | 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f | .false;..........}............// |
90c0 | 20 53 70 6c 69 74 20 74 68 65 20 73 74 72 69 6e 67 20 62 61 73 65 64 20 6f 6e 20 74 68 65 20 61 | .Split.the.string.based.on.the.a |
90e0 | 62 6f 76 65 20 74 65 6e 20 6f 72 20 73 6f 20 6c 69 6e 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 24 | bove.ten.or.so.lines...........$ |
9100 | 70 61 72 74 73 20 20 3d 20 65 78 70 6c 6f 64 65 28 24 73 70 6c 69 74 5f 63 68 61 72 2c 20 24 61 | parts..=.explode($split_char,.$a |
9120 | 64 64 72 65 73 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 24 73 74 72 69 6e 67 20 3d 20 24 74 68 69 | ddress);..........$string.=.$thi |
9140 | 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 73 2c 20 24 73 70 6c 69 74 5f 63 68 | s->_splitCheck($parts,.$split_ch |
9160 | 61 72 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 61 20 67 72 6f 75 70 2e 2e 2e | ar);............//.If.a.group... |
9180 | 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 69 73 5f 67 72 6f 75 70 29 20 7b 0d 0a 20 20 20 20 | ..........if.($is_group).{...... |
91a0 | 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 24 73 74 72 69 6e 67 20 64 6f 65 73 20 6e 6f 74 20 63 | ........//.If.$string.does.not.c |
91c0 | 6f 6e 74 61 69 6e 20 61 20 63 6f 6c 6f 6e 20 6f 75 74 73 69 64 65 20 6f 66 0d 0a 20 20 20 20 20 | ontain.a.colon.outside.of....... |
91e0 | 20 20 20 20 20 20 20 2f 2f 20 62 72 61 63 6b 65 74 73 2f 71 75 6f 74 65 73 20 65 74 63 20 74 68 | .......//.brackets/quotes.etc.th |
9200 | 65 6e 20 73 6f 6d 65 74 68 69 6e 67 27 73 20 66 75 62 61 72 2e 0d 0a 0d 0a 20 20 20 20 20 20 20 | en.something's.fubar............ |
9220 | 20 20 20 20 20 2f 2f 20 46 69 72 73 74 20 63 68 65 63 6b 20 74 68 65 72 65 27 73 20 61 20 63 6f | .....//.First.check.there's.a.co |
9240 | 6c 6f 6e 20 61 74 20 61 6c 6c 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 | lon.at.all:..............if.(str |
9260 | 70 6f 73 28 24 73 74 72 69 6e 67 2c 20 27 3a 27 29 20 3d 3d 3d 20 66 61 6c 73 65 29 20 7b 0d 0a | pos($string,.':').===.false).{.. |
9280 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 65 72 72 6f 72 20 3d 20 27 | ................$this->error.=.' |
92a0 | 49 6e 76 61 6c 69 64 20 61 64 64 72 65 73 73 3a 20 27 20 2e 20 24 73 74 72 69 6e 67 3b 0d 0a 20 | Invalid.address:.'...$string;... |
92c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 | ...............return.false;.... |
92e0 | 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f | ..........}................//.No |
9300 | 77 20 63 68 65 63 6b 20 69 74 27 73 20 6f 75 74 73 69 64 65 20 6f 66 20 62 72 61 63 6b 65 74 73 | w.check.it's.outside.of.brackets |
9320 | 2f 71 75 6f 74 65 73 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 24 74 68 69 73 | /quotes:..............if.(!$this |
9340 | 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 65 78 70 6c 6f 64 65 28 27 3a 27 2c 20 24 73 74 72 69 | ->_splitCheck(explode(':',.$stri |
9360 | 6e 67 29 2c 20 27 3a 27 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 | ng),.':'))..................retu |
9380 | 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 57 65 20 6d | rn.false;................//.We.m |
93a0 | 75 73 74 20 68 61 76 65 20 61 20 67 72 6f 75 70 20 61 74 20 74 68 69 73 20 70 6f 69 6e 74 2c 20 | ust.have.a.group.at.this.point,. |
93c0 | 73 6f 20 69 6e 63 72 65 61 73 65 20 74 68 65 20 63 6f 75 6e 74 65 72 3a 0d 0a 20 20 20 20 20 20 | so.increase.the.counter:........ |
93e0 | 20 20 20 20 20 20 24 74 68 69 73 2d 3e 6e 75 6d 5f 67 72 6f 75 70 73 2b 2b 3b 0d 0a 20 20 20 20 | ......$this->num_groups++;...... |
9400 | 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 24 73 74 72 69 6e 67 20 6e 6f 77 20 | ....}............//.$string.now. |
9420 | 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 66 69 72 73 74 20 66 75 6c 6c 20 61 64 64 72 65 73 73 2f | contains.the.first.full.address/ |
9440 | 67 72 6f 75 70 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 74 6f 20 74 68 65 20 61 64 | group...........//.Add.to.the.ad |
9460 | 64 72 65 73 73 65 73 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 61 | dresses.array...........$this->a |
9480 | 64 64 72 65 73 73 65 73 5b 5d 20 3d 20 61 72 72 61 79 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | ddresses[].=.array(............. |
94a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 61 64 64 72 65 73 73 | ........................'address |
94c0 | 27 20 3d 3e 20 74 72 69 6d 28 24 73 74 72 69 6e 67 29 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | '.=>.trim($string),............. |
94e0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 27 67 72 6f 75 70 27 20 | ........................'group'. |
9500 | 20 20 3d 3e 20 24 69 73 5f 67 72 6f 75 70 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ..=>.$is_group.................. |
9520 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 | ...................);........... |
9540 | 20 2f 2f 20 52 65 6d 6f 76 65 20 74 68 65 20 6e 6f 77 20 73 74 6f 72 65 64 20 61 64 64 72 65 73 | .//.Remove.the.now.stored.addres |
9560 | 73 20 66 72 6f 6d 20 74 68 65 20 69 6e 69 74 69 61 6c 20 6c 69 6e 65 2c 20 74 68 65 20 2b 31 0d | s.from.the.initial.line,.the.+1. |
9580 | 0a 20 20 20 20 20 20 20 20 2f 2f 20 69 73 20 74 6f 20 61 63 63 6f 75 6e 74 20 66 6f 72 20 74 68 | .........//.is.to.account.for.th |
95a0 | 65 20 65 78 70 6c 6f 64 65 20 63 68 61 72 61 63 74 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 24 61 | e.explode.character...........$a |
95c0 | 64 64 72 65 73 73 20 3d 20 74 72 69 6d 28 73 75 62 73 74 72 28 24 61 64 64 72 65 73 73 2c 20 73 | ddress.=.trim(substr($address,.s |
95e0 | 74 72 6c 65 6e 28 24 73 74 72 69 6e 67 29 20 2b 20 31 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 | trlen($string).+.1));........... |
9600 | 20 2f 2f 20 49 66 20 74 68 65 20 6e 65 78 74 20 63 68 61 72 20 69 73 20 61 20 63 6f 6d 6d 61 20 | .//.If.the.next.char.is.a.comma. |
9620 | 61 6e 64 20 74 68 69 73 20 77 61 73 20 61 20 67 72 6f 75 70 2c 20 74 68 65 6e 0d 0a 20 20 20 20 | and.this.was.a.group,.then...... |
9640 | 20 20 20 20 2f 2f 20 74 68 65 72 65 20 61 72 65 20 6d 6f 72 65 20 61 64 64 72 65 73 73 65 73 2c | ....//.there.are.more.addresses, |
9660 | 20 6f 74 68 65 72 77 69 73 65 2c 20 69 66 20 74 68 65 72 65 20 61 72 65 20 61 6e 79 20 6d 6f 72 | .otherwise,.if.there.are.any.mor |
9680 | 65 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 63 68 61 72 73 2c 20 74 68 65 6e 20 74 68 65 72 65 20 | e..........//.chars,.then.there. |
96a0 | 69 73 20 61 6e 6f 74 68 65 72 20 61 64 64 72 65 73 73 2e 0d 0a 20 20 20 20 20 20 20 20 69 66 20 | is.another.address...........if. |
96c0 | 28 24 69 73 5f 67 72 6f 75 70 20 26 26 20 73 75 62 73 74 72 28 24 61 64 64 72 65 73 73 2c 20 30 | ($is_group.&&.substr($address,.0 |
96e0 | 2c 20 31 29 20 3d 3d 20 27 2c 27 29 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 61 64 64 72 | ,.1).==.','){..............$addr |
9700 | 65 73 73 20 3d 20 74 72 69 6d 28 73 75 62 73 74 72 28 24 61 64 64 72 65 73 73 2c 20 31 29 29 3b | ess.=.trim(substr($address,.1)); |
9720 | 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 61 64 64 72 65 73 73 3b 0d 0a | ..............return.$address;.. |
9740 | 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 69 66 20 28 73 74 72 6c 65 6e 28 24 61 64 64 72 | ..........}.elseif.(strlen($addr |
9760 | 65 73 73 29 20 3e 20 30 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | ess).>.0).{..............return. |
9780 | 24 61 64 64 72 65 73 73 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 | $address;............}.else.{... |
97a0 | 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 27 27 3b 0d 0a 20 20 20 20 20 20 20 20 7d | ...........return.'';..........} |
97c0 | 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 79 6f 75 20 67 6f 74 20 68 65 72 65 20 74 | ............//.If.you.got.here.t |
97e0 | 68 65 6e 20 73 6f 6d 65 74 68 69 6e 67 27 73 20 6f 66 66 0d 0a 20 20 20 20 20 20 20 20 72 65 74 | hen.something's.off..........ret |
9800 | 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 | urn.false;......}......../**.... |
9820 | 20 20 20 2a 20 43 68 65 63 6b 73 20 66 6f 72 20 61 20 67 72 6f 75 70 20 61 74 20 74 68 65 20 73 | ...*.Checks.for.a.group.at.the.s |
9840 | 74 61 72 74 20 6f 66 20 74 68 65 20 73 74 72 69 6e 67 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 | tart.of.the.string........*..... |
9860 | 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 | ...*.@access.private.......*.@pa |
9880 | 72 61 6d 20 73 74 72 69 6e 67 20 24 61 64 64 72 65 73 73 20 54 68 65 20 61 64 64 72 65 73 73 20 | ram.string.$address.The.address. |
98a0 | 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 62 6f 6f 6c 65 61 | to.check........*.@return.boolea |
98c0 | 6e 20 57 68 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 74 68 65 72 65 20 69 73 20 61 20 67 72 6f 75 | n.Whether.or.not.there.is.a.grou |
98e0 | 70 20 61 74 20 74 68 65 20 73 74 61 72 74 20 6f 66 20 74 68 65 20 73 74 72 69 6e 67 2e 0d 0a 20 | p.at.the.start.of.the.string.... |
9900 | 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 69 73 47 72 6f 75 70 28 24 61 | ....*/......function._isGroup($a |
9920 | 64 64 72 65 73 73 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 46 69 72 73 74 | ddress)......{..........//.First |
9940 | 20 63 6f 6d 6d 61 20 6e 6f 74 20 69 6e 20 71 75 6f 74 65 73 2c 20 61 6e 67 6c 65 73 20 6f 72 20 | .comma.not.in.quotes,.angles.or. |
9960 | 65 73 63 61 70 65 64 3a 0d 0a 20 20 20 20 20 20 20 20 24 70 61 72 74 73 20 20 3d 20 65 78 70 6c | escaped:..........$parts..=.expl |
9980 | 6f 64 65 28 27 2c 27 2c 20 24 61 64 64 72 65 73 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 24 73 74 | ode(',',.$address);..........$st |
99a0 | 72 69 6e 67 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 73 | ring.=.$this->_splitCheck($parts |
99c0 | 2c 20 27 2c 27 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 77 20 77 65 20 68 61 76 | ,.',');............//.Now.we.hav |
99e0 | 65 20 74 68 65 20 66 69 72 73 74 20 61 64 64 72 65 73 73 2c 20 77 65 20 63 61 6e 20 72 65 6c 69 | e.the.first.address,.we.can.reli |
9a00 | 61 62 6c 79 20 63 68 65 63 6b 20 66 6f 72 20 61 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 67 72 6f | ably.check.for.a..........//.gro |
9a20 | 75 70 20 62 79 20 73 65 61 72 63 68 69 6e 67 20 66 6f 72 20 61 20 63 6f 6c 6f 6e 20 74 68 61 74 | up.by.searching.for.a.colon.that |
9a40 | 27 73 20 6e 6f 74 20 65 73 63 61 70 65 64 20 6f 72 20 69 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f | 's.not.escaped.or.in..........// |
9a60 | 20 71 75 6f 74 65 73 20 6f 72 20 61 6e 67 6c 65 20 62 72 61 63 6b 65 74 73 2e 0d 0a 20 20 20 20 | .quotes.or.angle.brackets....... |
9a80 | 20 20 20 20 69 66 20 28 63 6f 75 6e 74 28 24 70 61 72 74 73 20 3d 20 65 78 70 6c 6f 64 65 28 27 | ....if.(count($parts.=.explode(' |
9aa0 | 3a 27 2c 20 24 73 74 72 69 6e 67 29 29 20 3e 20 31 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | :',.$string)).>.1).{............ |
9ac0 | 20 20 24 73 74 72 69 6e 67 32 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 | ..$string2.=.$this->_splitCheck( |
9ae0 | 24 70 61 72 74 73 2c 20 27 3a 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 | $parts,.':');..............retur |
9b00 | 6e 20 28 24 73 74 72 69 6e 67 32 20 21 3d 3d 20 24 73 74 72 69 6e 67 29 3b 0d 0a 20 20 20 20 20 | n.($string2.!==.$string);....... |
9b20 | 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | ...}.else.{..............return. |
9b40 | 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 | false;..........}......}........ |
9b60 | 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 41 20 63 6f 6d 6d 6f 6e 20 66 75 6e 63 74 69 6f 6e 20 74 68 | /**.......*.A.common.function.th |
9b80 | 61 74 20 77 69 6c 6c 20 63 68 65 63 6b 20 61 6e 20 65 78 70 6c 6f 64 65 64 20 73 74 72 69 6e 67 | at.will.check.an.exploded.string |
9ba0 | 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 | ........*........*.@access.priva |
9bc0 | 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 61 72 72 61 79 20 24 70 61 72 74 73 20 54 | te.......*.@param.array.$parts.T |
9be0 | 68 65 20 65 78 6c 6f 64 65 64 20 73 74 72 69 6e 67 2e 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 | he.exloded.string........*.@para |
9c00 | 6d 20 73 74 72 69 6e 67 20 24 63 68 61 72 20 20 54 68 65 20 63 68 61 72 20 74 68 61 74 20 77 61 | m.string.$char..The.char.that.wa |
9c20 | 73 20 65 78 70 6c 6f 64 65 64 20 6f 6e 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d | s.exploded.on........*.@return.m |
9c40 | 69 78 65 64 20 46 61 6c 73 65 20 69 66 20 74 68 65 20 73 74 72 69 6e 67 20 63 6f 6e 74 61 69 6e | ixed.False.if.the.string.contain |
9c60 | 73 20 75 6e 63 6c 6f 73 65 64 20 71 75 6f 74 65 73 2f 62 72 61 63 6b 65 74 73 2c 20 6f 72 20 74 | s.unclosed.quotes/brackets,.or.t |
9c80 | 68 65 20 73 74 72 69 6e 67 20 6f 6e 20 73 75 63 63 65 73 73 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a | he.string.on.success........*/.. |
9ca0 | 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 73 2c | ....function._splitCheck($parts, |
9cc0 | 20 24 63 68 61 72 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 24 73 74 72 69 6e 67 20 | .$char)......{..........$string. |
9ce0 | 3d 20 24 70 61 72 74 73 5b 30 5d 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 24 69 20 | =.$parts[0];............for.($i. |
9d00 | 3d 20 30 3b 20 24 69 20 3c 20 63 6f 75 6e 74 28 24 70 61 72 74 73 29 3b 20 24 69 2b 2b 29 20 7b | =.0;.$i.<.count($parts);.$i++).{ |
9d20 | 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 74 68 69 73 2d 3e 5f 68 61 73 55 6e 63 | ..............if.($this->_hasUnc |
9d40 | 6c 6f 73 65 64 51 75 6f 74 65 73 28 24 73 74 72 69 6e 67 29 0d 0a 20 20 20 20 20 20 20 20 20 20 | losedQuotes($string)............ |
9d60 | 20 20 20 20 20 20 7c 7c 20 24 74 68 69 73 2d 3e 5f 68 61 73 55 6e 63 6c 6f 73 65 64 42 72 61 63 | ......||.$this->_hasUnclosedBrac |
9d80 | 6b 65 74 73 28 24 73 74 72 69 6e 67 2c 20 27 3c 3e 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | kets($string,.'<>')............. |
9da0 | 20 20 20 20 20 7c 7c 20 24 74 68 69 73 2d 3e 5f 68 61 73 55 6e 63 6c 6f 73 65 64 42 72 61 63 6b | .....||.$this->_hasUnclosedBrack |
9dc0 | 65 74 73 28 24 73 74 72 69 6e 67 2c 20 27 5b 5d 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ets($string,.'[]').............. |
9de0 | 20 20 20 20 7c 7c 20 24 74 68 69 73 2d 3e 5f 68 61 73 55 6e 63 6c 6f 73 65 64 42 72 61 63 6b 65 | ....||.$this->_hasUnclosedBracke |
9e00 | 74 73 28 24 73 74 72 69 6e 67 2c 20 27 28 29 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | ts($string,.'()')............... |
9e20 | 20 20 20 7c 7c 20 73 75 62 73 74 72 28 24 73 74 72 69 6e 67 2c 20 2d 31 29 20 3d 3d 20 27 5c 5c | ...||.substr($string,.-1).==.'\\ |
9e40 | 27 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 | ').{..................if.(isset( |
9e60 | 24 70 61 72 74 73 5b 24 69 20 2b 20 31 5d 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | $parts[$i.+.1])).{.............. |
9e80 | 20 20 20 20 20 20 20 20 24 73 74 72 69 6e 67 20 3d 20 24 73 74 72 69 6e 67 20 2e 20 24 63 68 61 | ........$string.=.$string...$cha |
9ea0 | 72 20 2e 20 24 70 61 72 74 73 5b 24 69 20 2b 20 31 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | r...$parts[$i.+.1];............. |
9ec0 | 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .....}.else.{................... |
9ee0 | 20 20 20 24 74 68 69 73 2d 3e 65 72 72 6f 72 20 3d 20 27 49 6e 76 61 6c 69 64 20 61 64 64 72 65 | ...$this->error.=.'Invalid.addre |
9f00 | 73 73 20 73 70 65 63 2e 20 55 6e 63 6c 6f 73 65 64 20 62 72 61 63 6b 65 74 20 6f 72 20 71 75 6f | ss.spec..Unclosed.bracket.or.quo |
9f20 | 74 65 73 27 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 | tes';......................retur |
9f40 | 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 | n.false;..................}..... |
9f60 | 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 | .........}.else.{............... |
9f80 | 20 20 20 24 74 68 69 73 2d 3e 69 6e 64 65 78 20 3d 20 24 69 3b 0d 0a 20 20 20 20 20 20 20 20 20 | ...$this->index.=.$i;........... |
9fa0 | 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 | .......break;..............}.... |
9fc0 | 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 73 74 72 69 6e | ......}............return.$strin |
9fe0 | 67 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 43 68 65 | g;......}......../**.......*.Che |
a000 | 63 6b 73 20 69 66 20 61 20 73 74 72 69 6e 67 20 68 61 73 20 61 6e 20 75 6e 63 6c 6f 73 65 64 20 | cks.if.a.string.has.an.unclosed. |
a020 | 71 75 6f 74 65 73 20 6f 72 20 6e 6f 74 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 | quotes.or.not........*........*. |
a040 | 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 | @access.private.......*.@param.s |
a060 | 74 72 69 6e 67 20 24 73 74 72 69 6e 67 20 54 68 65 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 | tring.$string.The.string.to.chec |
a080 | 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 62 6f 6f 6c 65 61 6e 20 54 72 75 65 20 | k........*.@return.boolean.True. |
a0a0 | 69 66 20 74 68 65 72 65 20 61 72 65 20 75 6e 63 6c 6f 73 65 64 20 71 75 6f 74 65 73 20 69 6e 73 | if.there.are.unclosed.quotes.ins |
a0c0 | 69 64 65 20 74 68 65 20 73 74 72 69 6e 67 2c 20 66 61 6c 73 65 20 6f 74 68 65 72 77 69 73 65 2e | ide.the.string,.false.otherwise. |
a0e0 | 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 68 61 73 55 6e 63 6c | .......*/......function._hasUncl |
a100 | 6f 73 65 64 51 75 6f 74 65 73 28 24 73 74 72 69 6e 67 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 | osedQuotes($string)......{...... |
a120 | 20 20 20 20 24 73 74 72 69 6e 67 20 20 20 20 20 3d 20 65 78 70 6c 6f 64 65 28 27 22 27 2c 20 24 | ....$string.....=.explode('"',.$ |
a140 | 73 74 72 69 6e 67 29 3b 0d 0a 20 20 20 20 20 20 20 20 24 73 74 72 69 6e 67 5f 63 6e 74 20 3d 20 | string);..........$string_cnt.=. |
a160 | 63 6f 75 6e 74 28 24 73 74 72 69 6e 67 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 | count($string);............for.( |
a180 | 24 69 20 3d 20 30 3b 20 24 69 20 3c 20 28 63 6f 75 6e 74 28 24 73 74 72 69 6e 67 29 20 2d 20 31 | $i.=.0;.$i.<.(count($string).-.1 |
a1a0 | 29 3b 20 24 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 73 75 62 73 74 72 | );.$i++)..............if.(substr |
a1c0 | 28 24 73 74 72 69 6e 67 5b 24 69 5d 2c 20 2d 31 29 20 3d 3d 20 27 5c 5c 27 29 0d 0a 20 20 20 20 | ($string[$i],.-1).==.'\\')...... |
a1e0 | 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 72 69 6e 67 5f 63 6e 74 2d 2d 3b 0d 0a 0d 0a 20 20 | ............$string_cnt--;...... |
a200 | 20 20 20 20 20 20 72 65 74 75 72 6e 20 28 24 73 74 72 69 6e 67 5f 63 6e 74 20 25 20 32 20 3d 3d | ......return.($string_cnt.%.2.== |
a220 | 3d 20 30 29 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 | =.0);......}......../**.......*. |
a240 | 43 68 65 63 6b 73 20 69 66 20 61 20 73 74 72 69 6e 67 20 68 61 73 20 61 6e 20 75 6e 63 6c 6f 73 | Checks.if.a.string.has.an.unclos |
a260 | 65 64 20 62 72 61 63 6b 65 74 73 20 6f 72 20 6e 6f 74 2e 20 49 4d 50 4f 52 54 41 4e 54 3a 0d 0a | ed.brackets.or.not..IMPORTANT:.. |
a280 | 20 20 20 20 20 2a 20 54 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 68 61 6e 64 6c 65 73 20 62 6f 74 | .....*.This.function.handles.bot |
a2a0 | 68 20 61 6e 67 6c 65 20 62 72 61 63 6b 65 74 73 20 61 6e 64 20 73 71 75 61 72 65 20 62 72 61 63 | h.angle.brackets.and.square.brac |
a2c0 | 6b 65 74 73 3b 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 | kets;.......*........*.@access.p |
a2e0 | 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 73 74 | rivate.......*.@param.string.$st |
a300 | 72 69 6e 67 20 54 68 65 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 | ring.The.string.to.check........ |
a320 | 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 63 68 61 72 73 20 20 54 68 65 20 63 68 61 72 | *.@param.string.$chars..The.char |
a340 | 61 63 74 65 72 73 20 74 6f 20 63 68 65 63 6b 20 66 6f 72 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 | acters.to.check.for........*.@re |
a360 | 74 75 72 6e 20 62 6f 6f 6c 65 61 6e 20 54 72 75 65 20 69 66 20 74 68 65 72 65 20 61 72 65 20 75 | turn.boolean.True.if.there.are.u |
a380 | 6e 63 6c 6f 73 65 64 20 62 72 61 63 6b 65 74 73 20 69 6e 73 69 64 65 20 74 68 65 20 73 74 72 69 | nclosed.brackets.inside.the.stri |
a3a0 | 6e 67 2c 20 66 61 6c 73 65 20 6f 74 68 65 72 77 69 73 65 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 | ng,.false.otherwise........*/... |
a3c0 | 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 68 61 73 55 6e 63 6c 6f 73 65 64 42 72 61 63 6b 65 74 73 | ...function._hasUnclosedBrackets |
a3e0 | 28 24 73 74 72 69 6e 67 2c 20 24 63 68 61 72 73 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 | ($string,.$chars)......{........ |
a400 | 20 20 24 6e 75 6d 5f 61 6e 67 6c 65 5f 73 74 61 72 74 20 3d 20 73 75 62 73 74 72 5f 63 6f 75 6e | ..$num_angle_start.=.substr_coun |
a420 | 74 28 24 73 74 72 69 6e 67 2c 20 24 63 68 61 72 73 5b 30 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 | t($string,.$chars[0]);.......... |
a440 | 24 6e 75 6d 5f 61 6e 67 6c 65 5f 65 6e 64 20 20 20 3d 20 73 75 62 73 74 72 5f 63 6f 75 6e 74 28 | $num_angle_end...=.substr_count( |
a460 | 24 73 74 72 69 6e 67 2c 20 24 63 68 61 72 73 5b 31 5d 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 | $string,.$chars[1]);............ |
a480 | 24 74 68 69 73 2d 3e 5f 68 61 73 55 6e 63 6c 6f 73 65 64 42 72 61 63 6b 65 74 73 53 75 62 28 24 | $this->_hasUnclosedBracketsSub($ |
a4a0 | 73 74 72 69 6e 67 2c 20 24 6e 75 6d 5f 61 6e 67 6c 65 5f 73 74 61 72 74 2c 20 24 63 68 61 72 73 | string,.$num_angle_start,.$chars |
a4c0 | 5b 30 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 5f 68 61 73 55 6e 63 6c 6f 73 | [0]);..........$this->_hasUnclos |
a4e0 | 65 64 42 72 61 63 6b 65 74 73 53 75 62 28 24 73 74 72 69 6e 67 2c 20 24 6e 75 6d 5f 61 6e 67 6c | edBracketsSub($string,.$num_angl |
a500 | 65 5f 65 6e 64 2c 20 24 63 68 61 72 73 5b 31 5d 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 | e_end,.$chars[1]);............if |
a520 | 20 28 24 6e 75 6d 5f 61 6e 67 6c 65 5f 73 74 61 72 74 20 3c 20 24 6e 75 6d 5f 61 6e 67 6c 65 5f | .($num_angle_start.<.$num_angle_ |
a540 | 65 6e 64 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 65 72 72 6f 72 | end).{..............$this->error |
a560 | 20 3d 20 27 49 6e 76 61 6c 69 64 20 61 64 64 72 65 73 73 20 73 70 65 63 2e 20 55 6e 6d 61 74 63 | .=.'Invalid.address.spec..Unmatc |
a580 | 68 65 64 20 71 75 6f 74 65 20 6f 72 20 62 72 61 63 6b 65 74 20 28 27 20 2e 20 24 63 68 61 72 73 | hed.quote.or.bracket.('...$chars |
a5a0 | 20 2e 20 27 29 27 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 | ...')';..............return.fals |
a5c0 | 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | e;..........}.else.{............ |
a5e0 | 20 20 72 65 74 75 72 6e 20 28 24 6e 75 6d 5f 61 6e 67 6c 65 5f 73 74 61 72 74 20 3e 20 24 6e 75 | ..return.($num_angle_start.>.$nu |
a600 | 6d 5f 61 6e 67 6c 65 5f 65 6e 64 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d | m_angle_end);..........}......}. |
a620 | 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 53 75 62 20 66 75 6e 63 74 69 6f 6e 20 | ......./**.......*.Sub.function. |
a640 | 74 68 61 74 20 69 73 20 75 73 65 64 20 6f 6e 6c 79 20 62 79 20 68 61 73 55 6e 63 6c 6f 73 65 64 | that.is.used.only.by.hasUnclosed |
a660 | 42 72 61 63 6b 65 74 73 28 29 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 | Brackets()........*........*.@ac |
a680 | 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 | cess.private.......*.@param.stri |
a6a0 | 6e 67 20 24 73 74 72 69 6e 67 20 54 68 65 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d | ng.$string.The.string.to.check.. |
a6c0 | 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 69 6e 74 65 67 65 72 20 26 24 6e 75 6d 20 20 20 20 | ......*.@param.integer.&$num.... |
a6e0 | 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 6f 63 63 75 72 65 6e 63 65 73 2e 0d 0a 20 20 20 20 20 | The.number.of.occurences........ |
a700 | 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 63 68 61 72 20 20 20 54 68 65 20 63 68 61 72 | *.@param.string.$char...The.char |
a720 | 61 63 74 65 72 20 74 6f 20 63 6f 75 6e 74 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 | acter.to.count........*.@return. |
a740 | 69 6e 74 65 67 65 72 20 54 68 65 20 6e 75 6d 62 65 72 20 6f 66 20 6f 63 63 75 72 65 6e 63 65 73 | integer.The.number.of.occurences |
a760 | 20 6f 66 20 24 63 68 61 72 20 69 6e 20 24 73 74 72 69 6e 67 2c 20 61 64 6a 75 73 74 65 64 20 66 | .of.$char.in.$string,.adjusted.f |
a780 | 6f 72 20 62 61 63 6b 73 6c 61 73 68 65 73 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 | or.backslashes........*/......fu |
a7a0 | 6e 63 74 69 6f 6e 20 5f 68 61 73 55 6e 63 6c 6f 73 65 64 42 72 61 63 6b 65 74 73 53 75 62 28 24 | nction._hasUnclosedBracketsSub($ |
a7c0 | 73 74 72 69 6e 67 2c 20 26 24 6e 75 6d 2c 20 24 63 68 61 72 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 | string,.&$num,.$char)......{.... |
a7e0 | 20 20 20 20 20 20 24 70 61 72 74 73 20 3d 20 65 78 70 6c 6f 64 65 28 24 63 68 61 72 2c 20 24 73 | ......$parts.=.explode($char,.$s |
a800 | 74 72 69 6e 67 29 3b 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 24 69 20 3d 20 30 3b 20 24 69 | tring);..........for.($i.=.0;.$i |
a820 | 20 3c 20 63 6f 75 6e 74 28 24 70 61 72 74 73 29 3b 20 24 69 2b 2b 29 7b 0d 0a 20 20 20 20 20 20 | .<.count($parts);.$i++){........ |
a840 | 20 20 20 20 20 20 69 66 20 28 73 75 62 73 74 72 28 24 70 61 72 74 73 5b 24 69 5d 2c 20 2d 31 29 | ......if.(substr($parts[$i],.-1) |
a860 | 20 3d 3d 20 27 5c 5c 27 20 7c 7c 20 24 74 68 69 73 2d 3e 5f 68 61 73 55 6e 63 6c 6f 73 65 64 51 | .==.'\\'.||.$this->_hasUnclosedQ |
a880 | 75 6f 74 65 73 28 24 70 61 72 74 73 5b 24 69 5d 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | uotes($parts[$i])).............. |
a8a0 | 20 20 20 20 24 6e 75 6d 2d 2d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 | ....$num--;..............if.(iss |
a8c0 | 65 74 28 24 70 61 72 74 73 5b 24 69 20 2b 20 31 5d 29 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | et($parts[$i.+.1]))............. |
a8e0 | 20 20 20 20 20 24 70 61 72 74 73 5b 24 69 20 2b 20 31 5d 20 3d 20 24 70 61 72 74 73 5b 24 69 5d | .....$parts[$i.+.1].=.$parts[$i] |
a900 | 20 2e 20 24 63 68 61 72 20 2e 20 24 70 61 72 74 73 5b 24 69 20 2b 20 31 5d 3b 0d 0a 20 20 20 20 | ...$char...$parts[$i.+.1];...... |
a920 | 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | ....}....................return. |
a940 | 24 6e 75 6d 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 | $num;......}......../**.......*. |
a960 | 46 75 6e 63 74 69 6f 6e 20 74 6f 20 62 65 67 69 6e 20 63 68 65 63 6b 69 6e 67 20 74 68 65 20 61 | Function.to.begin.checking.the.a |
a980 | 64 64 72 65 73 73 2e 0d 0a 20 20 20 20 20 2a 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 | ddress........*.......*.@access. |
a9a0 | 70 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 61 | private.......*.@param.string.$a |
a9c0 | 64 64 72 65 73 73 20 54 68 65 20 61 64 64 72 65 73 73 20 74 6f 20 76 61 6c 69 64 61 74 65 2e 0d | ddress.The.address.to.validate.. |
a9e0 | 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 46 61 6c 73 65 20 6f 6e 20 66 | ......*.@return.mixed.False.on.f |
aa00 | 61 69 6c 75 72 65 2c 20 6f 72 20 61 20 73 74 72 75 63 74 75 72 65 64 20 61 72 72 61 79 20 6f 66 | ailure,.or.a.structured.array.of |
aa20 | 20 61 64 64 72 65 73 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 73 75 63 63 65 73 73 2e | .address.information.on.success. |
aa40 | 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 | .......*/......function._validat |
aa60 | 65 41 64 64 72 65 73 73 28 24 61 64 64 72 65 73 73 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 | eAddress($address)......{....... |
aa80 | 20 20 20 24 69 73 5f 67 72 6f 75 70 20 3d 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 | ...$is_group.=.false;........... |
aaa0 | 20 69 66 20 28 24 61 64 64 72 65 73 73 5b 27 67 72 6f 75 70 27 5d 29 20 7b 0d 0a 20 20 20 20 20 | .if.($address['group']).{....... |
aac0 | 20 20 20 20 20 20 20 24 69 73 5f 67 72 6f 75 70 20 3d 20 74 72 75 65 3b 0d 0a 0d 0a 20 20 20 20 | .......$is_group.=.true;........ |
aae0 | 20 20 20 20 20 20 20 20 2f 2f 20 47 65 74 20 74 68 65 20 67 72 6f 75 70 20 70 61 72 74 20 6f 66 | ........//.Get.the.group.part.of |
ab00 | 20 74 68 65 20 6e 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 72 74 73 20 20 20 | .the.name..............$parts... |
ab20 | 20 20 3d 20 65 78 70 6c 6f 64 65 28 27 3a 27 2c 20 24 61 64 64 72 65 73 73 5b 27 61 64 64 72 65 | ..=.explode(':',.$address['addre |
ab40 | 73 73 27 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 67 72 6f 75 70 6e 61 6d 65 20 3d | ss']);..............$groupname.= |
ab60 | 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 73 2c 20 27 3a 27 29 | .$this->_splitCheck($parts,.':') |
ab80 | 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 72 75 63 74 75 72 65 20 3d 20 61 72 72 61 | ;..............$structure.=.arra |
aba0 | 79 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 41 6e 64 20 76 61 6c 69 64 | y();................//.And.valid |
abc0 | 61 74 65 20 74 68 65 20 67 72 6f 75 70 20 70 61 72 74 20 6f 66 20 74 68 65 20 6e 61 6d 65 2e 0d | ate.the.group.part.of.the.name.. |
abe0 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 | .............if.(!$this->_valida |
ac00 | 74 65 50 68 72 61 73 65 28 24 67 72 6f 75 70 6e 61 6d 65 29 29 7b 0d 0a 20 20 20 20 20 20 20 20 | tePhrase($groupname)){.......... |
ac20 | 20 20 20 20 20 20 20 20 24 74 68 69 73 2d 3e 65 72 72 6f 72 20 3d 20 27 47 72 6f 75 70 20 6e 61 | ........$this->error.=.'Group.na |
ac40 | 6d 65 20 64 69 64 20 6e 6f 74 20 76 61 6c 69 64 61 74 65 2e 27 3b 0d 0a 20 20 20 20 20 20 20 20 | me.did.not.validate.';.......... |
ac60 | 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 | ........return.false;........... |
ac80 | 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 | ...}.else.{..................//. |
aca0 | 44 6f 6e 27 74 20 69 6e 63 6c 75 64 65 20 67 72 6f 75 70 73 20 69 66 20 77 65 20 61 72 65 20 6e | Don't.include.groups.if.we.are.n |
acc0 | 6f 74 20 6e 65 73 74 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 74 | ot.nesting..................//.t |
ace0 | 68 65 6d 2e 20 54 68 69 73 20 61 76 6f 69 64 73 20 72 65 74 75 72 6e 69 6e 67 20 69 6e 76 61 6c | hem..This.avoids.returning.inval |
ad00 | 69 64 20 61 64 64 72 65 73 73 65 73 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 | id.addresses...................i |
ad20 | 66 20 28 24 74 68 69 73 2d 3e 6e 65 73 74 47 72 6f 75 70 73 29 20 7b 0d 0a 20 20 20 20 20 20 20 | f.($this->nestGroups).{......... |
ad40 | 20 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 72 75 63 74 75 72 65 20 3d 20 6e 65 77 20 73 74 | .............$structure.=.new.st |
ad60 | 64 43 6c 61 73 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 | dClass;......................$st |
ad80 | 72 75 63 74 75 72 65 2d 3e 67 72 6f 75 70 6e 61 6d 65 20 3d 20 24 67 72 6f 75 70 6e 61 6d 65 3b | ructure->groupname.=.$groupname; |
ada0 | 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | ..................}............. |
adc0 | 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 61 64 64 72 65 73 73 5b 27 61 64 64 72 | .}................$address['addr |
ade0 | 65 73 73 27 5d 20 3d 20 6c 74 72 69 6d 28 73 75 62 73 74 72 28 24 61 64 64 72 65 73 73 5b 27 61 | ess'].=.ltrim(substr($address['a |
ae00 | 64 64 72 65 73 73 27 5d 2c 20 73 74 72 6c 65 6e 28 24 67 72 6f 75 70 6e 61 6d 65 20 2e 20 27 3a | ddress'],.strlen($groupname...': |
ae20 | 27 29 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 49 | ')));..........}............//.I |
ae40 | 66 20 61 20 67 72 6f 75 70 20 74 68 65 6e 20 73 70 6c 69 74 20 6f 6e 20 63 6f 6d 6d 61 20 61 6e | f.a.group.then.split.on.comma.an |
ae60 | 64 20 70 75 74 20 69 6e 74 6f 20 61 6e 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 2f 2f | d.put.into.an.array...........// |
ae80 | 20 4f 74 68 65 72 77 69 73 65 2c 20 4a 75 73 74 20 70 75 74 20 74 68 65 20 77 68 6f 6c 65 20 61 | .Otherwise,.Just.put.the.whole.a |
aea0 | 64 64 72 65 73 73 20 69 6e 20 61 6e 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 69 66 20 | ddress.in.an.array...........if. |
aec0 | 28 24 69 73 5f 67 72 6f 75 70 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 77 68 69 6c 65 | ($is_group).{..............while |
aee0 | 20 28 73 74 72 6c 65 6e 28 24 61 64 64 72 65 73 73 5b 27 61 64 64 72 65 73 73 27 5d 29 20 3e 20 | .(strlen($address['address']).>. |
af00 | 30 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 72 74 73 20 20 20 20 | 0).{..................$parts.... |
af20 | 20 20 20 3d 20 65 78 70 6c 6f 64 65 28 27 2c 27 2c 20 24 61 64 64 72 65 73 73 5b 27 61 64 64 72 | ...=.explode(',',.$address['addr |
af40 | 65 73 73 27 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 61 64 64 72 65 73 | ess']);..................$addres |
af60 | 73 65 73 5b 5d 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 | ses[].=.$this->_splitCheck($part |
af80 | 73 2c 20 27 2c 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 61 64 64 72 65 | s,.',');..................$addre |
afa0 | 73 73 5b 27 61 64 64 72 65 73 73 27 5d 20 3d 20 74 72 69 6d 28 73 75 62 73 74 72 28 24 61 64 64 | ss['address'].=.trim(substr($add |
afc0 | 72 65 73 73 5b 27 61 64 64 72 65 73 73 27 5d 2c 20 73 74 72 6c 65 6e 28 65 6e 64 28 24 61 64 64 | ress['address'],.strlen(end($add |
afe0 | 72 65 73 73 65 73 29 20 2e 20 27 2c 27 29 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d | resses)...',')));..............} |
b000 | 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ..........}.else.{.............. |
b020 | 24 61 64 64 72 65 73 73 65 73 5b 5d 20 3d 20 24 61 64 64 72 65 73 73 5b 27 61 64 64 72 65 73 73 | $addresses[].=.$address['address |
b040 | 27 5d 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 | '];..........}............//.Che |
b060 | 63 6b 20 74 68 61 74 20 24 61 64 64 72 65 73 73 65 73 20 69 73 20 73 65 74 2c 20 69 66 20 61 64 | ck.that.$addresses.is.set,.if.ad |
b080 | 64 72 65 73 73 20 6c 69 6b 65 20 74 68 69 73 3a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 47 72 6f | dress.like.this:..........//.Gro |
b0a0 | 75 70 6e 61 6d 65 3a 3b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 54 68 65 6e 20 65 72 72 6f 72 73 | upname:;..........//.Then.errors |
b0c0 | 20 77 65 72 65 20 61 70 70 65 61 72 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 69 | .were.appearing...........if.(!i |
b0e0 | 73 73 65 74 28 24 61 64 64 72 65 73 73 65 73 29 29 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | sset($addresses)){.............. |
b100 | 24 74 68 69 73 2d 3e 65 72 72 6f 72 20 3d 20 27 45 6d 70 74 79 20 67 72 6f 75 70 2e 27 3b 0d 0a | $this->error.=.'Empty.group.';.. |
b120 | 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 | ............return.false;....... |
b140 | 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 24 69 20 3d 20 30 3b 20 24 69 20 | ...}............for.($i.=.0;.$i. |
b160 | 3c 20 63 6f 75 6e 74 28 24 61 64 64 72 65 73 73 65 73 29 3b 20 24 69 2b 2b 29 20 7b 0d 0a 20 20 | <.count($addresses);.$i++).{.... |
b180 | 20 20 20 20 20 20 20 20 20 20 24 61 64 64 72 65 73 73 65 73 5b 24 69 5d 20 3d 20 74 72 69 6d 28 | ..........$addresses[$i].=.trim( |
b1a0 | 24 61 64 64 72 65 73 73 65 73 5b 24 69 5d 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 | $addresses[$i]);..........}..... |
b1c0 | 20 20 20 20 20 20 20 2f 2f 20 56 61 6c 69 64 61 74 65 20 65 61 63 68 20 6d 61 69 6c 62 6f 78 2e | .......//.Validate.each.mailbox. |
b1e0 | 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 46 6f 72 6d 61 74 20 63 6f 75 6c 64 20 62 65 20 6f 6e 65 | ..........//.Format.could.be.one |
b200 | 20 6f 66 3a 20 6e 61 6d 65 20 3c 67 65 65 7a 65 72 40 64 6f 6d 61 69 6e 2e 63 6f 6d 3e 0d 0a 20 | .of:.name.<geezer@domain.com>... |
b220 | 20 20 20 20 20 20 20 2f 2f 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | .......//....................... |
b240 | 20 20 67 65 65 7a 65 72 40 64 6f 6d 61 69 6e 2e 63 6f 6d 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 | ..geezer@domain.com..........//. |
b260 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 67 65 65 7a 65 72 0d 0a | ........................geezer.. |
b280 | 20 20 20 20 20 20 20 20 2f 2f 20 2e 2e 2e 20 6f 72 20 61 6e 79 20 6f 74 68 65 72 20 66 6f 72 6d | ........//.....or.any.other.form |
b2a0 | 61 74 20 76 61 6c 69 64 20 62 79 20 52 46 43 20 38 32 32 2e 0d 0a 20 20 20 20 20 20 20 20 61 72 | at.valid.by.RFC.822...........ar |
b2c0 | 72 61 79 5f 77 61 6c 6b 28 24 61 64 64 72 65 73 73 65 73 2c 20 61 72 72 61 79 28 24 74 68 69 73 | ray_walk($addresses,.array($this |
b2e0 | 2c 20 27 76 61 6c 69 64 61 74 65 4d 61 69 6c 62 6f 78 27 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 | ,.'validateMailbox'));.......... |
b300 | 20 20 2f 2f 20 4e 65 73 74 65 64 20 66 6f 72 6d 61 74 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 | ..//.Nested.format..........if.( |
b320 | 24 74 68 69 73 2d 3e 6e 65 73 74 47 72 6f 75 70 73 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | $this->nestGroups).{............ |
b340 | 20 20 69 66 20 28 24 69 73 5f 67 72 6f 75 70 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | ..if.($is_group).{.............. |
b360 | 20 20 20 20 24 73 74 72 75 63 74 75 72 65 2d 3e 61 64 64 72 65 73 73 65 73 20 3d 20 24 61 64 64 | ....$structure->addresses.=.$add |
b380 | 72 65 73 73 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 | resses;..............}.else.{... |
b3a0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 72 75 63 74 75 72 65 20 3d 20 24 61 64 64 | ...............$structure.=.$add |
b3c0 | 72 65 73 73 65 73 5b 30 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 | resses[0];..............}....... |
b3e0 | 20 20 20 20 20 2f 2f 20 46 6c 61 74 20 66 6f 72 6d 61 74 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 | .....//.Flat.format..........}.e |
b400 | 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 69 73 5f 67 72 6f 75 70 | lse.{..............if.($is_group |
b420 | 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 72 75 63 74 75 72 65 20 | ).{..................$structure. |
b440 | 3d 20 61 72 72 61 79 5f 6d 65 72 67 65 28 24 73 74 72 75 63 74 75 72 65 2c 20 24 61 64 64 72 65 | =.array_merge($structure,.$addre |
b460 | 73 73 65 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 | sses);..............}.else.{.... |
b480 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 73 74 72 75 63 74 75 72 65 20 3d 20 24 61 64 64 72 | ..............$structure.=.$addr |
b4a0 | 65 73 73 65 73 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d | esses;..............}..........} |
b4c0 | 0d 0a 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 73 74 72 75 63 74 75 72 65 3b 0d 0a | ............return.$structure;.. |
b4e0 | 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 69 6f | ....}......../**.......*.Functio |
b500 | 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 20 70 68 72 61 73 65 2e 0d 0a 20 20 20 20 20 2a 0d | n.to.validate.a.phrase........*. |
b520 | 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 | ......*.@access.private.......*. |
b540 | 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 70 68 72 61 73 65 20 54 68 65 20 70 68 72 61 73 65 | @param.string.$phrase.The.phrase |
b560 | 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 62 6f 6f 6c 65 | .to.check........*.@return.boole |
b580 | 61 6e 20 53 75 63 63 65 73 73 20 6f 72 20 66 61 69 6c 75 72 65 2e 0d 0a 20 20 20 20 20 2a 2f 0d | an.Success.or.failure........*/. |
b5a0 | 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 65 50 68 72 61 73 65 28 24 70 | .....function._validatePhrase($p |
b5c0 | 68 72 61 73 65 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 53 70 6c 69 74 73 | hrase)......{..........//.Splits |
b5e0 | 20 6f 6e 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 54 61 62 20 6f 72 20 73 70 61 63 65 2e 0d 0a 20 | .on.one.or.more.Tab.or.space.... |
b600 | 20 20 20 20 20 20 20 24 70 61 72 74 73 20 3d 20 70 72 65 67 5f 73 70 6c 69 74 28 27 2f 5b 20 5c | .......$parts.=.preg_split('/[.\ |
b620 | 5c 78 30 39 5d 2b 2f 27 2c 20 24 70 68 72 61 73 65 2c 20 2d 31 2c 20 50 52 45 47 5f 53 50 4c 49 | \x09]+/',.$phrase,.-1,.PREG_SPLI |
b640 | 54 5f 4e 4f 5f 45 4d 50 54 59 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 24 70 68 72 61 73 65 5f | T_NO_EMPTY);............$phrase_ |
b660 | 70 61 72 74 73 20 3d 20 61 72 72 61 79 28 29 3b 0d 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 | parts.=.array();..........while. |
b680 | 28 63 6f 75 6e 74 28 24 70 61 72 74 73 29 20 3e 20 30 29 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | (count($parts).>.0){............ |
b6a0 | 20 20 24 70 68 72 61 73 65 5f 70 61 72 74 73 5b 5d 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 | ..$phrase_parts[].=.$this->_spli |
b6c0 | 74 43 68 65 63 6b 28 24 70 61 72 74 73 2c 20 27 20 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 | tCheck($parts,.'.');............ |
b6e0 | 20 20 66 6f 72 20 28 24 69 20 3d 20 30 3b 20 24 69 20 3c 20 24 74 68 69 73 2d 3e 69 6e 64 65 78 | ..for.($i.=.0;.$i.<.$this->index |
b700 | 20 2b 20 31 3b 20 24 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 72 72 | .+.1;.$i++)..................arr |
b720 | 61 79 5f 73 68 69 66 74 28 24 70 61 72 74 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a | ay_shift($parts);..........}.... |
b740 | 20 20 20 20 20 20 20 20 66 6f 72 20 28 24 69 20 3d 20 30 3b 20 24 69 20 3c 20 63 6f 75 6e 74 28 | ........for.($i.=.0;.$i.<.count( |
b760 | 24 70 68 72 61 73 65 5f 70 61 72 74 73 29 3b 20 24 69 2b 2b 29 20 7b 0d 0a 20 20 20 20 20 20 20 | $phrase_parts);.$i++).{......... |
b780 | 20 20 20 20 20 2f 2f 20 49 66 20 71 75 6f 74 65 64 20 73 74 72 69 6e 67 3a 0d 0a 20 20 20 20 20 | .....//.If.quoted.string:....... |
b7a0 | 20 20 20 20 20 20 20 69 66 20 28 73 75 62 73 74 72 28 24 70 68 72 61 73 65 5f 70 61 72 74 73 5b | .......if.(substr($phrase_parts[ |
b7c0 | 24 69 5d 2c 20 30 2c 20 31 29 20 3d 3d 20 27 22 27 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | $i],.0,.1).==.'"').{............ |
b7e0 | 20 20 20 20 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 51 75 6f 74 65 | ......if.(!$this->_validateQuote |
b800 | 64 53 74 72 69 6e 67 28 24 70 68 72 61 73 65 5f 70 61 72 74 73 5b 24 69 5d 29 29 0d 0a 20 20 20 | dString($phrase_parts[$i]))..... |
b820 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a | .................return.false;.. |
b840 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 63 6f 6e 74 69 6e 75 65 3b 0d 0a 20 20 20 20 20 | ................continue;....... |
b860 | 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 4f 74 68 65 72 | .......}................//.Other |
b880 | 77 69 73 65 20 69 74 27 73 20 61 6e 20 61 74 6f 6d 3a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | wise.it's.an.atom:.............. |
b8a0 | 69 66 20 28 21 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 41 74 6f 6d 28 24 70 68 72 61 73 | if.(!$this->_validateAtom($phras |
b8c0 | 65 5f 70 61 72 74 73 5b 24 69 5d 29 29 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 | e_parts[$i])).return.false;..... |
b8e0 | 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a | .....}............return.true;.. |
b900 | 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 69 6f | ....}......../**.......*.Functio |
b920 | 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 6e 20 61 74 6f 6d 20 77 68 69 63 68 20 66 72 6f 6d | n.to.validate.an.atom.which.from |
b940 | 20 72 66 63 38 32 32 20 69 73 3a 0d 0a 20 20 20 20 20 2a 20 61 74 6f 6d 20 3d 20 31 2a 3c 61 6e | .rfc822.is:.......*.atom.=.1*<an |
b960 | 79 20 43 48 41 52 20 65 78 63 65 70 74 20 73 70 65 63 69 61 6c 73 2c 20 53 50 41 43 45 20 61 6e | y.CHAR.except.specials,.SPACE.an |
b980 | 64 20 43 54 4c 73 3e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 49 66 20 76 61 6c 69 | d.CTLs>.......*........*.If.vali |
b9a0 | 64 61 74 69 6f 6e 20 28 24 74 68 69 73 2d 3e 76 61 6c 69 64 61 74 65 29 20 68 61 73 20 62 65 65 | dation.($this->validate).has.bee |
b9c0 | 6e 20 74 75 72 6e 65 64 20 6f 66 66 2c 20 74 68 65 6e 0d 0a 20 20 20 20 20 2a 20 76 61 6c 69 64 | n.turned.off,.then.......*.valid |
b9e0 | 61 74 65 41 74 6f 6d 28 29 20 64 6f 65 73 6e 27 74 20 61 63 74 75 61 6c 6c 79 20 63 68 65 63 6b | ateAtom().doesn't.actually.check |
ba00 | 20 61 6e 79 74 68 69 6e 67 2e 20 54 68 69 73 20 69 73 20 73 6f 20 74 68 61 74 20 79 6f 75 0d 0a | .anything..This.is.so.that.you.. |
ba20 | 20 20 20 20 20 2a 20 63 61 6e 20 73 70 6c 69 74 20 61 20 6c 69 73 74 20 6f 66 20 61 64 64 72 65 | .....*.can.split.a.list.of.addre |
ba40 | 73 73 65 73 20 75 70 20 62 65 66 6f 72 65 20 65 6e 63 6f 64 69 6e 67 20 70 65 72 73 6f 6e 61 6c | sses.up.before.encoding.personal |
ba60 | 20 6e 61 6d 65 73 0d 0a 20 20 20 20 20 2a 20 28 75 6d 6c 61 75 74 73 2c 20 65 74 63 2e 29 2c 20 | .names.......*.(umlauts,.etc.),. |
ba80 | 66 6f 72 20 65 78 61 6d 70 6c 65 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 | for.example........*........*.@a |
baa0 | 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 | ccess.private.......*.@param.str |
bac0 | 69 6e 67 20 24 61 74 6f 6d 20 54 68 65 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a | ing.$atom.The.string.to.check... |
bae0 | 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 62 6f 6f 6c 65 61 6e 20 53 75 63 63 65 73 73 20 6f | .....*.@return.boolean.Success.o |
bb00 | 72 20 66 61 69 6c 75 72 65 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f | r.failure........*/......functio |
bb20 | 6e 20 5f 76 61 6c 69 64 61 74 65 41 74 6f 6d 28 24 61 74 6f 6d 29 0d 0a 20 20 20 20 7b 0d 0a 20 | n._validateAtom($atom)......{... |
bb40 | 20 20 20 20 20 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e 76 61 6c 69 64 61 74 65 29 20 7b 0d 0a | .......if.(!$this->validate).{.. |
bb60 | 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 56 61 6c 69 64 61 74 69 6f 6e 20 68 61 73 20 62 65 | ............//.Validation.has.be |
bb80 | 65 6e 20 74 75 72 6e 65 64 20 6f 66 66 3b 20 61 73 73 75 6d 65 20 74 68 65 20 61 74 6f 6d 20 69 | en.turned.off;.assume.the.atom.i |
bba0 | 73 20 6f 6b 61 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 | s.okay...............return.true |
bbc0 | 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b | ;..........}............//.Check |
bbe0 | 20 66 6f 72 20 61 6e 79 20 63 68 61 72 20 66 72 6f 6d 20 41 53 43 49 49 20 30 20 2d 20 41 53 43 | .for.any.char.from.ASCII.0.-.ASC |
bc00 | 49 49 20 31 32 37 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 21 70 72 65 67 5f 6d 61 74 63 68 28 | II.127..........if.(!preg_match( |
bc20 | 27 2f 5e 5b 5c 5c 78 30 30 2d 5c 5c 78 37 45 5d 2b 24 2f 69 27 2c 20 24 61 74 6f 6d 2c 20 24 6d | '/^[\\x00-\\x7E]+$/i',.$atom,.$m |
bc40 | 61 74 63 68 65 73 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 | atches)).{..............return.f |
bc60 | 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 43 | alse;..........}............//.C |
bc80 | 68 65 63 6b 20 66 6f 72 20 73 70 65 63 69 61 6c 73 3a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 | heck.for.specials:..........if.( |
bca0 | 70 72 65 67 5f 6d 61 74 63 68 28 27 2f 5b 5d 5b 28 29 3c 3e 40 2c 3b 5c 5c 3a 22 2e 20 5d 2f 27 | preg_match('/[][()<>@,;\\:"..]/' |
bcc0 | 2c 20 24 61 74 6f 6d 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 | ,.$atom)).{..............return. |
bce0 | 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 | false;..........}............//. |
bd00 | 43 68 65 63 6b 20 66 6f 72 20 63 6f 6e 74 72 6f 6c 20 63 68 61 72 61 63 74 65 72 73 20 28 41 53 | Check.for.control.characters.(AS |
bd20 | 43 49 49 20 30 2d 33 31 29 3a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 70 72 65 67 5f 6d 61 74 | CII.0-31):..........if.(preg_mat |
bd40 | 63 68 28 27 2f 5b 5c 5c 78 30 30 2d 5c 5c 78 31 46 5d 2b 2f 27 2c 20 24 61 74 6f 6d 29 29 20 7b | ch('/[\\x00-\\x1F]+/',.$atom)).{ |
bd60 | 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 | ..............return.false;..... |
bd80 | 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a | .....}............return.true;.. |
bda0 | 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 69 6f | ....}......../**.......*.Functio |
bdc0 | 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 71 75 6f 74 65 64 20 73 74 72 69 6e 67 2c 20 77 68 69 | n.to.validate.quoted.string,.whi |
bde0 | 63 68 20 69 73 3a 0d 0a 20 20 20 20 20 2a 20 71 75 6f 74 65 64 2d 73 74 72 69 6e 67 20 3d 20 3c | ch.is:.......*.quoted-string.=.< |
be00 | 22 3e 20 2a 28 71 74 65 78 74 2f 71 75 6f 74 65 64 2d 70 61 69 72 29 20 3c 22 3e 0d 0a 20 20 20 | ">.*(qtext/quoted-pair).<">..... |
be20 | 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 | ..*........*.@access.private.... |
be40 | 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 71 73 74 72 69 6e 67 20 54 68 65 20 | ...*.@param.string.$qstring.The. |
be60 | 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 | string.to.check.......*.@return. |
be80 | 62 6f 6f 6c 65 61 6e 20 53 75 63 63 65 73 73 20 6f 72 20 66 61 69 6c 75 72 65 2e 0d 0a 20 20 20 | boolean.Success.or.failure...... |
bea0 | 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 65 51 75 6f 74 | ..*/......function._validateQuot |
bec0 | 65 64 53 74 72 69 6e 67 28 24 71 73 74 72 69 6e 67 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 | edString($qstring)......{....... |
bee0 | 20 20 20 2f 2f 20 4c 65 61 64 69 6e 67 20 61 6e 64 20 74 72 61 69 6c 69 6e 67 20 22 0d 0a 20 20 | ...//.Leading.and.trailing.".... |
bf00 | 20 20 20 20 20 20 24 71 73 74 72 69 6e 67 20 3d 20 73 75 62 73 74 72 28 24 71 73 74 72 69 6e 67 | ......$qstring.=.substr($qstring |
bf20 | 2c 20 31 2c 20 2d 31 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 50 65 72 66 6f 72 6d 20 | ,.1,.-1);............//.Perform. |
bf40 | 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 21 28 70 72 65 67 5f 6d 61 | check...........return.!(preg_ma |
bf60 | 74 63 68 28 27 2f 28 2e 29 5b 5c 78 30 44 5c 5c 5c 5c 22 5d 2f 27 2c 20 24 71 73 74 72 69 6e 67 | tch('/(.)[\x0D\\\\"]/',.$qstring |
bf80 | 2c 20 24 6d 61 74 63 68 65 73 29 20 26 26 20 24 6d 61 74 63 68 65 73 5b 31 5d 20 21 3d 20 27 5c | ,.$matches).&&.$matches[1].!=.'\ |
bfa0 | 5c 27 29 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 | \');......}......../**.......*.F |
bfc0 | 75 6e 63 74 69 6f 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 20 6d 61 69 6c 62 6f 78 2c 20 77 | unction.to.validate.a.mailbox,.w |
bfe0 | 68 69 63 68 20 69 73 3a 0d 0a 20 20 20 20 20 2a 20 6d 61 69 6c 62 6f 78 20 3d 20 20 20 61 64 64 | hich.is:.......*.mailbox.=...add |
c000 | 72 2d 73 70 65 63 20 20 20 20 20 20 20 20 20 3b 20 73 69 6d 70 6c 65 20 61 64 64 72 65 73 73 0d | r-spec.........;.simple.address. |
c020 | 0a 20 20 20 20 20 2a 20 20 20 20 20 20 20 20 20 20 20 2f 20 70 68 72 61 73 65 20 72 6f 75 74 65 | ......*.........../.phrase.route |
c040 | 2d 61 64 64 72 20 3b 20 6e 61 6d 65 20 61 6e 64 20 72 6f 75 74 65 2d 61 64 64 72 0d 0a 20 20 20 | -addr.;.name.and.route-addr..... |
c060 | 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 75 62 6c 69 63 0d 0a 20 20 20 | ..*........*.@access.public..... |
c080 | 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 26 24 6d 61 69 6c 62 6f 78 20 54 68 65 20 | ..*.@param.string.&$mailbox.The. |
c0a0 | 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e | string.to.check........*.@return |
c0c0 | 20 62 6f 6f 6c 65 61 6e 20 53 75 63 63 65 73 73 20 6f 72 20 66 61 69 6c 75 72 65 2e 0d 0a 20 20 | .boolean.Success.or.failure..... |
c0e0 | 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 76 61 6c 69 64 61 74 65 4d 61 69 6c | ...*/......function.validateMail |
c100 | 62 6f 78 28 26 24 6d 61 69 6c 62 6f 78 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f | box(&$mailbox)......{........../ |
c120 | 2f 20 41 20 63 6f 75 70 6c 65 20 6f 66 20 64 65 66 61 75 6c 74 73 2e 0d 0a 20 20 20 20 20 20 20 | /.A.couple.of.defaults.......... |
c140 | 20 24 70 68 72 61 73 65 20 20 3d 20 27 27 3b 0d 0a 20 20 20 20 20 20 20 20 24 63 6f 6d 6d 65 6e | .$phrase..=.'';..........$commen |
c160 | 74 20 3d 20 27 27 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 43 61 74 63 68 20 61 6e 79 20 | t.=.'';............//.Catch.any. |
c180 | 52 46 43 38 32 32 20 63 6f 6d 6d 65 6e 74 73 20 61 6e 64 20 73 74 6f 72 65 20 74 68 65 6d 20 73 | RFC822.comments.and.store.them.s |
c1a0 | 65 70 61 72 61 74 65 6c 79 0d 0a 20 20 20 20 20 20 20 20 24 5f 6d 61 69 6c 62 6f 78 20 3d 20 24 | eparately..........$_mailbox.=.$ |
c1c0 | 6d 61 69 6c 62 6f 78 3b 0d 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 73 74 72 6c 65 6e 28 | mailbox;..........while.(strlen( |
c1e0 | 74 72 69 6d 28 24 5f 6d 61 69 6c 62 6f 78 29 29 20 3e 20 30 29 20 7b 0d 0a 20 20 20 20 20 20 20 | trim($_mailbox)).>.0).{......... |
c200 | 20 20 20 20 20 24 70 61 72 74 73 20 3d 20 65 78 70 6c 6f 64 65 28 27 28 27 2c 20 24 5f 6d 61 69 | .....$parts.=.explode('(',.$_mai |
c220 | 6c 62 6f 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 62 65 66 6f 72 65 5f 63 6f 6d 6d | lbox);..............$before_comm |
c240 | 65 6e 74 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 73 2c | ent.=.$this->_splitCheck($parts, |
c260 | 20 27 28 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 24 62 65 66 6f 72 65 5f | .'(');..............if.($before_ |
c280 | 63 6f 6d 6d 65 6e 74 20 21 3d 20 24 5f 6d 61 69 6c 62 6f 78 29 20 7b 0d 0a 20 20 20 20 20 20 20 | comment.!=.$_mailbox).{......... |
c2a0 | 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 72 73 74 20 63 68 61 72 20 73 68 6f 75 6c 64 20 62 65 | .........//.First.char.should.be |
c2c0 | 20 61 20 28 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 6d 6d 65 6e 74 20 20 | .a.(..................$comment.. |
c2e0 | 20 20 3d 20 73 75 62 73 74 72 28 73 74 72 5f 72 65 70 6c 61 63 65 28 24 62 65 66 6f 72 65 5f 63 | ..=.substr(str_replace($before_c |
c300 | 6f 6d 6d 65 6e 74 2c 20 27 27 2c 20 24 5f 6d 61 69 6c 62 6f 78 29 2c 20 31 29 3b 0d 0a 20 20 20 | omment,.'',.$_mailbox),.1);..... |
c320 | 20 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 72 74 73 20 20 20 20 20 20 3d 20 65 78 70 6c 6f | .............$parts......=.explo |
c340 | 64 65 28 27 29 27 2c 20 24 63 6f 6d 6d 65 6e 74 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | de(')',.$comment);.............. |
c360 | 20 20 20 20 24 63 6f 6d 6d 65 6e 74 20 20 20 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 | ....$comment....=.$this->_splitC |
c380 | 68 65 63 6b 28 24 70 61 72 74 73 2c 20 27 29 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 | heck($parts,.')');.............. |
c3a0 | 20 20 20 20 24 63 6f 6d 6d 65 6e 74 73 5b 5d 20 3d 20 24 63 6f 6d 6d 65 6e 74 3b 0d 0a 0d 0a 20 | ....$comments[].=.$comment;..... |
c3c0 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 2b 31 20 69 73 20 66 6f 72 20 74 68 65 20 | ...............//.+1.is.for.the. |
c3e0 | 74 72 61 69 6c 69 6e 67 20 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 5f 6d 61 | trailing.)..................$_ma |
c400 | 69 6c 62 6f 78 20 20 20 3d 20 73 75 62 73 74 72 28 24 5f 6d 61 69 6c 62 6f 78 2c 20 73 74 72 70 | ilbox...=.substr($_mailbox,.strp |
c420 | 6f 73 28 24 5f 6d 61 69 6c 62 6f 78 2c 20 24 63 6f 6d 6d 65 6e 74 29 2b 73 74 72 6c 65 6e 28 24 | os($_mailbox,.$comment)+strlen($ |
c440 | 63 6f 6d 6d 65 6e 74 29 2b 31 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 | comment)+1);..............}.else |
c460 | 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 62 72 65 61 6b 3b 0d 0a 20 20 20 20 | .{..................break;...... |
c480 | 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 | ........}..........}............ |
c4a0 | 66 6f 72 28 24 69 3d 30 3b 20 24 69 3c 63 6f 75 6e 74 28 40 24 63 6f 6d 6d 65 6e 74 73 29 3b 20 | for($i=0;.$i<count(@$comments);. |
c4c0 | 24 69 2b 2b 29 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6d 61 69 6c 62 6f 78 20 3d 20 73 | $i++){..............$mailbox.=.s |
c4e0 | 74 72 5f 72 65 70 6c 61 63 65 28 27 28 27 2e 24 63 6f 6d 6d 65 6e 74 73 5b 24 69 5d 2e 27 29 27 | tr_replace('('.$comments[$i].')' |
c500 | 2c 20 27 27 2c 20 24 6d 61 69 6c 62 6f 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 | ,.'',.$mailbox);..........}..... |
c520 | 20 20 20 20 20 24 6d 61 69 6c 62 6f 78 20 3d 20 74 72 69 6d 28 24 6d 61 69 6c 62 6f 78 29 3b 0d | .....$mailbox.=.trim($mailbox);. |
c540 | 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 6e 61 6d 65 20 2b 20 72 | ...........//.Check.for.name.+.r |
c560 | 6f 75 74 65 2d 61 64 64 72 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 73 75 62 73 74 72 28 24 6d | oute-addr..........if.(substr($m |
c580 | 61 69 6c 62 6f 78 2c 20 2d 31 29 20 3d 3d 20 27 3e 27 20 26 26 20 73 75 62 73 74 72 28 24 6d 61 | ailbox,.-1).==.'>'.&&.substr($ma |
c5a0 | 69 6c 62 6f 78 2c 20 30 2c 20 31 29 20 21 3d 20 27 3c 27 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 | ilbox,.0,.1).!=.'<').{.......... |
c5c0 | 20 20 20 20 24 70 61 72 74 73 20 20 3d 20 65 78 70 6c 6f 64 65 28 27 3c 27 2c 20 24 6d 61 69 6c | ....$parts..=.explode('<',.$mail |
c5e0 | 62 6f 78 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6e 61 6d 65 20 20 20 3d 20 24 74 68 | box);..............$name...=.$th |
c600 | 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 73 2c 20 27 3c 27 29 3b 0d 0a 0d | is->_splitCheck($parts,.'<');... |
c620 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 68 72 61 73 65 20 20 20 20 20 3d 20 74 72 69 6d 28 | .............$phrase.....=.trim( |
c640 | 24 6e 61 6d 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 6f 75 74 65 5f 61 64 64 72 | $name);..............$route_addr |
c660 | 20 3d 20 74 72 69 6d 28 73 75 62 73 74 72 28 24 6d 61 69 6c 62 6f 78 2c 20 73 74 72 6c 65 6e 28 | .=.trim(substr($mailbox,.strlen( |
c680 | 24 6e 61 6d 65 2e 27 3c 27 29 2c 20 2d 31 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | $name.'<'),.-1));............... |
c6a0 | 20 69 66 20 28 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 50 68 72 61 73 65 28 24 70 68 72 | .if.($this->_validatePhrase($phr |
c6c0 | 61 73 65 29 20 3d 3d 3d 20 66 61 6c 73 65 20 7c 7c 20 28 24 72 6f 75 74 65 5f 61 64 64 72 20 3d | ase).===.false.||.($route_addr.= |
c6e0 | 20 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 52 6f 75 74 65 41 64 64 72 28 24 72 6f 75 74 | .$this->_validateRouteAddr($rout |
c700 | 65 5f 61 64 64 72 29 29 20 3d 3d 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | e_addr)).===.false)............. |
c720 | 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f | .....return.false;............// |
c740 | 20 4f 6e 6c 79 20 67 6f 74 20 61 64 64 72 2d 73 70 65 63 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 | .Only.got.addr-spec..........}.e |
c760 | 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 46 69 72 73 74 20 73 6e 69 70 | lse.{..............//.First.snip |
c780 | 20 61 6e 67 6c 65 20 62 72 61 63 6b 65 74 73 20 69 66 20 70 72 65 73 65 6e 74 2e 0d 0a 20 20 20 | .angle.brackets.if.present...... |
c7a0 | 20 20 20 20 20 20 20 20 20 69 66 20 28 73 75 62 73 74 72 28 24 6d 61 69 6c 62 6f 78 2c 30 2c 31 | .........if.(substr($mailbox,0,1 |
c7c0 | 29 20 3d 3d 20 27 3c 27 20 26 26 20 73 75 62 73 74 72 28 24 6d 61 69 6c 62 6f 78 2c 2d 31 29 20 | ).==.'<'.&&.substr($mailbox,-1). |
c7e0 | 3d 3d 20 27 3e 27 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 61 64 64 72 5f 73 | ==.'>')..................$addr_s |
c800 | 70 65 63 20 3d 20 73 75 62 73 74 72 28 24 6d 61 69 6c 62 6f 78 2c 31 2c 2d 31 29 3b 0d 0a 20 20 | pec.=.substr($mailbox,1,-1);.... |
c820 | 20 20 20 20 20 20 20 20 20 20 65 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 | ..........else.................. |
c840 | 24 61 64 64 72 5f 73 70 65 63 20 3d 20 24 6d 61 69 6c 62 6f 78 3b 0d 0a 0d 0a 20 20 20 20 20 20 | $addr_spec.=.$mailbox;.......... |
c860 | 20 20 20 20 20 20 69 66 20 28 28 24 61 64 64 72 5f 73 70 65 63 20 3d 20 24 74 68 69 73 2d 3e 5f | ......if.(($addr_spec.=.$this->_ |
c880 | 76 61 6c 69 64 61 74 65 41 64 64 72 53 70 65 63 28 24 61 64 64 72 5f 73 70 65 63 29 29 20 3d 3d | validateAddrSpec($addr_spec)).== |
c8a0 | 3d 20 66 61 6c 73 65 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | =.false)..................return |
c8c0 | 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f | .false;..........}............// |
c8e0 | 20 43 6f 6e 73 74 72 75 63 74 20 74 68 65 20 6f 62 6a 65 63 74 20 74 68 61 74 20 77 69 6c 6c 20 | .Construct.the.object.that.will. |
c900 | 62 65 20 72 65 74 75 72 6e 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 24 6d 62 6f 78 20 3d 20 6e 65 | be.returned...........$mbox.=.ne |
c920 | 77 20 73 74 64 43 6c 61 73 73 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 41 64 64 20 | w.stdClass();............//.Add. |
c940 | 74 68 65 20 70 68 72 61 73 65 20 28 65 76 65 6e 20 69 66 20 65 6d 70 74 79 29 20 61 6e 64 20 63 | the.phrase.(even.if.empty).and.c |
c960 | 6f 6d 6d 65 6e 74 73 0d 0a 20 20 20 20 20 20 20 20 24 6d 62 6f 78 2d 3e 70 65 72 73 6f 6e 61 6c | omments..........$mbox->personal |
c980 | 20 3d 20 24 70 68 72 61 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 24 6d 62 6f 78 2d 3e 63 6f 6d 6d | .=.$phrase;..........$mbox->comm |
c9a0 | 65 6e 74 20 20 3d 20 69 73 73 65 74 28 24 63 6f 6d 6d 65 6e 74 73 29 20 3f 20 24 63 6f 6d 6d 65 | ent..=.isset($comments).?.$comme |
c9c0 | 6e 74 73 20 3a 20 61 72 72 61 79 28 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 | nts.:.array();............if.(is |
c9e0 | 73 65 74 28 24 72 6f 75 74 65 5f 61 64 64 72 29 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | set($route_addr)).{............. |
ca00 | 20 24 6d 62 6f 78 2d 3e 6d 61 69 6c 62 6f 78 20 3d 20 24 72 6f 75 74 65 5f 61 64 64 72 5b 27 6c | .$mbox->mailbox.=.$route_addr['l |
ca20 | 6f 63 61 6c 5f 70 61 72 74 27 5d 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6d 62 6f 78 2d | ocal_part'];..............$mbox- |
ca40 | 3e 68 6f 73 74 20 20 20 20 3d 20 24 72 6f 75 74 65 5f 61 64 64 72 5b 27 64 6f 6d 61 69 6e 27 5d | >host....=.$route_addr['domain'] |
ca60 | 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 6f 75 74 65 5f 61 64 64 72 5b 27 61 64 6c 27 | ;..............$route_addr['adl' |
ca80 | 5d 20 21 3d 3d 20 27 27 20 3f 20 24 6d 62 6f 78 2d 3e 61 64 6c 20 3d 20 24 72 6f 75 74 65 5f 61 | ].!==.''.?.$mbox->adl.=.$route_a |
caa0 | 64 64 72 5b 27 61 64 6c 27 5d 20 3a 20 27 27 3b 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 | ddr['adl'].:.'';..........}.else |
cac0 | 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6d 62 6f 78 2d 3e 6d 61 69 6c 62 6f 78 20 3d | .{..............$mbox->mailbox.= |
cae0 | 20 24 61 64 64 72 5f 73 70 65 63 5b 27 6c 6f 63 61 6c 5f 70 61 72 74 27 5d 3b 0d 0a 20 20 20 20 | .$addr_spec['local_part'];...... |
cb00 | 20 20 20 20 20 20 20 20 24 6d 62 6f 78 2d 3e 68 6f 73 74 20 20 20 20 3d 20 24 61 64 64 72 5f 73 | ........$mbox->host....=.$addr_s |
cb20 | 70 65 63 5b 27 64 6f 6d 61 69 6e 27 5d 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 | pec['domain'];..........}....... |
cb40 | 20 20 20 20 20 24 6d 61 69 6c 62 6f 78 20 3d 20 24 6d 62 6f 78 3b 0d 0a 20 20 20 20 20 20 20 20 | .....$mailbox.=.$mbox;.......... |
cb60 | 72 65 74 75 72 6e 20 74 72 75 65 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a | return.true;......}......../**.. |
cb80 | 20 20 20 20 20 2a 20 54 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 76 61 6c 69 64 61 74 65 73 20 61 | .....*.This.function.validates.a |
cba0 | 20 72 6f 75 74 65 2d 61 64 64 72 20 77 68 69 63 68 20 69 73 3a 0d 0a 20 20 20 20 20 2a 20 72 6f | .route-addr.which.is:.......*.ro |
cbc0 | 75 74 65 2d 61 64 64 72 20 3d 20 22 3c 22 20 5b 72 6f 75 74 65 5d 20 61 64 64 72 2d 73 70 65 63 | ute-addr.=."<".[route].addr-spec |
cbe0 | 20 22 3e 22 0d 0a 20 20 20 20 20 2a 0d 0a 20 20 20 20 20 2a 20 41 6e 67 6c 65 20 62 72 61 63 6b | .">".......*.......*.Angle.brack |
cc00 | 65 74 73 20 68 61 76 65 20 61 6c 72 65 61 64 79 20 62 65 65 6e 20 72 65 6d 6f 76 65 64 20 61 74 | ets.have.already.been.removed.at |
cc20 | 20 74 68 65 20 70 6f 69 6e 74 20 6f 66 0d 0a 20 20 20 20 20 2a 20 67 65 74 74 69 6e 67 20 74 6f | .the.point.of.......*.getting.to |
cc40 | 20 74 68 69 73 20 66 75 6e 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a | .this.function........*........* |
cc60 | 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 | .@access.private.......*.@param. |
cc80 | 73 74 72 69 6e 67 20 24 72 6f 75 74 65 5f 61 64 64 72 20 54 68 65 20 73 74 72 69 6e 67 20 74 6f | string.$route_addr.The.string.to |
cca0 | 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 46 61 | .check........*.@return.mixed.Fa |
ccc0 | 6c 73 65 20 6f 6e 20 66 61 69 6c 75 72 65 2c 20 6f 72 20 61 6e 20 61 72 72 61 79 20 63 6f 6e 74 | lse.on.failure,.or.an.array.cont |
cce0 | 61 69 6e 69 6e 67 20 76 61 6c 69 64 61 74 65 64 20 61 64 64 72 65 73 73 2f 72 6f 75 74 65 20 69 | aining.validated.address/route.i |
cd00 | 6e 66 6f 72 6d 61 74 69 6f 6e 20 6f 6e 20 73 75 63 63 65 73 73 2e 0d 0a 20 20 20 20 20 2a 2f 0d | nformation.on.success........*/. |
cd20 | 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 65 52 6f 75 74 65 41 64 64 72 | .....function._validateRouteAddr |
cd40 | 28 24 72 6f 75 74 65 5f 61 64 64 72 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f | ($route_addr)......{..........// |
cd60 | 20 43 68 65 63 6b 20 66 6f 72 20 63 6f 6c 6f 6e 2e 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 73 | .Check.for.colon...........if.(s |
cd80 | 74 72 70 6f 73 28 24 72 6f 75 74 65 5f 61 64 64 72 2c 20 27 3a 27 29 20 21 3d 3d 20 66 61 6c 73 | trpos($route_addr,.':').!==.fals |
cda0 | 65 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 61 72 74 73 20 3d 20 65 78 70 6c 6f | e).{..............$parts.=.explo |
cdc0 | 64 65 28 27 3a 27 2c 20 24 72 6f 75 74 65 5f 61 64 64 72 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 | de(':',.$route_addr);........... |
cde0 | 20 20 20 24 72 6f 75 74 65 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 | ...$route.=.$this->_splitCheck($ |
ce00 | 70 61 72 74 73 2c 20 27 3a 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a | parts,.':');..........}.else.{.. |
ce20 | 20 20 20 20 20 20 20 20 20 20 20 20 24 72 6f 75 74 65 20 3d 20 24 72 6f 75 74 65 5f 61 64 64 72 | ............$route.=.$route_addr |
ce40 | 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 49 66 20 24 72 | ;..........}............//.If.$r |
ce60 | 6f 75 74 65 20 69 73 20 73 61 6d 65 20 61 73 20 24 72 6f 75 74 65 5f 61 64 64 72 20 74 68 65 6e | oute.is.same.as.$route_addr.then |
ce80 | 20 74 68 65 20 63 6f 6c 6f 6e 20 77 61 73 20 69 6e 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 71 75 | .the.colon.was.in..........//.qu |
cea0 | 6f 74 65 73 20 6f 72 20 62 72 61 63 6b 65 74 73 20 6f 72 2c 20 6f 66 20 63 6f 75 72 73 65 2c 20 | otes.or.brackets.or,.of.course,. |
cec0 | 6e 6f 6e 20 65 78 69 73 74 65 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 24 72 6f 75 74 | non.existent...........if.($rout |
cee0 | 65 20 3d 3d 3d 20 24 72 6f 75 74 65 5f 61 64 64 72 29 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | e.===.$route_addr){............. |
cf00 | 20 75 6e 73 65 74 28 24 72 6f 75 74 65 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 61 64 | .unset($route);..............$ad |
cf20 | 64 72 5f 73 70 65 63 20 3d 20 24 72 6f 75 74 65 5f 61 64 64 72 3b 0d 0a 20 20 20 20 20 20 20 20 | dr_spec.=.$route_addr;.......... |
cf40 | 20 20 20 20 69 66 20 28 28 24 61 64 64 72 5f 73 70 65 63 20 3d 20 24 74 68 69 73 2d 3e 5f 76 61 | ....if.(($addr_spec.=.$this->_va |
cf60 | 6c 69 64 61 74 65 41 64 64 72 53 70 65 63 28 24 61 64 64 72 5f 73 70 65 63 29 29 20 3d 3d 3d 20 | lidateAddrSpec($addr_spec)).===. |
cf80 | 66 61 6c 73 65 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e | false).{..................return |
cfa0 | 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 | .false;..............}.......... |
cfc0 | 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 56 61 6c 69 64 61 74 | }.else.{..............//.Validat |
cfe0 | 65 20 72 6f 75 74 65 20 70 61 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 28 | e.route.part...............if.(( |
d000 | 24 72 6f 75 74 65 20 3d 20 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 52 6f 75 74 65 28 24 | $route.=.$this->_validateRoute($ |
d020 | 72 6f 75 74 65 29 29 20 3d 3d 3d 20 66 61 6c 73 65 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | route)).===.false).{............ |
d040 | 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | ......return.false;............. |
d060 | 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 61 64 64 72 5f 73 70 65 63 20 3d 20 73 | .}................$addr_spec.=.s |
d080 | 75 62 73 74 72 28 24 72 6f 75 74 65 5f 61 64 64 72 2c 20 73 74 72 6c 65 6e 28 24 72 6f 75 74 65 | ubstr($route_addr,.strlen($route |
d0a0 | 20 2e 20 27 3a 27 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 2f 2f 20 56 61 6c 69 | ...':'));................//.Vali |
d0c0 | 64 61 74 65 20 61 64 64 72 2d 73 70 65 63 20 70 61 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 | date.addr-spec.part............. |
d0e0 | 20 20 69 66 20 28 28 24 61 64 64 72 5f 73 70 65 63 20 3d 20 24 74 68 69 73 2d 3e 5f 76 61 6c 69 | ..if.(($addr_spec.=.$this->_vali |
d100 | 64 61 74 65 41 64 64 72 53 70 65 63 28 24 61 64 64 72 5f 73 70 65 63 29 29 20 3d 3d 3d 20 66 61 | dateAddrSpec($addr_spec)).===.fa |
d120 | 6c 73 65 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 | lse).{..................return.f |
d140 | 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d | alse;..............}..........}. |
d160 | 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 28 69 73 73 65 74 28 24 72 6f 75 74 65 29 29 20 7b 0d | ...........if.(isset($route)).{. |
d180 | 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 74 75 72 6e 5b 27 61 64 6c 27 5d 20 3d 20 24 72 | .............$return['adl'].=.$r |
d1a0 | 6f 75 74 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 | oute;..........}.else.{......... |
d1c0 | 20 20 20 20 20 24 72 65 74 75 72 6e 5b 27 61 64 6c 27 5d 20 3d 20 27 27 3b 0d 0a 20 20 20 20 20 | .....$return['adl'].=.'';....... |
d1e0 | 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 24 72 65 74 75 72 6e 20 3d 20 61 72 72 61 79 5f | ...}............$return.=.array_ |
d200 | 6d 65 72 67 65 28 24 72 65 74 75 72 6e 2c 20 24 61 64 64 72 5f 73 70 65 63 29 3b 0d 0a 20 20 20 | merge($return,.$addr_spec);..... |
d220 | 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 74 75 72 6e 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 | .....return.$return;......}..... |
d240 | 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 76 61 6c 69 64 | .../**.......*.Function.to.valid |
d260 | 61 74 65 20 61 20 72 6f 75 74 65 2c 20 77 68 69 63 68 20 69 73 3a 0d 0a 20 20 20 20 20 2a 20 72 | ate.a.route,.which.is:.......*.r |
d280 | 6f 75 74 65 20 3d 20 31 23 28 22 40 22 20 64 6f 6d 61 69 6e 29 20 22 3a 22 0d 0a 20 20 20 20 20 | oute.=.1#("@".domain).":"....... |
d2a0 | 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 20 20 | *........*.@access.private...... |
d2c0 | 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 72 6f 75 74 65 20 54 68 65 20 73 74 72 69 | .*.@param.string.$route.The.stri |
d2e0 | 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 | ng.to.check........*.@return.mix |
d300 | 65 64 20 46 61 6c 73 65 20 6f 6e 20 66 61 69 6c 75 72 65 2c 20 6f 72 20 74 68 65 20 76 61 6c 69 | ed.False.on.failure,.or.the.vali |
d320 | 64 61 74 65 64 20 24 72 6f 75 74 65 20 6f 6e 20 73 75 63 63 65 73 73 2e 0d 0a 20 20 20 20 20 2a | dated.$route.on.success........* |
d340 | 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 65 52 6f 75 74 65 28 24 | /......function._validateRoute($ |
d360 | 72 6f 75 74 65 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 53 70 6c 69 74 20 | route)......{..........//.Split. |
d380 | 6f 6e 20 63 6f 6d 6d 61 2e 0d 0a 20 20 20 20 20 20 20 20 24 64 6f 6d 61 69 6e 73 20 3d 20 65 78 | on.comma...........$domains.=.ex |
d3a0 | 70 6c 6f 64 65 28 27 2c 27 2c 20 74 72 69 6d 28 24 72 6f 75 74 65 29 29 3b 0d 0a 0d 0a 20 20 20 | plode(',',.trim($route));....... |
d3c0 | 20 20 20 20 20 66 6f 72 20 28 24 69 20 3d 20 30 3b 20 24 69 20 3c 20 63 6f 75 6e 74 28 24 64 6f | .....for.($i.=.0;.$i.<.count($do |
d3e0 | 6d 61 69 6e 73 29 3b 20 24 69 2b 2b 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 64 6f | mains);.$i++).{..............$do |
d400 | 6d 61 69 6e 73 5b 24 69 5d 20 3d 20 73 74 72 5f 72 65 70 6c 61 63 65 28 27 40 27 2c 20 27 27 2c | mains[$i].=.str_replace('@',.'', |
d420 | 20 74 72 69 6d 28 24 64 6f 6d 61 69 6e 73 5b 24 69 5d 29 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 | .trim($domains[$i]));........... |
d440 | 20 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 44 6f 6d 61 69 6e 28 24 | ...if.(!$this->_validateDomain($ |
d460 | 64 6f 6d 61 69 6e 73 5b 24 69 5d 29 29 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 | domains[$i])).return.false;..... |
d480 | 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 6f 75 74 65 3b | .....}............return.$route; |
d4a0 | 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 | ......}......../**.......*.Funct |
d4c0 | 69 6f 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 20 64 6f 6d 61 69 6e 2c 20 74 68 6f 75 67 68 | ion.to.validate.a.domain,.though |
d4e0 | 20 74 68 69 73 20 69 73 20 6e 6f 74 20 71 75 69 74 65 20 77 68 61 74 0d 0a 20 20 20 20 20 2a 20 | .this.is.not.quite.what.......*. |
d500 | 79 6f 75 20 65 78 70 65 63 74 20 6f 66 20 61 20 73 74 72 69 63 74 20 69 6e 74 65 72 6e 65 74 20 | you.expect.of.a.strict.internet. |
d520 | 64 6f 6d 61 69 6e 2e 0d 0a 20 20 20 20 20 2a 0d 0a 20 20 20 20 20 2a 20 64 6f 6d 61 69 6e 20 3d | domain........*.......*.domain.= |
d540 | 20 73 75 62 2d 64 6f 6d 61 69 6e 20 2a 28 22 2e 22 20 73 75 62 2d 64 6f 6d 61 69 6e 29 0d 0a 20 | .sub-domain.*(".".sub-domain)... |
d560 | 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a | ....*........*.@access.private.. |
d580 | 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 64 6f 6d 61 69 6e 20 54 68 65 | .....*.@param.string.$domain.The |
d5a0 | 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 | .string.to.check........*.@retur |
d5c0 | 6e 20 6d 69 78 65 64 20 46 61 6c 73 65 20 6f 6e 20 66 61 69 6c 75 72 65 2c 20 6f 72 20 74 68 65 | n.mixed.False.on.failure,.or.the |
d5e0 | 20 76 61 6c 69 64 61 74 65 64 20 64 6f 6d 61 69 6e 20 6f 6e 20 73 75 63 63 65 73 73 2e 0d 0a 20 | .validated.domain.on.success.... |
d600 | 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 65 44 6f | ....*/......function._validateDo |
d620 | 6d 61 69 6e 28 24 64 6f 6d 61 69 6e 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 2f 2f | main($domain)......{..........// |
d640 | 20 4e 6f 74 65 20 74 68 65 20 64 69 66 66 65 72 65 6e 74 20 75 73 65 20 6f 66 20 24 73 75 62 64 | .Note.the.different.use.of.$subd |
d660 | 6f 6d 61 69 6e 73 20 61 6e 64 20 24 73 75 62 5f 64 6f 6d 61 69 6e 73 20 20 20 20 20 20 20 20 20 | omains.and.$sub_domains......... |
d680 | 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0d 0a 20 20 20 20 20 20 20 20 24 73 75 62 64 6f 6d | .........................$subdom |
d6a0 | 61 69 6e 73 20 3d 20 65 78 70 6c 6f 64 65 28 27 2e 27 2c 20 24 64 6f 6d 61 69 6e 29 3b 0d 0a 0d | ains.=.explode('.',.$domain);... |
d6c0 | 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 63 6f 75 6e 74 28 24 73 75 62 64 6f 6d 61 69 6e | .........while.(count($subdomain |
d6e0 | 73 29 20 3e 20 30 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 73 75 62 5f 64 6f 6d 61 | s).>.0).{..............$sub_doma |
d700 | 69 6e 73 5b 5d 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 73 75 62 64 | ins[].=.$this->_splitCheck($subd |
d720 | 6f 6d 61 69 6e 73 2c 20 27 2e 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 | omains,.'.');..............for.( |
d740 | 24 69 20 3d 20 30 3b 20 24 69 20 3c 20 24 74 68 69 73 2d 3e 69 6e 64 65 78 20 2b 20 31 3b 20 24 | $i.=.0;.$i.<.$this->index.+.1;.$ |
d760 | 69 2b 2b 29 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 72 72 61 79 5f 73 68 69 66 | i++)..................array_shif |
d780 | 74 28 24 73 75 62 64 6f 6d 61 69 6e 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 | t($subdomains);..........}...... |
d7a0 | 20 20 20 20 20 20 66 6f 72 20 28 24 69 20 3d 20 30 3b 20 24 69 20 3c 20 63 6f 75 6e 74 28 24 73 | ......for.($i.=.0;.$i.<.count($s |
d7c0 | 75 62 5f 64 6f 6d 61 69 6e 73 29 3b 20 24 69 2b 2b 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 | ub_domains);.$i++).{............ |
d7e0 | 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 53 75 62 64 6f 6d 61 69 6e | ..if.(!$this->_validateSubdomain |
d800 | 28 74 72 69 6d 28 24 73 75 62 5f 64 6f 6d 61 69 6e 73 5b 24 69 5d 29 29 29 0d 0a 20 20 20 20 20 | (trim($sub_domains[$i])))....... |
d820 | 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 | ...........return.false;........ |
d840 | 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4d 61 6e 61 67 65 64 20 74 6f 20 67 65 74 | ..}............//.Managed.to.get |
d860 | 20 68 65 72 65 2c 20 73 6f 20 72 65 74 75 72 6e 20 69 6e 70 75 74 2e 0d 0a 20 20 20 20 20 20 20 | .here,.so.return.input.......... |
d880 | 20 72 65 74 75 72 6e 20 24 64 6f 6d 61 69 6e 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f | .return.$domain;......}......../ |
d8a0 | 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 | **.......*.Function.to.validate. |
d8c0 | 61 20 73 75 62 64 6f 6d 61 69 6e 3a 0d 0a 20 20 20 20 20 2a 20 20 20 73 75 62 64 6f 6d 61 69 6e | a.subdomain:.......*...subdomain |
d8e0 | 20 3d 20 64 6f 6d 61 69 6e 2d 72 65 66 20 2f 20 64 6f 6d 61 69 6e 2d 6c 69 74 65 72 61 6c 0d 0a | .=.domain-ref./.domain-literal.. |
d900 | 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d | .....*........*.@access.private. |
d920 | 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 73 75 62 64 6f 6d 61 69 6e | ......*.@param.string.$subdomain |
d940 | 20 54 68 65 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 | .The.string.to.check........*.@r |
d960 | 65 74 75 72 6e 20 62 6f 6f 6c 65 61 6e 20 53 75 63 63 65 73 73 20 6f 72 20 66 61 69 6c 75 72 65 | eturn.boolean.Success.or.failure |
d980 | 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 | ........*/......function._valida |
d9a0 | 74 65 53 75 62 64 6f 6d 61 69 6e 28 24 73 75 62 64 6f 6d 61 69 6e 29 0d 0a 20 20 20 20 7b 0d 0a | teSubdomain($subdomain)......{.. |
d9c0 | 20 20 20 20 20 20 20 20 69 66 20 28 70 72 65 67 5f 6d 61 74 63 68 28 27 7c 5e 5c 5b 28 2e 2a 29 | ........if.(preg_match('|^\[(.*) |
d9e0 | 5d 24 7c 27 2c 20 24 73 75 62 64 6f 6d 61 69 6e 2c 20 24 61 72 72 29 29 7b 0d 0a 20 20 20 20 20 | ]$|',.$subdomain,.$arr)){....... |
da00 | 20 20 20 20 20 20 20 69 66 20 28 21 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 44 6c 69 74 | .......if.(!$this->_validateDlit |
da20 | 65 72 61 6c 28 24 61 72 72 5b 31 5d 29 29 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 | eral($arr[1])).return.false;.... |
da40 | 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 28 | ......}.else.{..............if.( |
da60 | 21 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 41 74 6f 6d 28 24 73 75 62 64 6f 6d 61 69 6e | !$this->_validateAtom($subdomain |
da80 | 29 29 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 | )).return.false;..........}..... |
daa0 | 20 20 20 20 20 20 20 2f 2f 20 47 6f 74 20 68 65 72 65 2c 20 73 6f 20 72 65 74 75 72 6e 20 73 75 | .......//.Got.here,.so.return.su |
dac0 | 63 63 65 73 73 66 75 6c 2e 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 3b 0d | ccessful...........return.true;. |
dae0 | 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 69 | .....}......../**.......*.Functi |
db00 | 6f 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 61 20 64 6f 6d 61 69 6e 20 6c 69 74 65 72 61 6c 3a | on.to.validate.a.domain.literal: |
db20 | 0d 0a 20 20 20 20 20 2a 20 20 20 64 6f 6d 61 69 6e 2d 6c 69 74 65 72 61 6c 20 3d 20 20 22 5b 22 | .......*...domain-literal.=.."[" |
db40 | 20 2a 28 64 74 65 78 74 20 2f 20 71 75 6f 74 65 64 2d 70 61 69 72 29 20 22 5d 22 0d 0a 20 20 20 | .*(dtext./.quoted-pair)."]"..... |
db60 | 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 0d 0a 20 20 | ..*........*.@access.private.... |
db80 | 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 64 6c 69 74 65 72 61 6c 20 54 68 65 | ...*.@param.string.$dliteral.The |
dba0 | 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 | .string.to.check........*.@retur |
dbc0 | 6e 20 62 6f 6f 6c 65 61 6e 20 53 75 63 63 65 73 73 20 6f 72 20 66 61 69 6c 75 72 65 2e 0d 0a 20 | n.boolean.Success.or.failure.... |
dbe0 | 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 65 44 6c | ....*/......function._validateDl |
dc00 | 69 74 65 72 61 6c 28 24 64 6c 69 74 65 72 61 6c 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 | iteral($dliteral)......{........ |
dc20 | 20 20 72 65 74 75 72 6e 20 21 70 72 65 67 5f 6d 61 74 63 68 28 27 2f 28 2e 29 5b 5d 5b 5c 78 30 | ..return.!preg_match('/(.)[][\x0 |
dc40 | 44 5c 5c 5c 5c 5d 2f 27 2c 20 24 64 6c 69 74 65 72 61 6c 2c 20 24 6d 61 74 63 68 65 73 29 20 26 | D\\\\]/',.$dliteral,.$matches).& |
dc60 | 26 20 24 6d 61 74 63 68 65 73 5b 31 5d 20 21 3d 20 27 5c 5c 27 3b 0d 0a 20 20 20 20 7d 0d 0a 0d | &.$matches[1].!=.'\\';......}... |
dc80 | 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 20 20 2a 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 76 61 6c | ...../**.......*.Function.to.val |
dca0 | 69 64 61 74 65 20 61 6e 20 61 64 64 72 2d 73 70 65 63 2e 0d 0a 20 20 20 20 20 2a 0d 0a 20 20 20 | idate.an.addr-spec........*..... |
dcc0 | 20 20 2a 20 61 64 64 72 2d 73 70 65 63 20 3d 20 6c 6f 63 61 6c 2d 70 61 72 74 20 22 40 22 20 64 | ..*.addr-spec.=.local-part."@".d |
dce0 | 6f 6d 61 69 6e 0d 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 | omain.......*........*.@access.p |
dd00 | 72 69 76 61 74 65 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 61 64 | rivate.......*.@param.string.$ad |
dd20 | 64 72 5f 73 70 65 63 20 54 68 65 20 73 74 72 69 6e 67 20 74 6f 20 63 68 65 63 6b 2e 0d 0a 20 20 | dr_spec.The.string.to.check..... |
dd40 | 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 46 61 6c 73 65 20 6f 6e 20 66 61 69 6c | ...*.@return.mixed.False.on.fail |
dd60 | 75 72 65 2c 20 6f 72 20 74 68 65 20 76 61 6c 69 64 61 74 65 64 20 61 64 64 72 2d 73 70 65 63 20 | ure,.or.the.validated.addr-spec. |
dd80 | 6f 6e 20 73 75 63 63 65 73 73 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 | on.success........*/......functi |
dda0 | 6f 6e 20 5f 76 61 6c 69 64 61 74 65 41 64 64 72 53 70 65 63 28 24 61 64 64 72 5f 73 70 65 63 29 | on._validateAddrSpec($addr_spec) |
ddc0 | 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 24 61 64 64 72 5f 73 70 65 63 20 3d 20 74 72 | ......{..........$addr_spec.=.tr |
dde0 | 69 6d 28 24 61 64 64 72 5f 73 70 65 63 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 53 70 | im($addr_spec);............//.Sp |
de00 | 6c 69 74 20 6f 6e 20 40 20 73 69 67 6e 20 69 66 20 74 68 65 72 65 20 69 73 20 6f 6e 65 2e 0d 0a | lit.on.@.sign.if.there.is.one... |
de20 | 20 20 20 20 20 20 20 20 69 66 20 28 73 74 72 70 6f 73 28 24 61 64 64 72 5f 73 70 65 63 2c 20 27 | ........if.(strpos($addr_spec,.' |
de40 | 40 27 29 20 21 3d 3d 20 66 61 6c 73 65 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 70 | @').!==.false).{..............$p |
de60 | 61 72 74 73 20 20 20 20 20 20 3d 20 65 78 70 6c 6f 64 65 28 27 40 27 2c 20 24 61 64 64 72 5f 73 | arts......=.explode('@',.$addr_s |
de80 | 70 65 63 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 6c 6f 63 61 6c 5f 70 61 72 74 20 3d | pec);..............$local_part.= |
dea0 | 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 74 73 2c 20 27 40 27 29 | .$this->_splitCheck($parts,.'@') |
dec0 | 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 64 6f 6d 61 69 6e 20 20 20 20 20 3d 20 73 75 62 | ;..............$domain.....=.sub |
dee0 | 73 74 72 28 24 61 64 64 72 5f 73 70 65 63 2c 20 73 74 72 6c 65 6e 28 24 6c 6f 63 61 6c 5f 70 61 | str($addr_spec,.strlen($local_pa |
df00 | 72 74 20 2e 20 27 40 27 29 29 3b 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 4e 6f 20 40 20 73 | rt...'@'));............//.No.@.s |
df20 | 69 67 6e 20 73 6f 20 61 73 73 75 6d 65 20 74 68 65 20 64 65 66 61 75 6c 74 20 64 6f 6d 61 69 6e | ign.so.assume.the.default.domain |
df40 | 2e 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 | ...........}.else.{............. |
df60 | 20 24 6c 6f 63 61 6c 5f 70 61 72 74 20 3d 20 24 61 64 64 72 5f 73 70 65 63 3b 0d 0a 20 20 20 20 | .$local_part.=.$addr_spec;...... |
df80 | 20 20 20 20 20 20 20 20 24 64 6f 6d 61 69 6e 20 20 20 20 20 3d 20 24 74 68 69 73 2d 3e 64 65 66 | ........$domain.....=.$this->def |
dfa0 | 61 75 6c 74 5f 64 6f 6d 61 69 6e 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 | ault_domain;..........}......... |
dfc0 | 20 20 20 69 66 20 28 28 24 6c 6f 63 61 6c 5f 70 61 72 74 20 3d 20 24 74 68 69 73 2d 3e 5f 76 61 | ...if.(($local_part.=.$this->_va |
dfe0 | 6c 69 64 61 74 65 4c 6f 63 61 6c 50 61 72 74 28 24 6c 6f 63 61 6c 5f 70 61 72 74 29 29 20 3d 3d | lidateLocalPart($local_part)).== |
e000 | 3d 20 66 61 6c 73 65 29 20 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 | =.false).return.false;.......... |
e020 | 69 66 20 28 28 24 64 6f 6d 61 69 6e 20 20 20 20 20 3d 20 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 | if.(($domain.....=.$this->_valid |
e040 | 61 74 65 44 6f 6d 61 69 6e 28 24 64 6f 6d 61 69 6e 29 29 20 3d 3d 3d 20 66 61 6c 73 65 29 20 72 | ateDomain($domain)).===.false).r |
e060 | 65 74 75 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 0d 0a 20 20 20 20 20 20 20 20 | eturn.false;.................... |
e080 | 2f 2f 20 47 6f 74 20 68 65 72 65 20 73 6f 20 72 65 74 75 72 6e 20 73 75 63 63 65 73 73 66 75 6c | //.Got.here.so.return.successful |
e0a0 | 2e 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 61 72 72 61 79 28 27 6c 6f 63 61 6c 5f 70 | ...........return.array('local_p |
e0c0 | 61 72 74 27 20 3d 3e 20 24 6c 6f 63 61 6c 5f 70 61 72 74 2c 20 27 64 6f 6d 61 69 6e 27 20 3d 3e | art'.=>.$local_part,.'domain'.=> |
e0e0 | 20 24 64 6f 6d 61 69 6e 29 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 | .$domain);......}......../**.... |
e100 | 20 20 20 2a 20 46 75 6e 63 74 69 6f 6e 20 74 6f 20 76 61 6c 69 64 61 74 65 20 74 68 65 20 6c 6f | ...*.Function.to.validate.the.lo |
e120 | 63 61 6c 20 70 61 72 74 20 6f 66 20 61 6e 20 61 64 64 72 65 73 73 3a 0d 0a 20 20 20 20 20 2a 20 | cal.part.of.an.address:.......*. |
e140 | 20 20 6c 6f 63 61 6c 2d 70 61 72 74 20 3d 20 77 6f 72 64 20 2a 28 22 2e 22 20 77 6f 72 64 29 0d | ..local-part.=.word.*(".".word). |
e160 | 0a 20 20 20 20 20 2a 20 0d 0a 20 20 20 20 20 2a 20 40 61 63 63 65 73 73 20 70 72 69 76 61 74 65 | ......*........*.@access.private |
e180 | 0d 0a 20 20 20 20 20 2a 20 40 70 61 72 61 6d 20 73 74 72 69 6e 67 20 24 6c 6f 63 61 6c 5f 70 61 | .......*.@param.string.$local_pa |
e1a0 | 72 74 0d 0a 20 20 20 20 20 2a 20 40 72 65 74 75 72 6e 20 6d 69 78 65 64 20 46 61 6c 73 65 20 6f | rt.......*.@return.mixed.False.o |
e1c0 | 6e 20 66 61 69 6c 75 72 65 2c 20 6f 72 20 74 68 65 20 76 61 6c 69 64 61 74 65 64 20 6c 6f 63 61 | n.failure,.or.the.validated.loca |
e1e0 | 6c 20 70 61 72 74 20 6f 6e 20 73 75 63 63 65 73 73 2e 0d 0a 20 20 20 20 20 2a 2f 0d 0a 20 20 20 | l.part.on.success........*/..... |
e200 | 20 66 75 6e 63 74 69 6f 6e 20 5f 76 61 6c 69 64 61 74 65 4c 6f 63 61 6c 50 61 72 74 28 24 6c 6f | .function._validateLocalPart($lo |
e220 | 63 61 6c 5f 70 61 72 74 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 24 70 61 72 74 73 | cal_part)......{..........$parts |
e240 | 20 3d 20 65 78 70 6c 6f 64 65 28 27 2e 27 2c 20 24 6c 6f 63 61 6c 5f 70 61 72 74 29 3b 0d 0a 0d | .=.explode('.',.$local_part);... |
e260 | 0a 20 20 20 20 20 20 20 20 2f 2f 20 53 70 6c 69 74 20 74 68 65 20 6c 6f 63 61 6c 5f 70 61 72 74 | .........//.Split.the.local_part |
e280 | 20 69 6e 74 6f 20 77 6f 72 64 73 2e 0d 0a 20 20 20 20 20 20 20 20 77 68 69 6c 65 20 28 63 6f 75 | .into.words...........while.(cou |
e2a0 | 6e 74 28 24 70 61 72 74 73 29 20 3e 20 30 29 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 77 | nt($parts).>.0){..............$w |
e2c0 | 6f 72 64 73 5b 5d 20 3d 20 24 74 68 69 73 2d 3e 5f 73 70 6c 69 74 43 68 65 63 6b 28 24 70 61 72 | ords[].=.$this->_splitCheck($par |
e2e0 | 74 73 2c 20 27 2e 27 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 20 28 24 69 20 3d | ts,.'.');..............for.($i.= |
e300 | 20 30 3b 20 24 69 20 3c 20 24 74 68 69 73 2d 3e 69 6e 64 65 78 20 2b 20 31 3b 20 24 69 2b 2b 29 | .0;.$i.<.$this->index.+.1;.$i++) |
e320 | 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 61 72 72 61 79 5f 73 68 69 66 74 28 | .{..................array_shift( |
e340 | 24 70 61 72 74 73 29 3b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 | $parts);..............}......... |
e360 | 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 2f 2f 20 56 61 6c 69 64 61 74 65 20 65 61 63 68 20 77 | .}............//.Validate.each.w |
e380 | 6f 72 64 2e 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 20 28 24 69 20 3d 20 30 3b 20 24 69 20 3c 20 | ord...........for.($i.=.0;.$i.<. |
e3a0 | 63 6f 75 6e 74 28 24 77 6f 72 64 73 29 3b 20 24 69 2b 2b 29 20 7b 0d 0a 20 20 20 20 20 20 20 20 | count($words);.$i++).{.......... |
e3c0 | 20 20 20 20 69 66 20 28 24 74 68 69 73 2d 3e 5f 76 61 6c 69 64 61 74 65 50 68 72 61 73 65 28 74 | ....if.($this->_validatePhrase(t |
e3e0 | 72 69 6d 28 24 77 6f 72 64 73 5b 24 69 5d 29 29 20 3d 3d 3d 20 66 61 6c 73 65 29 20 72 65 74 75 | rim($words[$i])).===.false).retu |
e400 | 72 6e 20 66 61 6c 73 65 3b 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 | rn.false;..........}............ |
e420 | 2f 2f 20 4d 61 6e 61 67 65 64 20 74 6f 20 67 65 74 20 68 65 72 65 2c 20 73 6f 20 72 65 74 75 72 | //.Managed.to.get.here,.so.retur |
e440 | 6e 20 74 68 65 20 69 6e 70 75 74 2e 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 6c 6f | n.the.input...........return.$lo |
e460 | 63 61 6c 5f 70 61 72 74 3b 0d 0a 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 2f 2a 2a 0d 0a 20 20 20 | cal_part;......}......../**..... |
e480 | 20 2a 20 52 65 74 75 72 6e 73 20 61 6e 20 61 70 70 72 6f 78 69 6d 61 74 65 20 63 6f 75 6e 74 20 | .*.Returns.an.approximate.count. |
e4a0 | 6f 66 20 68 6f 77 20 6d 61 6e 79 20 61 64 64 72 65 73 73 65 73 20 61 72 65 0d 0a 20 20 20 20 2a | of.how.many.addresses.are......* |
e4c0 | 20 69 6e 20 74 68 65 20 67 69 76 65 6e 20 73 74 72 69 6e 67 2e 20 54 68 69 73 20 69 73 20 41 50 | .in.the.given.string..This.is.AP |
e4e0 | 50 52 4f 58 49 4d 41 54 45 20 61 73 20 69 74 20 6f 6e 6c 79 20 73 70 6c 69 74 73 0d 0a 20 20 20 | PROXIMATE.as.it.only.splits..... |
e500 | 20 2a 20 62 61 73 65 64 20 6f 6e 20 61 20 63 6f 6d 6d 61 20 77 68 69 63 68 20 68 61 73 20 6e 6f | .*.based.on.a.comma.which.has.no |
e520 | 20 70 72 65 63 65 64 69 6e 67 20 62 61 63 6b 73 6c 61 73 68 2e 20 43 6f 75 6c 64 20 62 65 0d 0a | .preceding.backslash..Could.be.. |
e540 | 20 20 20 20 2a 20 75 73 65 66 75 6c 20 61 73 20 6c 61 72 67 65 20 61 6d 6f 75 6e 74 73 20 6f 66 | ....*.useful.as.large.amounts.of |
e560 | 20 61 64 64 72 65 73 73 65 73 20 77 69 6c 6c 20 65 6e 64 20 75 70 20 70 72 6f 64 75 63 69 6e 67 | .addresses.will.end.up.producing |
e580 | 0d 0a 20 20 20 20 2a 20 2a 6c 61 72 67 65 2a 20 73 74 72 75 63 74 75 72 65 73 20 77 68 65 6e 20 | ......*.*large*.structures.when. |
e5a0 | 75 73 65 64 20 77 69 74 68 20 70 61 72 73 65 41 64 64 72 65 73 73 4c 69 73 74 28 29 2e 0d 0a 20 | used.with.parseAddressList().... |
e5c0 | 20 20 20 2a 0d 0a 20 20 20 20 2a 20 40 70 61 72 61 6d 20 20 73 74 72 69 6e 67 20 24 64 61 74 61 | ...*......*.@param..string.$data |
e5e0 | 20 41 64 64 72 65 73 73 65 73 20 74 6f 20 63 6f 75 6e 74 0d 0a 20 20 20 20 2a 20 40 72 65 74 75 | .Addresses.to.count......*.@retu |
e600 | 72 6e 20 69 6e 74 20 20 20 20 20 20 20 20 20 20 41 70 70 72 6f 78 69 6d 61 74 65 20 63 6f 75 6e | rn.int..........Approximate.coun |
e620 | 74 0d 0a 20 20 20 20 2a 2f 0d 0a 20 20 20 20 66 75 6e 63 74 69 6f 6e 20 61 70 70 72 6f 78 69 6d | t......*/......function.approxim |
e640 | 61 74 65 43 6f 75 6e 74 28 24 64 61 74 61 29 0d 0a 20 20 20 20 7b 0d 0a 20 20 20 20 20 20 20 20 | ateCount($data)......{.......... |
e660 | 72 65 74 75 72 6e 20 63 6f 75 6e 74 28 70 72 65 67 5f 73 70 6c 69 74 28 27 2f 28 3f 3c 21 5c 5c | return.count(preg_split('/(?<!\\ |
e680 | 5c 5c 29 2c 2f 27 2c 20 24 64 61 74 61 29 29 3b 0d 0a 20 20 20 20 7d 0d 0a 7d 0d 0a 3f 3e 0d 0a | \\),/',.$data));......}..}..?>.. |
e6a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e6c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e6e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e700 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e720 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e740 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e760 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e780 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e7a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e7c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e7e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e800 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e820 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e840 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e860 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e880 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e8a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e8c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e8e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e900 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e920 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e940 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e960 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e980 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e9a0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e9c0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |
e9e0 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | ................................ |