Ticket #388 (closed defect: fixed)

Opened 8 months ago

Last modified 2 weeks ago

codegen entering forbidden directories

Reported by: marcosdsanchez Owned by: somebody
Priority: minor Milestone: 1.1.3
Component: Codegen Version: 1.0.0 Stable
Keywords: Cc:

Description

codegen is entering to SVN and CVS directories when it shouldn't.
I attach a patch with the solution and I added git directory to the forbidden list.

Attachments

ticket388.2.diff (1.6 kB) - added by marcosdsanchez 8 months ago.
re-rolled patch
ticket388v3.patch (1.6 kB) - added by VexedPanda 5 months ago.
Try this one.

Change History

Changed 8 months ago by VexedPanda

There's a ton of formatting changes in that diff making it harder to read. Mind re-rolling?

Changed 8 months ago by marcosdsanchez

Main difference is here:

I added

  /**
   * @var string[] array of directories to be excluded in codegen
   * @access protected
   */
   protected static $strDirectoriesToExcludeArray = array('.','..','.svn','.cvs','.git')

and replaced

((!in_array($strModuleName,self::$strDirectoriesToExcludeArray)) &&

instead of
if (($strModuleName != '.') && ($strModuleName != '..') && ($strModuleName != 'SVN') && ($strModuleName != 'CVS') &&

Lines 266 and 281

Changed 8 months ago by marcosdsanchez

  • status changed from new to in_QA

Changed 8 months ago by marcosdsanchez

re-rolled patch

Changed 8 months ago by VexedPanda

Some comments:
I worry about backwards compatability, let's make sure "svn" is also in the ignore list, same as before.
Can we move the array_map calls outside the loops? Optionally, we could remove it entirely and just tell the user that entries in the array must be lower case.

Also, is there any way that non-ascii filenames could break strtolower? I guess specifically it only matters if it could possibly mangle a filename into one that matched the ignore list, which seems unlikely, but worth checking.

Changed 7 months ago by marcosdsanchez

Changed 7 months ago by alex94040

  • status changed from in_QA to assigned
  • milestone changed from 1.0.2 Stable to 1.0.3 Stable

The latest patch still doesn't work on my TortoiseSVN. It needs to be re-rolled: to actually work as a patch, and to include comments from Vexed.

@Vexed On strtolower: I really don't think this can happen. Strtolower claims to work well with Intl characters (http://php.net/manual/en/function.strtolower.php)

Changed 5 months ago by VexedPanda

Try this one.

Changed 4 weeks ago by alex94040

  • status changed from assigned to in_QA
  • milestone changed from 1.0.3 Legacy Maintenance to 1.0.4 Legacy Maintenance

Changed 2 weeks ago by alex94040

  • status changed from in_QA to closed
  • resolution set to fixed

(In [934]) Fixes #388 (codegen entering forbidden directories). Code by Marcos and VexedPanda?; small last-minute fix by alex94040. This checkin is for 1.1.

Changed 2 weeks ago by alex94040

(In [935]) Fixes #388 (codegen entering forbidden directories). Code by Marcos and VexedPanda?; small last-minute fix by alex94040. This checkin is for 2.0.

Changed 2 weeks ago by alex94040

  • milestone changed from 1.0.4 Legacy Maintenance to 1.1.3

Fixed for 1.1 and 2.0 - I did have to resolve some more merge conflicts. Codegen code for 1.0 is considerably different, so let's not waste time porting this small fix to an ancient version.

Note: See TracTickets for help on using tickets.