PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » HTML » HTML_Crypt » Bug #717

Code Incorrectly Decrypts 'Young'

Details

Submitted2004-02-09 18:19 UTC
Fromcrocha at polychrome dot org
Assignedmikedransfield
StatusClosed
PackageHTML_Crypt
PHP Version4.3.3
OSRedhat Linux
Roadmaps(Not assigned)

Comments

[2004-02-09 18:19 UTC] crocha at polychrome dot org

Description:
------------
When the string 'Young' (with a capital Y only) is part of the string to be encrypted, JavaScript outputs 'ung' instead.

This bug has been verified on the following browsers:

Internet Explorer 6.0 Windows
Mozilla 1.5 Windows
Mozilla 1.2.1 Linux

PHP Configure Commands Follow:

'./configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-pear' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-pcre=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs=/usr/sbin/apxs'

Reproduce code:
---------------
<?php
$c = new HTML_crypt('Young');
$c->output();

// Outputs 'ung'
?>

<?php
$c = new HTML_crypt('young');
$c->output();

// Outputs 'young'
?>

<?php
$c = new HTML_crypt('Hello, Youngster');
$c->output();

// Outputs 'Hello, ungster'
?>

Actual result:
--------------
Javascript output follows:

<script language="JavaScript" type="text/JavaScript">var a,s,n;function f5c528387a02ae4c89272484269b8f611(s){r='';for(i=0;i<s.length;i++){n=s.charCodeAt(i);if(n>=8364){n=128;}r+=String.fromCharCode(n-3);}return r;}a='\rxqj';document.write (f5c528387a02ae4c89272484269b8f611(a));</script>