Bug Report #1214

Patches to change substr($x, $y, 1) to $x[$y]

Added by Sean o - almost 3 years ago. Updated over 2 years ago.

Status:Closed Start date:
Priority:Normal Due date:
Assignee:Sam de Freyssinet % Done:

100%

Category:Core
Target version:2.3.3
Resolution: Points:

Description

Provided are some patches that change substr($x, $y, 1) to $x[$y], avoiding the substr function call.

Archive.php.diff (484 Bytes) Sean o -, 03/28/2009 02:23 am

Auth.php.diff (478 Bytes) Sean o -, 03/28/2009 02:23 am

Kodoc.php.diff (844 Bytes) Sean o -, 03/28/2009 02:23 am

Unit_Test.php.diff (503 Bytes) Sean o -, 03/28/2009 02:24 am

valid.php.diff (721 Bytes) Sean o -, 03/28/2009 02:24 am

0001-Use-array-access-for-single-character-instead-of-sub.patch (856 Bytes) Chris Bandy, 05/14/2009 09:12 am

Auth.php.diff (620 Bytes) jordan shaw, 07/28/2009 09:04 pm


Related issues

related to Auth Module for v2.x - Bug Report #1944: Calling Auth->find_salt() with an empty string and throws... Auth Module for v2.x - 1.0.0 Closed 08/13/2009
related to Kohana v2.x - Bug Report #1894: "Uninitialized string offset: 0" Error in Kodoc 2.4 Rejected 08/02/2009

Associated revisions

History

Updated by Jeremy Bush almost 3 years ago

Looks like these are just performance enhancements, so they could go in 2.3.3.

Updated by Sam de Freyssinet over 2 years ago

  • Status changed from New to Assigned
  • Assignee set to Sam de Freyssinet

Updated by Sam de Freyssinet over 2 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Applied in changeset r4367.

Updated by jordan shaw over 2 years ago

  • File Auth.php.diff added
  • Status changed from Closed to Feedback
  • 11 set to 2.3.4

I had to wrap the for loop in a if(!empty($password)), otherwise $password[$offset + $i] was trying to referenced nothing.

Updated by Jeremy Bush over 2 years ago

  • Status changed from Feedback to Closed

Please file a new ticket for the Auth bug.

Also available in: Atom PDF