Doc #51361 [NEW]: Your "feature" Wordwrap on user notes
| From: | dev at 10e12 dot net | Date: | Tue, 23 Mar 2010 11:34:17 +0000 |
| Subject: | Doc #51361 [NEW]: Your "feature" Wordwrap on user notes | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-4091@lists.php.net to get a copy of this message | ||
From:
Operating system: Win XP
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:Your "feature" Wordwrap on user notes
Description:
------------
Your note contains a bit of text that will result in a line that is too
long, even after using wordwrap().
This is getting mighty annoying.
I have edited my post some 10 times and broken it below 40 chars per line.
Still no good.
Sorry you cannot Cut off a function name when I write a php function name
in the screen without the code becoming illegible/unreadable after post.
This "feature" should pass to the far away neverland as 96% of webbrowsers
are now using in excess of 1024 pixel resolution width, don't you think?
Test script:
---------------
What about this for an example...
Intending to use it in passing a "semi-guaranteed"
properly seeded random number to a client, then to
capture input from the user which must be encrypted
client side before being sent to the server again
a) during the same session and,
b) within a set time limit.
for more reading also see:
AES Rijndael enc/dec routines for javaScript
developed and tested by Herbert Hanewinkel,
http://www.hanewin.net/encrypt/aes/aes.htm
<?php
/*
calling the function, prepping the data to send to
the client... , who then uses it in a javascript
implementation of AES Encrypt.
*/
function SHA256($str, $keyval=""){
if ($keyval!==""){//not null or empty
$sHash = mhash(Constant('MHASH_SHA256'),$str, $keyval);
}else{
$sHash = mhash(Constant('MHASH_SHA256'),$str);
}
// same as Binary 2 Hex conversion
return implode(unpack('H*',$sHash),'');
}
/*---------------------------------------------------
Radomizing the random data with fixed data for
the user and location If return value maximum
is set to zero (0) the function uses mt_getrandmax
If both retMin and retMax is zero (0) the function
uses mt_rand w.o. limits
*----------------------------------------------------*/
function local_prgn($retMin = 0, $retMax = 0){
// first get the session id of the request session
$sSrv = session_id();
// the following is valid only on the current server
$sSrv =
implode(unpack($_SERVER['SERVER_NAME'].$_SERVER['SERVER_ADDR'].$sSrv),'');
// the following applies only to the requesting client
$sReq =
implode(unpack($_SERVER['REMOTE_ADDR'].$_SERVER['REQUEST_TIME']),'');
// the following generates a 256 bit hash
$sSeed = SHA256($sSrv,$sReq); // get a SHA256 seed based on the current
values
// get a random value based on the uniqueness of the seed above
mt_srand($sSeed); // seed the random num gen
// some error handling and checking
if ($retMin > $retMax){
// if wrong order of range values
$rx = $retMax; $retMax = $retMin; $retMin = $rx; // swap
} else if ($retMin == $retMax){ //meaningless range, not very
random
$retMin = 0; $retMax = 0; //ensure for next check in this range
}
// select what we need to return
if ((($retMax == 0)&&($retMax = mt_getrandmax))||($retMin==$retMax)){
return mt_getrandmax();
}else{
return mt_getrandmax($retMin,$retMax);
}
}
?>
Expected result:
----------------
less bugs, more speed
Actual result:
--------------
to many dumb bugs
--
Edit bug report at http://bugs.php.net/bug.php?id=51361&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51361&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51361&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51361&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=51361&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51361&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51361&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51361&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51361&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51361&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51361&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51361&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51361&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51361&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51361&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51361&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51361&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51361&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51361&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51361&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51361&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51361&r=mysqlcfg